C# 水晶报表问题!求大神指点!

RegioL 2014-06-06 08:14:45
现在做的项目
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);
...全文
50 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧