Re: Create an initial generic ActiveReport to be used later as a specific report
ActiveReports 6 Support
Create an initial generic ActiveReport to be used later as a specific report
03-10-2010, 1:22 PM
What I would like to do is create an initial generic ActiveReport object and then based on some criteria in the application either cast that object to or make that object equal to an actual active report object and then be able to access the fields and so on.
Is this possible? If so, how would I go about doing something like this? I have like 15 or so reports that are generated from from this one exe based on certain criteria that is passed to the app.
Re: Create an initial generic ActiveReport to be used later as a specific report
03-11-2010, 7:33 AM
Hello,
Thank you for your query. What you can do here is :-
1) Save all of your 15 reports as RPX..
2) Create a new object of ActiveReports6 (reportmain).
3) Using
loadlayout
load the RPX into reportmain and access the fields.
But in order to access the controls, you will need to cast the same into their native types. For example, if reportmain has a textbox named textBox1, and you wish to access the text property of the same, you will need to write code as
System.Xml.XmlTextReader xml = new System.Xml.XmlTextReader ("c:\\Report.rpx");
DataDynamics.ActiveReports.ActiveReport reportmain = new DataDynamics.ActiveReports.ActiveReport ();
reportmain. Loadlayout (xml);
((DataDynamics.ActiveReports.TextBox)(reportmain.Sections["detail"].Controls["textBox1"])).Text = "this is test";
reportmain.run ()
Regards,
Prantik