Designer Event for Preview
-
- Posts: 62
- Joined: Mon Dec 11, 2006 1:43 pm
- Location: U.S.A.
Designer Event for Preview
When I call report.Design(), I want to be able to catch the event that occurs when the user presses the Preview tab. I want to set report parameters BEFORE the user sees the report in preview mode. Which event I need to catch?
Thanks!
Thanks!
Designer Event for Preview
Report engine have many different events, can you say what you plan do?
Thank you.
Thank you.
-
- Posts: 62
- Joined: Mon Dec 11, 2006 1:43 pm
- Location: U.S.A.
Designer Event for Preview
Maybe I should have said "Report Filters" instead of "Report Parameters." I need an event that allows me to make filter changes before the report is shown to the user in the designer's "preview" mode.
When I call report.Design(), the designer is displayed. The user can add things to the report and then press the Preview tab to see what the report looks like.
Before the report is displayed in "preview" mode, I want to ask the user what values they want to run the report with. For example, I might display a dialog with a list of categories which are "Hardware", "Software", etc. Then, I want to set that value in the report.
report["Category"] = "Hardware";
or
report["Category"] = "Software";
When I call report.Design(), the designer is displayed. The user can add things to the report and then press the Preview tab to see what the report looks like.
Before the report is displayed in "preview" mode, I want to ask the user what values they want to run the report with. For example, I might display a dialog with a list of categories which are "Hardware", "Software", etc. Then, I want to set that value in the report.
report["Category"] = "Hardware";
or
report["Category"] = "Software";
Designer Event for Preview
1. You can use internal report dialog. In this case you can use following code on button Ok:
Please see category Dialogs in Demo application.
2. You can show your own WinForms dialog in BeginRenderEvent:
using (MyForm form = new MyForm())
{
form.ShowDialog();
Category = form.ListBox1.SelectedItem as string;
}
In this case you need add reference to assembly with your dialog to ReferencedAssemblies property of Report.
For also you need add using (or Improts in vb.Net) to report code.
Thank you.
Code: Select all
Category = ListBoxControl1.SelectedItem as string;
2. You can show your own WinForms dialog in BeginRenderEvent:
using (MyForm form = new MyForm())
{
form.ShowDialog();
Category = form.ListBox1.SelectedItem as string;
}
In this case you need add reference to assembly with your dialog to ReferencedAssemblies property of Report.
For also you need add using (or Improts in vb.Net) to report code.
Thank you.
-
- Posts: 62
- Joined: Mon Dec 11, 2006 1:43 pm
- Location: U.S.A.
Designer Event for Preview
It sounds like option #2 is what I want to do. However, my event handler wasn't called when I pressed the Preview button (or chose File/Preview from the menu).
I added this code:
m_report.BeginRender += new EventHandler(m_report_BeginRender);
m_report.Design();
//This is my event handler
private void m_report_BeginRender(object sender, EventArgs e)
{
int a = 1; //bogus line of code just to see if event handler gets called.
}
I also tried to subscribe to the page BeginRender event, but still the event handler didn't get called:
m_report.Pages[0].BeginRender += new EventHandler(m_report_BeginRender);
I added this code:
m_report.BeginRender += new EventHandler(m_report_BeginRender);
m_report.Design();
//This is my event handler
private void m_report_BeginRender(object sender, EventArgs e)
{
int a = 1; //bogus line of code just to see if event handler gets called.
}
I also tried to subscribe to the page BeginRender event, but still the event handler didn't get called:
m_report.Pages[0].BeginRender += new EventHandler(m_report_BeginRender);
Designer Event for Preview
If you want call event handler for all report which showed in report designer then you need use static event StiDesigner.PreviewingReport.
Thank you.
Thank you.
Designer Event for Preview
Under which namespace and classes does StiDesigner belongs to?If you want call event handler for all report which showed in report designer then you need use static event StiDesigner.PreviewingReport.
I have tried StiDesigner.PreviewingReport, but it doesn't recognise StiDesigner!!
Sandy, I have sucessfully captured an event on the okay button of an stiform on my report designer. Here is the code
Code: Select all
Dim btnStockCodeOkayEvent As New Events.StiClickEvent("StockCode=GetVariableValues(lBoxStockCode)" & vbCrLf & "If StockCode.Length > 0 Then StockItems.Connect()")
btnStockCodeOkay.ClickEvent = btnStockCodeOkayEvent
Basically, if you choose the Event from the control, then you should be able to write directly into the script, and this seems to work.
hope this helps
Designer Event for Preview
Stimulsoft.Report.DesignUnder which namespace and classes does StiDesigner belongs to?
I have tried StiDesigner.PreviewingReport, but it doesn't recognise StiDesigner!!
Thank you.
-
- Posts: 62
- Joined: Mon Dec 11, 2006 1:43 pm
- Location: U.S.A.
Designer Event for Preview
I couldn't find a PreviewingReport event under Stimulsoft.Report.Design.StiDesigner. I tried both the release code and the latest service pack (2/12/07).
Designer Event for Preview
This property is static. So please set it for the class not for the object of the class.
Thank you.
Thank you.