i have a main report that contains some sub report. Each sub report
will load data from database via stored procedures and then these sub
reports was added to Main report. I run this report on local
sucessfully, but when i deploy on server, it shows error Database logon fail.
In my code i have set database connect to database (connection string
get from web.config that the same with connection of server). I have a
question about this error? Why it run successfully on local, when
deploy to server it fail? Does i need to add some lines of code to my
class? these is my code:
ReportDocument rp = new ReportDocument();
//Load report file
rp.Load(ReportHelper.GetReportPath("Report path"));
//Set up connection
rp.SetDatabaseLogon("uid", "pwd", "server","database");
//Add data to Subreport:
rp.OpenSubreport("SubReportName_1").SetDataSource(GetReport_1().Tables[0]);
rp.OpenSubreport("SubReportName_2").SetDataSource(GetReport_2().Tables[0]);
//Bind to report viewer
ReportView_1.ReportSource = rp;
ReportView_1.DataBind();
Please help me! it's urgent :(. Thanks all so much!