加载报告失败错误 [英] Load report failed error

查看:72
本文介绍了加载报告失败错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中,我在对话框中收到错误加载报告失败。



  public   partial   class  dynamicreporttest:表格
{
public dynamicreporttest()
{
InitializeComponent();
string reportPath = Application.StartupPath + \\ + CrystalReport120514test.rpt;
crystalReportViewer1.ReportSource = reportPath;

}
private void dynamicreporttest_Load( object sender,EventArgs e)
{
this .crystalReportViewer1.RefreshReport();
}
}

解决方案

在下面试试



 ReportDocument reportDocument =  new  ReportDocument(); 
string filePath = Path.Combine(Application.StartupPath, CrystalReport120514test.rpt); reportDocument.Load(文件路径);
crystalReportViewer.ReportSource = reportDocument;


In the following code I get the error 'Load report failed' in a dialog box.

public partial class dynamicreporttest : Form
{
    public dynamicreporttest()
    {
        InitializeComponent();
        string reportPath = Application.StartupPath + "\\" + "CrystalReport120514test.rpt";
        crystalReportViewer1.ReportSource = reportPath;

    }
         private void dynamicreporttest_Load(object sender, EventArgs e)
         {
             this.crystalReportViewer1.RefreshReport();
         }
}

解决方案

try below

ReportDocument reportDocument = new ReportDocument();       
string filePath =Path.Combine(Application.StartupPath, "CrystalReport120514test.rpt");            reportDocument.Load(filePath);
crystalReportViewer.ReportSource = reportDocument; 


这篇关于加载报告失败错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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