TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
akhil bk
NA
35
1.5k
How to pass both datasource and parameter values to rdlc rep
Dec 26 2018 12:04 AM
private void Test_Load(object sender, EventArgs e)
{
try
{
string sql = "[companyid] ,[companyname] ,[Shopid] ,[shopname],[shopaddress],[shopphone],[fax], [footermsg],[footermsg_ar] FROM [shop] Where id = '1' ";
DataAccess.ExecuteSQL(sql);
DataTable dt = DataAccess.GetDataTable(sql);
ReportDataSource reportDSDetail = new ReportDataSource("DataSet1", dt);
string sqli = "SELECT [logo] FROM [logo] Where id= '1' ";
DataAccess.ExecuteSQL(sql);
DataTable dts = DataAccess.GetDataTable(sql);
string path = Application.StartupPath + @"\LOGO\";
string imagePath = path + dts.Rows[0].ItemArray[0].ToString();
ReportParameter pImageUrl = new ReportParameter("pName", "file://" + imagePath, true);
this.reportViewer1.LocalReport.ReportPath =path+@"Rep.rdlc";
this.reportViewer1.LocalReport.EnableExternalImages = true;
this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { pImageUrl });
this.reportViewer1.LocalReport.DataSources.Add(reportDSDetail);
this.reportViewer1.RefreshReport();
}
catch (Exception ex)
{
MessageBox.Show("Exception=" + ex);
}
}
Reply
Answers (
1
)
Exception Unhandled error in c#
How to sort values entered in textboxes in c#