Adding ReportParameter in Microsoft Report Viewer 2010

I Started using Microsoft Report these days, struggled a bit with ReportParameter. This following code shows how to use ReportParameter with Microsoft Report Viewer 2010.



Class1 cl1 = new Class1(); cl1.One = "1"; cl1.Two = "123"; cl1.Three = "123";
list.Add(cl1);

reportViewer1.LocalReport.ReportPath = @"E:\ImageExperiment\ImageExperiment\ImageExperiment\Report2.rdlc";

reportViewer1.LocalReport.EnableExternalImages = true;

List param1 = new List();
param1.Add(new ReportParameter("ReportParameter1", @"C:\a1.jpg"));
param1.Add(new ReportParameter("ReportParameter2", @"C:\a2.jpg"));
param1.Add(new ReportParameter("ReportParameter3", @"C:\a2.jpg"));
reportViewer1.LocalReport.SetParameters(param1);

Class1BindingSource.DataSource = list;

reportViewer1.RefreshReport();

Thanks
A Rahim Khan

Advertisements
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: