About user defined variables

When i add new variable { frxReport1.Script.AddVariable('Myvar', 'String', 'MyString')},
the report bands and scripts use this variable without any incorrect operations. Morever in the previous version of the FS (3.15), this variable shows in the variables section on the report design page. But, now I use 3.20 and this varieble isn`t visible.

How can i realize visiblity of my additional variables in the variable section of the desing page?

thanks

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 12:13AM
    you are adding to script so unseen

    If a variable is to be added to the specified category, use the ???AddVariable??? method:

    frxReport1.Variables.AddVariable('My Category 1', 'My Variable 2', 10);
  • edited 12:13AM
    ;)

    Hello,

    I would like to pass a variable from the main program to the report
    and I followed the following steps:

    1) Create a new Variable group pressing on "FX" button in the report
    toolbar

    2) Added a categor "RepVars" and a variable called "monthx"

    3) The OnClick procedure for the button Preview of the report is as the
    following:

    procedure TForm1.Button2Click(Sender: TObject);
    begin

    frxReport1.Variables.AddVariable('RepVars', 'monthx', 'January');
    frxReport1.DesignReport;
    frxReport1.ShowReport(True);
    end;


    But when I click on the button I get the following Error:

    "Project Project1.exe raised exception class EVariantTypeCastError with message 'Could not convert variant of type (String) into type (Double)'."

    Where do I set the variable type? In the code section of the report?

    Thank you in advance!

    neko

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.