How to attach an object to a Report instance?

I need to "attach" an object to a Report instance. This object is used by some custom FR functions.
When I say "object", I mean the .Net class object, not a FR object. It is not visible, it is just a reference to a instance.

How can I do it?


Thank you

Comments

  • edited 8:44AM
    Use the report parameter:
    report.SetParameterValue("myRef", some_reference);
    In the report, you have to add a reference to an assembly containing this class.
  • edited 8:44AM
    Thank you, it works fine. Can I hide it from the editor panel? I do not want that the user see the "internal" parameters. They are used only by my custom functions. Users do not need to see, delete or modify these values.

    Let me explain, when I load the report, I "attach" an environment object to the report with customer information, like the license, customer name, etc..
    This instance is used by some custom functions, but the user does not need to know it. When I call a function, I pass the Report instance as variable, so then I have access to this "attached" object.


    report.SetParameterValue() works fine, but then the instance, or at least the name and type are visible by the user.

    Is there a way to attach an object to a report instance without to be public?

    My other option is to create a derived class, for example:

    class MyReport : Report
    {
    public:
    object MyAttachedObject;

    }


    but I expected to find a more direct way.

    Thank you




  • edited 8:44AM
    There is no way to hide some report parameters from the user.

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.