档案位置 [英] File Location

查看:97
本文介绍了档案位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Helloe每个人,

我是.Net的新手,我用Crystalreport开发了一个Windows应用程序,我给出了crystalreport的路径作为本地驱动器,例如E:\\ MyProject \\ Reports \\ ReportName.Rpt
该应用程序运行正常,但是在客户端上却报错报告失败",因为客户端系统找不到正确的路径.所以我的问题是如何给crystalreport路径,以便客户端也可以访问该报表.谢谢

Helloe Every One,

i am very much new to .Net , i developed one windows application with Crystalreport, i gave the path of crystalreport as my local drive like E:\\MyProject\\Reports\\ReportName.Rpt
the application is working fine but it getting error on clinet side that ''report failed'', becoz the client system does not locate the correct path. so my question is how to give the crystalreport path so that client can also access the report.thanks

推荐答案

阿山,

使用Application.StartupPath + "\\" + "ReportName.Rpt".

问候.

Andy
Hi amshan,

Use Application.StartupPath + "\\" + "ReportName.Rpt".

Regards.

Andy


是的,出现此问题是因为您设置了定义的路径,并且当应用程序在客户端应用程序上运行时,它会移动到此定义的路径,该路径与您定义的路径不同. > 为了解决该问题,您应该将Crystalreport文件放置在应用程序bin\Debug内的ApplicationStarup路径中,并且必须将路径设置为
Yup, The problem is occur because you set a defined path and when application run on client application it move for this defined path which is not as same as you defined then.
To overcome the problem you should placed your Crystalreport file in your ApplicationStarup path which is inside bin\Debug of your application and have to set path as
Application.StartupPath +"\\"+"ReportName.Rpt"


这篇关于档案位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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