Global Vars

fields24fields24 Tennessee
edited 9:46PM in FastReport 3.0
All,

In creating a report I am declaring global vars under the head of the code
under the var keyword: StartDay : Integer; WorkCodes : string;, etc

On selecting preview while in the editor the correct output appears.

But when running the application I get the error above.

There is one line of code in Delphi 7 that I am executing the frxReport
GetValue procedure: It performs a AnsiCompareText on the field that is
found if it is WorkCodes. It merely passes a string value. It never gets to
this line of code anyway.

What is going on? I have reinstalled Delphi 7 Pro, reinstalled FastReports 3.24 Pro
several times and still get the error. It worked several weeks ago with the same
application.

Using: Windows XP Pro SP2, Delphi 7 Pro, FastReports 3.24, IBObjects 4.7.16

Steve Fields

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 9:46PM
    ongetvalue only fires when a variable from the catagorized list of variables that has no value is encountered. not for variables declared on the reports code page.
    >
  • fields24fields24 Tennessee
    edited April 2007
    Why, then, has the report worked for months without change
    now on a recompile, without changes, does not work?
    Also, on a newly created report, without global variables
    the report works until I add a snip of code like below?

    if (<LINE#> mod 2) = 0 then
    Line1.Visible := True
    else
    Line1.Visible := False;

    I have a defined variable in the Header Line, [STARTDATE]
    so it will not preview, I have to actually run the application.
    But when it comes to OnGetValue and finds STARTDATE it
    chokes with:
    Incompatible types: 'Class String', 'String'

    There is only the code listed above in the report and the code
    below in the Delphi (OnGetValue) code:

    if AnsiCompareStr(VarName, 'STARTDATE') = 0 then
    Value := FormatDateTime('mm/dd/yyyy', Now);

    Steve Fields

    I really like your software and use it heavily. I am just trying
    to track down where I have messed up or a reinstall has gone
    wrong.
  • gordkgordk St.Catherines On. Canada.
    edited 9:46PM
    hi steve it is choking on the '
    don't forget delphi strips string delimiters so you must add extras when passing strings into categorized variables.
    >

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.