How to un-/hide certain pages

I've made a report with several pages. I want to pass data if a specific page should be shown. There is the Visible property which can be changed so I tried to change it programatically.

I used the class code and added a constructor "public ReportScript()" and set the "Page.Visible = false;" but it did not work. So I tried several events and placed a "Page2.Visible = false;" but it did not work either.

Where and how do I have to enter the code to set a page to visible or not ?
namespace FastReport
{
  public class ReportScript
  {         
    public ReportScript()
    {
      Page2.Visible = false;
    }
  }
}

Comments

  • edited 9:37AM
    I can use one of the events of the first displayed page to set all pages necessary to visible or not.

    The problem is you can't hide the very first page if you use any of these events. How to hide the first page ? Are there any further events which will occur earlier ?
  • edited September 2016
    Ok - it's like always - I searched 2 days - wrote into this forum and then found the solution.

    For others searching for the same:

    On the right top where "Berichtsbaum" is located click on the top element. Here it's "Report - reports/application_1.frx". It groups all elements together in one report. When you select this report use the window beneath and click on the events icon. There you will find the "StartReport" and "FinishReport" events - use the StartReport to hide the very first page.

    [closed]
  • edited September 2016
    i think you should use subreport. in the main report (main.frx), create hyperlink and create script in main.frx to execute a function in .net application.

    since class is singleton, use mvvm light to communicate between classes (class in fastreport script and class in formUI)

    see http://blog.galasoft.ch/posts/2009/09/mvvm...t-messenger-v2/
    // Somewhere
    Messenger.Default.Register<string>(this, DoSomething);
     
    // Further
    private void DoSomething(string message)
    {
        // ...
    }
     
    // Somewhere else
    Messenger.Default.Send(???Hello world???);
    

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.