Displaying variables

I am successfully declaring variables in my Fast Report via Delphi, before showing the design window.
In the report, I simply click on the variable in the Data Tree, and drag it onto a band (in my case the page header).
When I preview the report I get an error looking something like this:

ReportName: Error in expression 'XXX': ';' expected

(ReportName is my variable name, XXX would be whatever value I have in the report).

Any ideas on what I am doing wrong?

Thanks in advance
-Graeme

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 6:59PM
    unless the variable has been given a value, when you preview from the ide you will get an error as the ongetvalue event for the variable is triggered and you don't have acess to the external runtime
    event handler.
  • edited 6:59PM
    Thanks for the reply.
    I was getting the error at run time, and have just figured out it was a simple RTFM case.
    The help doc has a note about adding string variables like this:

    FastReport.Variables[sVarName] := '''' + sVarValue + '''';

    whereas I was adding string variables like this:

    FastReport.Variables[sVarName] := sVarValue;

    Thanks again for taking the trouble to answer me.

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.