Scenario: i iterate through some reports, and to preview them i use your preview form (i don't use the control). Because i have the iteration, i need to make appear in the preview toolbar two buttons: "Previous report" and "Next report" and i need to catch their click events.
Is it possible?
Thanks.
Add a button in preview form
- Fabio Pagano
- Posts: 355
- Joined: Mon Apr 16, 2007 12:38 pm
- Location: Bari (Italy)
Add a button in preview form
Yes, it is possible to add buttons to the toolbar of the StiPreviewControl of the custom StiPreviewForm. Please see the following code:
Thank you.
Code: Select all
Stimulsoft.Report.Render.StiPreviewForm previewForm = new Stimulsoft.Report.Render.StiPreviewForm();
Stimulsoft.Controls.StiButton myButton1 = new Stimulsoft.Controls.StiButton();
Stimulsoft.Controls.StiButton myButton2 = new Stimulsoft.Controls.StiButton();
myButton1.Text = "myButton1";
myButton2.Text = "myButton2";
myButton1.Click += new EventHandler(myButton1_Click);
myButton2.Click += new EventHandler(myButton2_Click);
myButton1.Dock = DockStyle.Left;
myButton2.Dock = DockStyle.Left;
previewForm.PreviewControl.ToolBar.Controls.Add(myButton2);
previewForm.PreviewControl.ToolBar.Controls.Add(myButton1);
previewForm.Show();