0

I have a form in my application that contains one report viewer that embed rptPrint.rdlc using Dataset(dtsPrint.xsd).

here is my code:

reportViewer1.LocalReport.DataSources.Clear();
reportViewer1.LocalReport.ReportEmbeddedResource = "Test.Reports.rptPrint.rdlc"; 
reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SubreportProcessing);


Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("dtsPrint", dtPrint); 
reportViewer1.LocalReport.DataSources.Add(dataset);
dataset.Value = dtPrint;

reportViewer1.LocalReport.Refresh();
reportViewer1.RefreshReport();

that binds perfectly in report viewer.

But i need the way that that binds the report as well as open a print dialog that prints the document

I have googled so much but no success. Is it possible to do ? if yes then how can i implement it??

Thanks in Advance

Aijaz Chauhan
  • 1,511
  • 3
  • 25
  • 53
  • Take a look at: http://stackoverflow.com/questions/17716657/how-to-directly-print-rdlc-report-without-showing-printdialog-in-c and http://msdn.microsoft.com/library/ms252091.aspx – InitK Jan 19 '15 at 14:38
  • but this report contains subreport also...will it work that way? – Aijaz Chauhan Jan 19 '15 at 14:45
  • Yes, if you add handler for your subreport processing to properly bind subreport dataset to your datatable. – InitK Jan 19 '15 at 15:00

0 Answers0