Path setting for Crystal Reports

Posted by Sathya4260 under ASP.NET on 1/31/2011 | Points: 10 | Views : 4768 | Status : [Member] | Replies : 2
Hi,

I have generated crystal reports using xml located in project folder, and selected the database expert as ADO.NET and physically selected the xml file from the local folder where i kept the xml folder.

With in my local machine the report runs well, but when i load the project in server, my first page is viewed as i set

report.Load(Server.MapPath(@"reports\TrialBalancedup.rpt"));

but when i click the next button it shows me error as cann't able to find the path and shows my local path,

Here is my complete code:

ReportDocument report = new ReportDocument();
report.Load(Server.MapPath(@"reports\TrialBalancedup.rpt"));
lblReportPath.Text = Server.MapPath(@"reports\TrialBalancedup.rpt");
report.SetDataSource(dtTrialBalance);
CryRptVwIncomeStatement.ReportSource = report;
CryRptVwIncomeStatement.DataBind();

Error:

Logon failed. Details: mscorlib : Could not find a part of the path 'C:\Documents and Settings\spicy tiger\Deskto\xml\IncomeStatement.xml'. Error in File C:\Windows\TEMP\IncomeStatement {38001340-E8BB-4FD4-9128-036BF91C2BE0}.rpt: Unable to connect: incorrect log on parameters.

Can any one advice me how to solve this issue, Kindly let me know ASAP...

Thanks in advance...

Sathish Kumar S


Responses

Posted by: Vuyiswamb on: 2/1/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
try this

report.Load(Server.MapPath("~/reports/TrialBalancedup.rpt")); 


Thank you for posting at Dotnetfunda
[Administrator]

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 2/1/2011 [Member] Starter | Points: 25

Up
0
Down
At initial stage I used path like this only, but still cann't get the solution

Sathish Kumar S

Sathya4260, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response