Crystal Reports View in the Install Directory

jeva39

Well-known member
Joined
Jan 28, 2005
Messages
135
Location
Panama
Programming Experience
1-3
The scenario:

I Have 5 differents reports in my application. I create a Form and add a Report Viewer. The question is: what is the code for to permit each menu option can read the specific .RPT in the directory where the user install the application? For dabases I use Application.Startup but don't work in this case.

I.E:
Private Sub MenuItemXX_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItemXX.Click
CrystalReportViewer1.ReportSource = ??????? (What is the code here for view each report?)
End Sub

Thanks!!
 
VB.NET:
'Assuming the report's filenames will never change and they will always be in the same folder as the application
CrystalReportViewer1.ReportSource = Application.StartupPath & "\ReportXX.rpt"
 
You could use an openfiledialog with a *.rpt filter...
Or if you only want file in your app's dir you could use a directory.getfiles(application.startup, "*.rpt") and use this to fill a combo.
 
Back
Top