Preview control event

edited 2:27PM in FastReport .NET
Hi


How can I intercept a preview control event?

For example i want open a my form when i click into a text box in a report, like CristalReport Viewer 2008

Thanks sorry for my English

Comments

  • edited 2:27PM
    Hello,

    This can be done in the report script. See "Interactive Reports|Handle Preview Clicks" report.
  • edited 2:27PM
    Hi

    In the report script event i can't reference my application objects instance

    Thanks
  • edited 2:27PM
    You can. To do this:

    - go "Report|Options..." menu, select "Script" tab and add a reference to your application's executable module (for example, "Demo.exe")
    - now you will able to use in a script any public class defined in your app.

    For example, your class:
    namespace Demo
    {
      public partial class Form1 : Form
      {
        public static void TestMessage()
        {
          MessageBox.Show("Hello from the main application!");
        }
        ...
      }
    }
    

    and how it can be used from a script:
    Demo.Form1.TestMessage();
    

    If you need to use some object instance, you may define a public static property in your class and assign an instance to it, before you run a report.
  • edited 2:27PM
    Sorry,
    but i can't it.

    I add a reference to myapplication's executable module GestContab.exe.
    When i try execute the preview the messare error are:
    BC2017: 'Impossible find GestContab.exe'
    BC2000: unexpected error while compiler initializing: Can not find specified file

    Thanks
  • edited 2:27PM
    Of course, both FastReport dll and your application must be in the same folder.
  • edited 2:27PM
    Thanks, now report is exactly as it should be!

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.