NavCore NavCore - 1 month ago 35
C# Question

Print RDLC Report without showing ReportViewer Control

I was wondering if is possible to send/print data from

DataGridView
directly to rdlc report without binding it to
ReportViewer
control.

There are many threads about binding dgv data to report viewer control.
I don't want to create another form with report viewer control, but use existing form with data on
DataGridView
and on print button to send the data to
RDLC
report and print it.

Is it possible?

Thanks

Answer

As an option you can print an RDLC report programmatically using LocalReport object and CreateStreamCallback callback function. Here is a complete msdn walkthrough:

As another option put a ReportViewer on form and set the Visible property of the control to false then pass data to the report and when the RenderingComplete event fired, call PrintDialog:

Comments