Table of Contents
Valentina Reports to Printer
The Valentina Reports engine can print generated reports directly to a printer using methods included in Valentina Reports.
There are several ways to print:
- 1.1 LOCAL application to a LOCAL printer
- 2.1 CLIENT application to a LOCAL printer
- 2.2 CLIENT application to a SERVER printer
Print to a LOCAL Printer
Usual printing as it is done in the majority of other applications can be performed using PrintToLocalPrinter() method. It creates a printing job for the printer, which is installed in the system, where user application is running.
Dim theReport As VReport = theProject.MakeNewReport theReport = theProject.MakeNewReport( "report_1", "mysql://host=127.0.0.1,dbname=db1,user=root,password=root", "SELECT fldName, fldPhone FROM tblPerson" ) theReport.PrintToLocalPrinter( "LBP3000", "paper=A4" );
The list of installed printers can be found using LocalPrinters() method.
Dim printers As VStringArray = theReport.LocalPrinters()
Requirements
- LOCAL App contains VREPORT DLL, which do printing.
- CLIENT App on Mac and Linux can have only VCLIENT+VSHARED DLLs and get printing! On Windows you still must include VREPORT + VKERNEL DLLs to be able do printing.
Print to a Server Printer
Printing a report, stored on a Valentina Server, gives even more options. In addition to printing to locally installed printer, it is possible to create a print job for a printer attached to a computer where Valentina Server is working, using PrintToServerPrinter() method.
Dim theReport As VReport = theProject.MakeNewReport theReport = theProject.MakeNewReport( "report_1", "mysql://host=127.0.0.1,dbname=db1,user=root,password=root", "SELECT fldName, fldPhone FROM tblPerson" ) theReport.PrintToServerPrinter( "LBP3000", "paper=A4" );
The list of printers installed on the server can be found using ServerPrinters property.
Dim printers As VStringArray = theReport.ServerPrinters()
Both PrintToLocalPrinter() and PrintToServerPrinter() allow to specify options to tune printer output.