Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with Saved Data and Data base access

Status
Not open for further replies.

zking11

IS-IT--Management
Jan 14, 2002
3
US
Hi All,

I hope someone can help me out with this. Through code I am loading an .rpt file and saving it with the "save data with report" option set to true. The next time I load this report, I don't want to round trip the database...but the report always asks me for the login info? Will a report always go to the DB if it is bound to a connection/stored procedure?

How do you save an .rpt file and load it again without going to the database?
 
Either the save isn't successfull, or you code is refreshing the report when opened. If you open the saved RPT from the CR Report designer does it preview? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I don't actually have access to the designer as I'm using the CR built into Visual Studios .NET. The application doesn't give you the option to preview. The code snippet in C# is below (4 lines). There isn't a whole lot of documentation on the subject either? Thanks for the reply and any light could shed~

Code:
ReportDocument objRpt = new ReportDocument();
objRpt.Load("C:\\Test.rpt", OpenReportMethod.OpenReportByDefault);
objRpt.ReportOptions.EnableSaveDataWithReport = true;
objRpt.SaveAs("C:\\Test.rpt",CrystalDecisions.Shared.ReportFileFormat.VSNetFileFormat);

 
I have not played with VS yet, but I thought it did come with a report designer. Since the object model is essentially the same as the RDC many commands use identical syntax.

I don't see you running the report to get records into memory before you save it with data. Have you tried exporting it to an RPT instead of saving it as an RPT? An export will have to run the report. I am not sure about a SaveAs. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top