Generator to run needs the following libraries:
Almost one class that you use for creating reports are:
- Report – The base class contains all the methods and properties for defining report templates, report generation, direct printing and exporting to various formats, eg. PDF, JPG, PNG, WMF.
- PrintControl – user control to generate reports, preview pages, direct printing, choose a printer, export to PDF, JPG, PNG and WMF
- PrintForm – window with embedded component PrintControl and the same properties as the component PrintControl.
Simple report generation and view preview
The easiest way to preview the report is using the form PrintForm or custom components PrintControl. Here you call method GenerateReport with parameters template path and data. The method automatically creates the report and previews of each pages.Then the user can use the buttons on the top bar to print the report to a printer or saved in PDF, PNG, JPG and WMF.
Dim frm As New Reporting.PrintForm()
Direct printing without preview
Direct printing or exporting procure Class Report. Method Generate Report generates a report and the Print method will take care of printing directly to a printer and SaveAs method to save the report to different formats.
Dim xReport = Reporting.Report.GenerateReport(„DemoReport.jprep“, xDataSources)
Class JelinekPetr.Reporting.PrintControl and JelinekPetr.Reporting.PrintForm
Print Form is functionally exactly the same as PrintControl.
function GenerateReport(templateFileName As String, dataSources As List(Of Object)) As Report
function GenerateReport(templateFileName As String) As Report
Processes the data using the template and creates previews (Report.Previews property).
templateFileName – template path
dataSources – data objects to generate a report
method Print(templateFileName As String, direct As Boolean, copies As Int32) – method first calls itself GenerateReport
method Print(printerSettings As Drawing.Printing.PrinterSettings) – before using a method must be called GenerateReport
method Print(copies As Int32) – before using a method must be called GenerateReport
method Print() – before using a method must be called GenerateReport.
Prints the report to the printer according to the parameters passed. If it is not passed the name of the printer will print on the default printer.