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

VB6 Crystal Viewer changing datasources

Status
Not open for further replies.

MadCatmk2

Programmer
Oct 3, 2003
145
GB
Hi all

Hope this is the correct forum for this post, if not then apologies.

Vital Stats:

Crystal 9
Access Database
VB6

I have created a report that gives me data on the number of referrals to patients made within a given time frame. From the referrals it gives me the number of contacts made to those patients. This report is all working well. The problem i have is that there are 79 sites that this report needs to be created for. Each site has a seperate database (All of which have exactly the same format).

What i was hoping to do was to write an app that will let me open the report using the crystal viewer in VB for each of the databases and export the resultant report to an external file (probably word).

Can the datasource for the report be changed dynamically in code and also is it possible to export the returned report to an external file in code.

I would be greatful if some one could give me advice on these matter and also let me know if this is a viable method to use.

Thanks in advance
 
In CR 9, to change the location of an Access db at runtime, all you need to do is:
[tt]
rpt.Database.Tables(1).Location = "c:\xtreme.mdb"
[/tt]
Export the report as a Word document to disk like this:
[tt]
rpt.ExportOptions.DestinationType = crEDTDiskFile
rpt.ExportOptions.FormatType = crEFTWordForWindows
rpt.ExportOptions.DiskFileName = "c:\Export.doc"
rpt.Export (False)
[/tt]
-dave
 
Vidru

Thanks very much, i'll look into that, looks exactly what i'm after.

Your help is much appreciated.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top