471,306 Members | 850 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,306 software developers and data experts.

C#VS 2.0 CrystalReport Question

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
Feb 2 '06 #1
2 1200
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.

Feb 3 '06 #2
Yes, the EXE is in either the Debug or Release Dir while the Rpt file wasjust
in the project dir.
Thanks

"Bruce Wood" wrote:
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.

Feb 3 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by s-galit | last post: by
reply views Thread by s-galit | last post: by
reply views Thread by s-galit | last post: by
reply views Thread by Jason Huang | last post: by
1 post views Thread by Jason Huang | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.