Error on Filling Variable

Hello,
I am changing the value of the report in Delphi code. Below is what the statement says.
I have the variable defined in the report as rptCompany I have this field on the report in the Report Header.

frxReport.Variables := 'TEST Company';

I am getting the following error and I am not sure why.

Project [Project name] raised exception class Exception with message 'rptCompany: Error in expression 'TEST Company': ';' expected. Process stopped.

Any help would be greatly appreciated.

Eddi Rae

Comments

  • gpigpi
    edited 1:25AM
    frxReport.Variables := ''''+'TEST Company'+'''';
  • edited 1:25AM
    I am not understanding why I have to add the extra quotes. Can you explain the purpose/

    Also, when I did do that, it did work, but now I am having issues with the following:

    frxReport.Variables := frmMainForm.lblHotFluidIdentifier.Caption;

    It is giving the same error for the value that is in the field of the frmMainForm.
  • gordkgordk St.Catherines On. Canada.
    edited 1:25AM
    read the programmers manual on working with the variables
  • edited 1:25AM
    I see it. Thanks for the help!!

    Happy Holidays!!
  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 1:25AM
    I see in the documentation on variables that it says the string being assigned to a variable should not contain #13#10.
    I have been doing this as I want to force a line break in a certain location, but when I do, the single quotes appear in the printout rather than prevent expression evaluation. However, a string WITH #13#10s but WITHOUT the extra quotes works just fine.
    Is there a serious technical reason to avoid embedded CRLFs in the string?
    Thanks, Len.

Leave a Comment