Capturing report new and report open events in the report designer
Capturing report new and report open events in the report designer
Hi,
How do I capture the event when the user is creating a new report and when the report open button is pushed in the Report Designer?
I would like to reset the database connection when that happens.
thanks
How do I capture the event when the user is creating a new report and when the report open button is pushed in the Report Designer?
I would like to reset the database connection when that happens.
thanks
Capturing report new and report open events in the report designer
Ok, I managed to capture the event when the report open button is pushed.
Here is my code:
It works fine except that when I try to create a new report by pushing the "New Report" button, the database connection string is still set to the report I opened before.
I need the database connection to set to the orginal settings (ie. When I opened the designer originally, I set it to point at database "x_exonet"). How can I get around this?
thanks
Here is my code:
Code: Select all
AddHandler Stimulsoft.Report.Design.StiDesigner.LoadingReport, AddressOf TestFunction
Private Sub TestFunction(ByVal sender As Object, ByVal e As Stimulsoft.Report.Design.StiLoadingObjectEventArgs)
If OpenFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
Dim designer As Stimulsoft.Report.Design.StiDesigner = sender
designer.Report.Dictionary.Clear()
designer.OpenFile(OpenFileDialog.FileName)
Dim database As Dictionary.StiSqlDatabase = designer.Report.Dictionary.Databases("Exonet")
database.ConnectionString = "Data Source=" & db.Server & ";Initial Catalog=exonet_copy619;User Id=" & db.UserID & ";Password=" & db.Password
End If
End Sub
I need the database connection to set to the orginal settings (ie. When I opened the designer originally, I set it to point at database "x_exonet"). How can I get around this?
thanks
Capturing report new and report open events in the report designer
So if I understood in the right way you need to set a previous Connection for the report which will be created after pressing the New Report button?
Please describe with more detail.
Thank you.
Please describe with more detail.
Thank you.
Capturing report new and report open events in the report designer
I would like to set a new database connection after pressing the New Report button - so I need to have control over the new report event I think.
Can this be done?
thanks
Can this be done?
thanks
Capturing report new and report open events in the report designer
Futher on report open button event,
Does StiDesigner.LoadingReport only called when I click the open button in the Designer?
Because for some reason the event is sometimes called multiple times.... I can't find a pattern to it, sometimes it happens, sometimes it doesn't.
I suspect it's something to do with the designer, When I called designer.OpenFile(reportfilename) or designer.report.load(reportfilename)...
Is there a way to determine when the report has finished loading in the designer? I can put a thread to sleep while it is loading to stop it calling the event !!
Any help on this will be great (Also, is there a documentation on all methods?)
Thanks
Does StiDesigner.LoadingReport only called when I click the open button in the Designer?
Because for some reason the event is sometimes called multiple times.... I can't find a pattern to it, sometimes it happens, sometimes it doesn't.
I suspect it's something to do with the designer, When I called designer.OpenFile(reportfilename) or designer.report.load(reportfilename)...
Is there a way to determine when the report has finished loading in the designer? I can put a thread to sleep while it is loading to stop it calling the event !!
Any help on this will be great (Also, is there a documentation on all methods?)
Thanks
Capturing report new and report open events in the report designer
If you add event handler to LoadingReport event then standard event handler is skipped. If you need call standard event handler you need add following code:jing wrote:Futher on report open button event,
Does StiDesigner.LoadingReport only called when I click the open button in the Designer?
Because for some reason the event is sometimes called multiple times.... I can't find a pattern to it, sometimes it happens, sometimes it doesn't.
I suspect it's something to do with the designer, When I called designer.OpenFile(reportfilename) or designer.report.load(reportfilename)...
Is there a way to determine when the report has finished loading in the designer? I can put a thread to sleep while it is loading to stop it calling the event !!
Any help on this will be great (Also, is there a documentation on all methods?)
Thanks
Code: Select all
e.Processed = false;
Thank you.
Capturing report new and report open events in the report designer
We have added following static events:
Thank you.
Code: Select all
StiDesigner.LoadedReport//Occurs only if report loaded successfully
StiDesigner.SavedReport//Occurs only if report saved successfully
StiDesigner.CreatedReport//Occurs only if report created successfully
StiDesigner.CreatingReport
Capturing report new and report open events in the report designer
Which build contains these events? I am using build StimulReport.Net 2007.02.16 R2005 and I can't see these events yet.We have added following static events:
StiDesigner.LoadedReport//Occurs only if report loaded successfully
StiDesigner.SavedReport//Occurs only if report saved successfully
StiDesigner.CreatedReport//Occurs only if report created successfully
StiDesigner.CreatingReport
I am doing this, but the LoadingReport is sometimes called multiple times - I only needed to call it once (I don't quite understand why it is sometimes called multiple times) ... Here is my codeIf you want fully process this operation then you need manually load report to designer.
Code: Select all
AddHandler Stimulsoft.Report.Design.StiDesigner.LoadingReport, AddressOf OpenMyReportFile
Private Sub OpenMyReportFile(ByVal sender As Object, ByVal e As Stimulsoft.Report.Design.StiLoadingObjectEventArgs)
If _loadingReport = False Then
_loadingReport = True
Dim dialogR As Windows.Forms.DialogResult = Nothing
dialogR = MyOpenFile.ShowDialog
If dialogR = Windows.Forms.DialogResult.Cancel Then
_loadingReport = False
Exit Sub
End If
If dialogR = Windows.Forms.DialogResult.OK Then
Dim designer As Stimulsoft.Report.Design.StiDesigner = sender
designer.Report.Dictionary.Clear()
designer.Report.Load(MyOpenFile.FileName)
For Each d As Dictionary.StiSqlDatabase In designer.Report.Dictionary.Databases
d.ConnectionString = "Data Source=" & db.Server & ";Initial Catalog= " & db.Database & ";User Id=" & db.UserID & ";Password=" & db.Password
Next
_loadingReport = False
End If
End If
End Sub
Capturing report new and report open events in the report designer
Sorry, build will be available only today.
We will check problem with multiple events running.
Thank you.
We will check problem with multiple events running.
Thank you.
Capturing report new and report open events in the report designer
Please define a static constructor for your form (for example Form1). It is gets a guarantee that Event Handler OpenMyReportFile will be added to the static event StiDesigner.LoadingReport only once.
Thank you.
Code: Select all
Shared Sub New()
AddHandler StiDesigner.LoadingReport, New StiLoadingObjectEventHandler(AddressOf Form1.OpenMyReportFile)
End Sub