Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: Report display error Post Reply Post New Topic
Author Message
phantom_244
Newbie
Newbie


Joined: 23 Jan 2011
Online Status: Offline
Posts: 3
Quote phantom_244 Replybullet Topic: Report display error
    Posted: 23 Jan 2011 at 7:21am

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!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.016 seconds.