variables default value

Hello,

I have a variable that is set by Delphi and therefore is "null" when I try to show the preview within the FR form.

Because the value is undefined, I only get an "expression expected" error.

Can I set a default value that is used as long as the value is not set from extern?

I tried:
  try      
  dummy := <RepTitle>;  
 except                   
    Set('RepTitle', '''Titel''');
 end;

in the BeforePrint Method and by this the report is generated and correctly shown, but still showing the error, because RepTitel is undefined in the try part of the exception.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:43AM
    use the ongetvalueevent in delphi it fires when the variable has no value.
  • edited 11:43AM
    gordk wrote: »
    use the ongetvalueevent in delphi it fires when the variable has no value.

    I must set this value without delphi. When I design a report, which uses Variables, that later will be set by delphi and currently have no value, then I want to set a defualt value in FastReport directly, to be able to preview the design without the need to compile and run the delphi application.
  • edited 11:43AM
    Report -> Variables; Select variable and put a value into the expression box at the bottom.

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.