Crystal Reports的路径设置 [英] Path setting for Crystal Reports

查看:98
本文介绍了Crystal Reports的路径设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经使用位于项目文件夹中的xml生成了Crystal报表,并选择了数据库专家作为ADO.NET,并从保存xml文件夹的本地文件夹中物理选择了xml文件.

在我的本地计算机上,报表运行良好,但是当我将项目加载到服务器中时,我设置的第一页将显示为

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

但是当我单击下一步"按钮时,它向我显示错误,因为找不到路径并显示我的本地路径,

这是我完整的代码:

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\tiger\Desktop\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...


推荐答案

首先在Crystal报告中的该报告中验证数据库.然后根据错误(您在问题中提到的错误),也应在运行时应用登录详细信息.因此,请点击以下链接.

了解Crystal Reports中的登录失败错误 [ ^ ]

使用带有.NET的Crystal Reports对数据库登录错误进行故障排除 [ ^ ](此代码包含在运行时应用登录详细信息的代码)
First do verify database in that report in crystal report. Then based on error(which you have mentioned in your question) you should apply logon details at run time too. So follow the below links.

Understanding the Login Failed Error in Crystal Reports[^]

Troubleshooting Database Login Errors using Crystal Reports with .NET[^](This one contains code for applying logon details at runtime)


这篇关于Crystal Reports的路径设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆