This is a migrated thread and some comments may be shown as answers.

Printing Directly To Printer

2 Answers 890 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jonah
Top achievements
Rank 1
Jonah asked on 27 Apr 2015, 05:29 PM
I am trying to print directly to a printer using the code listed here. However I need to pass parameters to my report. Is there a way to do that when trying to print directly?

2 Answers, 1 is accepted

Sort by
0
Stef
Telerik team
answered on 28 Apr 2015, 02:48 PM
Hi Jonah,

You can send values to report parameters through the wrapping report source object. the ReportSource.Parameters collection is mapped by key to the report's ReportParameters collection. The key is the parameter's name which is case sensitive.

For more details, please check Report Sources.

Regards,
Stef
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Jonah
Top achievements
Rank 1
answered on 28 Apr 2015, 05:17 PM

Thank you for the response. I was able to get this figured out, and here is a little bit of code if anyone else stumbles on either the report name or the parameters.

Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
'set any deviceInfo settings if necessary
Dim typeReportSource As New Telerik.Reporting.TypeReportSource()
typeReportSource.TypeName = GetType(WPFControls.RptPrintTicket).AssemblyQualifiedName
typeReportSource.Parameters.Add("InvoiceNumber", "")
typeReportSource.Parameters.Add("ProductLocationID", "")
typeReportSource.Parameters.Add("ProductID", "")
typeReportSource.Parameters.Add("PartOrderID", dtInsPackage.Rows(0).Item(0).ToString())
'' Obtain the settings of the default printer
Dim printerSettings As New System.Drawing.Printing.PrinterSettings
printerSettings.PrinterName = fcGlobals.GetDefaultPrinter()
reportProcessor.PrintReport(typeReportSource, printerSettings)

Tags
General Discussions
Asked by
Jonah
Top achievements
Rank 1
Answers by
Stef
Telerik team
Jonah
Top achievements
Rank 1
Share this question
or