ComponentOne VSView Reporting Edition > Upgrading from VSReport 1.0 |
VSReport8 is a major upgrade for VSReport 1.0 users. The control has been entirely re-written to take advantage of great new technologies such as OLEDB and XML. It implements features that users have been requesting for a long time such as subreports, HTML/DHTML/PDF export, and more.
VSReport8 also includes a powerful Reports Designer, so creating and customizing your reports is easier than before.
The architecture of the control was also changed. VSReport 1.0 contained a VSPrinter control and used it to display and print reports. VSReport8 is an invisible control that can be connected to VSPrinter controls using method calls. This new architecture allows the programmer complete access to the VSPrinter control and all its powerful features. It also allows you to use VSReport8 in server applications (without a user-interface) to create HTML or PDF reports without using the VSPrinter control.
To upgrade from VSReport 1.0, follow these steps:
Open the VSReport8 Designer and use the File|Import menu to convert your existing report definition files (*.vsr) into the new format (*.xml). You may combine multiple vsr files into a single xml file.
Open your existing project and replace each instance of the VSReport 1.0 control with two controls: place a VSPrinter8 control where VSReport 1.0 used to be and add a VSReport8 control next to it (VSReport8 is an invisible control).
Change your code as follows:
Example Title |
Copy Code
|
---|---|
' replace this code VSReport1.DatabaseName = App.Path & "\biblio2.mdb" VSReport1.ReportFileName = App.Path & "\alphabet.vsr" VSReport1.PrintReport ' with this code VSReport8.Load = App.Path & "\alphabet.xml", "Alphabet" VSReport8.Render VSPrinter8 |
In VSReport8, all data source information is contained in the report definition file, so you don't need to set a DatabaseName property. Each report definition file may contain multiple reports, so the new control uses a Load method instead of the old ReportFileName property. Finally, Render is the method used for rendering a report into a VSPrinter control, replacing the old PrintReport.