C#VS 2.0 CrystalReport Question

G

Guest

Hi

Must you always use a Literal path for the CR?
// Example
DataSet theReportDataset = DataCalls.GetReportDate(parameter);
Report1 = new ReportDocument();
string reportPath = Application.StartupPath + "\\" + "Reports.rpt";
Report1.Load("Reports.rpt");
Report1.SetDataSource(theReportDataset);
crystalReportViewer1.ReportSource = Reports;
crystalReportViewer1.Visible = true;
\\
Is there not a way to reference the report thats within your project without
a path call?
//
Dim crReportDocuments As New ConfirmPrintAll
DealstoPrint = WS_DataService.getDealPrintList(parameter)
crReportDocuments.SetDataSource(DealstoPrint)
CrystalReportViewer1.ReportSource = crReportDocuments
CrystalReportViewer1.Visible = True

Thanks
Brian
 
B

Bruce Wood

I'm not sure what your example is getting at, but there should be no
problem loading an .rpt file using a relative path (including just the
filename, if the .rpt is in the current directory).

Just be aware of where is the startup directory for your app. If you're
not able to load .rpt files by just mentioning their names, perhaps
your app isn't running in the startup directory you think it is.
 
G

Guest

Yes, the EXE is in either the Debug or Release Dir while the Rpt file wasjust
in the project dir.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top