Internal parameters

edited 3:35PM in FastReport .NET
Is there a way to define "internal" parameters? I need to use a lot of variables or parameters that are defined in the constructor, or the value is on-the-fly. They shoud not be public or appear in the report designer, but I need to use them in the report, via [MyCustomParam].

Is there are an event where I can assign the value to a variable not defined as parameter in the FR instance?

Thank you

Comments

  • edited 3:35PM
    Hello,

    You may declare private variables inside the "ReportScript" class in the script. For example:
      public class ReportScript
      {
        private int myIntParam;
      }
    

    Usage in the text object:
    [myIntParam]

    Usage in the expressions:
    myIntParam + 5

    The only problem is that you cannot pass a value from your application to such variable.
  • edited March 2010
    Sorry, maybe "internal" term has induced to confusion. I did not mean the internal or private C# operator.

    I meant how to build a system where I can assign variable values dynamically from the application C# source (not the report source), and these variables do not appear as parameters in the report designer panel.

    In FR4, I used the OnGetVarValue event. I am looking for a similar system in FR.Net.

    The report has many variables that are assigned from the source. For example, license name, current time, internal variables related with the database, system variables, etc.

    I cannot use the parameter feature because then, they appear in the report designer panel.

    I would like to use something like the OnGetVarValue event, where I can assign the value when it is required.

    Thank you
  • edited 3:35PM
    In FR4, I used the OnGetVarValue event. I am looking for a similar system in FR.Net.
    
    There is no way to do that. All report parameters must be declared. Undeclared items will throw compiler errors.
  • edited 3:35PM

    Is there a way to declare them and specify that they are not public (do not appears in the designer panel)?

    In many scenarios, some parameters should not be displayed in the panel, and also, the should be "read-only".

    For example: LicenseName, some MemberShip variables, some values of configurations that cannot be read using SQL, etc.

    If there is not a way, can you consider to add this feature in a future?

    Thank you
  • edited 3:35PM
    Ok, I will think about implementation.

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.