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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save a Crystal Report with data from VB.Net?

Status
Not open for further replies.

EdEpis

Programmer
Apr 23, 2003
3
US
I have a simple VB.net application that uses the Crystal Viewer control to display a stand alone Crystal report created in Crystal version 8.0. The form with the viewer control has a refresh button that performs a RefreshReport method to refresh the report with fresh data. My question is, how do I save the report and the new data to the same file location, so that the next time a user views the report, they will see the data from the last refresh command? I've looked at all of the methods of the Crystal viewer and the report document, but I don't see a SAVE method. There is a SAVEAS method, but that method won't let you save to the same path and file. Any help would be appreciated!
 
An easy solution of course would be to simply export the report to Crystal Reports format. Exporting a report will include any data in the report. Just like Saving As... and I find it less troublesome.

If you want users to name it themselves, simply prompt the user.



Cheers,

SurfingGecko
 
SurfingGecko,
Thanks for the response, but what I want to do is to overlay the original report file with the new data. It seems to me that the Export method will give me the same response as the Saveas method. Saveas and probably Export will not let the application write over an existing file. Do you know if there is anything like a Save method that will allow me to write over the existing file with new report data? I haven't been able to find anything like that.
Thanks, Ed.
 
Ahh yes. At this point I do not think this is going to happen. I decided to dig through MSDN a bit and could not find anything about a .Save method being exposed. I suspect there is some security type related reason for this or some such thing.

Looks like all you have is the SaveAs or export. Perhaps someone more familiar with the .NET environment will jump in. I have not spent a lot of time in there.



Cheers,

SurfingGecko
 
Export to another filename (and with CR8, you can select CR7 as a format). Close the existing report and copy the new name onto the closed report.

You can't export a report to the rpt currently open.

Editor and Publisher of Crystal Clear
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top