Windows应用程序中的加载报告失败 [英] Load Report failed in windows application
本文介绍了Windows应用程序中的加载报告失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好b $ b
我无法在Windows应用程序中加载报告路径。它会引发错误加载报告失败。以下是我的示例代码。
Hi
I cannot load a report path in windows application. it throws an error Load Report failed. Below is my sample code.
ReportDocument rdoc = new Reportdocument();
string filename = Application.StartupPath + @"Reports\Report\CrystalReport.rpt";
rdoc.Load(filename);
我尝试将文件路径作为Application.StartupPath ,只给出报告名称和
尝试
filename =.. \\\ Reportport \ Report\\ CrystalCorealport.rpt
这个解决方案都不适合我..
请建议
I tried the filepath as Application.StartupPath, Just given only the report name and
tried
filename = "..\Reports\Report\Crystalreport.rpt"
neither of the solution worked for me..
Kindly advise
推荐答案
filename = Application.StartupPath.Substring(0,Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\")) + @"\Reports\Report\Crreport.rpt";
解决问题
Solves the problem
问题未解决。发生错误这是我的代码:
DataSet dssearch = CRUD.Select(Table,Field1);
ReportDocument rd1 = new ReportDocument();
string filename = Application.StartupPath.Substring(0,Application.StartupPath.Substring(0,Application.StartupPath.LastIndexOf(\ \))。LastIndexOf(\\))+ @\ Report \ datewiseorder1.rpt;
rd1.Load(filename);
rd1.SetDataSource(dssearch.Tables [0]);
crystalReportViewer1.ReportSource = rd1;
Problem is not solved.Same error is comes.
Here is my Code:
DataSet dssearch = CRUD.Select("Table", "Field1");
ReportDocument rd1 = new ReportDocument();
string filename = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0, Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\")) + @"\Report\datewiseorder1.rpt";
rd1.Load(filename);
rd1.SetDataSource(dssearch.Tables[0]);
crystalReportViewer1.ReportSource = rd1;
这篇关于Windows应用程序中的加载报告失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文