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

I finally figured out how to export

Status
Not open for further replies.

ahi

Programmer
Aug 23, 2001
38
GB
I finally figured out how to export a report to a file!
Code:
Set EO = report.ExportOptions
EO.DestinationType = crEDTDiskFile
EO.FormatType = crEFTText
EO.DiskFileName = "C:\RPTS\TEST.TXT"
report.Export False

where 'EO' is an 'ExportOptions' object and 'report' is a report object which belong to the CPEAUT32.dll (Crystal report automation server) i.e the Crystal Report engine.
Well..
this tip may not be useful to many, but i hope someone looking for code will find it useful at least... like i needed this code.

 
I use this method to export a report to a shared drive. The funny thing is, I must be logged in to the web server/seagate server machine for it to work from client machines. If I log the current user off the web server/seagate server machine and try to run the report from the webpage it gives me an internal server error. If I log back into the web server/crystal report server machine, it works fine from the clients. So basically I have to keep a user logged in to the machine for any of my exported crystal reports to work within asp pages. Anyone have any ideas for this. It's probably pretty easy too :(
 
You could log on just before the user requests for the report by using the Application object. like this:

crysApplication.LogOnServer "p2sodbc.dll",,server,UID,PWD

look up all the parameters that are required to be passed to this method.
to get data from the database server you will need to log on.

hope this helps solve your problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top