Hi there,
I am using in a WPF App following for printing:
--------------------------------------------------------------------------------------
(using Microsoft.Reporting.WinForms;)
Form form = new Form();
ReportViewer reportViewer = new ReportViewer();
reportViewer.ProcessingMode = ProcessingMode.Local;
reportViewer.LocalReport.ReportPath = @"D:\StudentsOverview.rdlc";
reportViewer.LocalReport.DataSources.Add(
new ReportDataSource("students", StudentRepository.Students));
reportViewer.LocalReport.SetParameters(new ReportParameter("ReportName", "My Report"));
reportViewer.Dock = DockStyle.Fill;
form.Controls.Add(reportViewer);
reportViewer.RefreshReport();
form.Show();
----------------------------------------------------------------------------------------------
This works fine but I like to replace this with the Syncfusion ReportViewer (latest version). Unfortunately I can't get it work and cannot find where to set the parameters( for example like: reportViewer.LocalReport.SetParameters(new ReportParameter("ReportName", "My Report"));)
So far I have:
----------------------------------------------------------------------------------------------
(using Syncfusion.Windows.Reports.Viewer;)
ReportPreview printDialog = new ReportPreview();
ReportViewer reportViewer1 = new ReportViewer();
reportViewer1.ProcessingMode = ProcessingMode.Local;
reportViewer1.ReportPath = @"D:\StudentsOverview.rdlc";
reportViewer1.DataSources.Add(new ReportDataSource("students", StudentRepository.Students));
// ??? Not able to find a way to set parameters
printDialog.mainGrid.Children.Add(reportViewer1);
//This doesn't help no matter if I use it or not
printDialog.Loaded += (sender, arg) =>
{
reportViewer1.RefreshReport();
};
printDialog.Show();
-------------------------------------------------------------------------------------------------
This opens a window but nothing happens.
Can you help me with that?
Charalampos