C# 水晶报表问题!求大神指点!
现在做的项目
c/s结构,由于之前写的绝对路径,所以在测试的时候无法正确加载报表。
我把UI层的水晶报表的界面都放到水晶报表的CryStal文件夹下了,当前的窗体是和报表在同一文件夹下的
现在想请教大神
string P_str_creportPath = Application.StartupPath + "\\CryStal\\CrystalReport1.rpt";
reportDocument.Load(P_str_creportPath);
这句话有没有什么问题
还有,我的c# 也是才学,不是太懂,我的同事在调试的时候告诉我 Application.StartuoPath在打包后是获取不到的,这个说法对吗,又该怎么解决呢?
之前的写法是:
string P_str_creportPath = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0,
Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
P_str_creportPath += "\\CryStal\\" + P_str_creportName;
reportDocument.Load(P_str_creportPath);