How to display Page1 or Page2 click of button

edited 10:30AM in FastReport .NET

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