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!!
 

JuggaloBrotha

VB.NET Forum Moderator
Staff member
Joined
Jun 3, 2004
Messages
4,524
Location
Lansing, MI; USA
Programming Experience
10+
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"
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
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.
 
Top Bottom