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 7:11PM
    frxReport.Variables := ''''+'TEST Company'+'''';
  • edited 7:11PM
    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 7:11PM
    read the programmers manual on working with the variables
  • edited 7:11PM
    I see it. Thanks for the help!!

    Happy Holidays!!
  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 7:11PM
    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

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.