2016-10-19 11 views
0

は私のCrystalレポートをApplication.StartupPathとbinフォルダの外側に配置されている - 木のフォルダに:検索レポートファイルやbinフォルダ

MainFolder 
    - CrystalReport_here_which_is_Sales_report.rpt 
bin 'folder 
    - DebugFolder 
    - inside debug folder is the application startup 

私はこのコードを使用しますが、ファイルを見つけることができません - どうすれば解決できますか?

rpt.Load(Application.StartupPath & "\Sales_Report.rpt") 
+0

デバッグしながら実行する場合は、あなたのデバッグフォルダ内のレポートをポップ。 – Bugs

答えて

0

あなたは相対パス(vb.netのコード)を使用して問題を解決することができます:

Dim CRPath as String = System.IO.Path.GetDirectoryName(Application.StartupPath) & "\..\..\MainFolder\" 
rpt.Load(CRPath & "Sales_Report.rpt") 
関連する問題