How to display Page1 or Page2 click of button


How to display Page1 as Report or Page2 as Report on click of button on New dialog form


I have created the report using New Report Page in FastReport.Net , but I have facing issue how we display Page1 on click of button.

I have found one solution, using this Page1 display but report data not display.

Dim report As Report = New Report()
Dim page1 As ReportPage = New ReportPage()
page1.Name = "Page1"
report.Pages.Add(page1)

page1.ReportTitle = New ReportTitleBand()
page1.ReportTitle.Name = "ReportTitle1"

Dim text1 As TextObject = New TextObject()
text1.Name = "Text1"
text1.Text = "REPORT TITLE TEXT"
text1.HorzAlign = HorzAlign.Center
text1.Font = New Font("Tahoma", 14, FontStyle.Bold)
text1.AutoWidth = True
text1.Height = 100
page1.ReportTitle.Objects.Add(text1)

report.Show()

Comments

  • edited October 2017
    use script, not "report from code"
      public class ReportScript
      {
        private void Form1_Load(object sender, EventArgs e)
        {
          Button1.DialogResult = DialogResult.OK;
          Button2.DialogResult = DialogResult.OK;
        }
    
        private void Button1_Click(object sender, EventArgs e)
        {      
          Page1.Visible = true;
          Page2.Visible = false;                         
        }
    
        private void Button2_Click(object sender, EventArgs e)
        {      
          Page1.Visible = false;
          Page2.Visible = true;             
        }
      }
    
  • edited October 2017
    Thank You For Reply.

    It Work properly.

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.