我得到crystalreport的路径错误 [英] I get path error for crystalreport

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

问题描述

在下面的代码中,我得到一个错误说明:'名称'Path'在

当前上下文中不存在'line-string filePath = Path.Combine(..





In the following code I get an error stating: 'The name 'Path' does not exist in the
current context' at line- string filePath=Path.Combine(..


public Form5()
       {
           InitializeComponent();
           ReportDocument reportDocument = new ReportDocument();
           string filePath = Path.Combine(Application.StartupPath, "CrystalReport11.rpt"); //report file name .rpt
           reportDocument.Load(filePath);
           crystalReportViewer1.ReportSource = reportDocument;
       }

       private void dynamicreporttest_Load(object sender, EventArgs e)
       {
           this.crystalReportViewer1.RefreshReport(); // report viewer file name is crystalReportViewer1
       }

推荐答案

嗨...

就像下面给出的那样!

Hi...
Just give like below!
string filePath = Path.Combine(Application.StartupPath, "/Project_name/Folder_name/CrystalReport11.rpt");



谢谢你。它的工作对我来说。


Thank u. Its work for me.


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

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