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 2:21AM
    use the ongetvalueevent in delphi it fires when the variable has no value.
  • edited 2:21AM
    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 2:21AM
    Report -> Variables; Select variable and put a value into the expression box at the bottom.

Leave a Comment