Thursday, March 29, 2012

Export Different Reports

I created some Reports.
Now I want to export these reports,but i didn't know which report just i used.
Is there a way to know what kind of report now the CRView using?

I know how export like follows
Dim Report as New rptMy
Report.Export

but if is there "Dim Report as new rpt ",
then i can use "Report.Export" whether rpt is rptMy1 or rpt is rptMy2 ?

By the way , I didn't want to use the View Exportbutton .
I want to use menu to do this
Help^_^I ran across the same scenario. Here's what I did:

Dim Report As Object

Select Case ReportType
Case "ReportType1"
Set Report = New CrystalReport1
Case "ReportType2"
Set Report = New CrystalReport2
Case "ReportType3"
Set Report = New CrystalReport3
End Select

Report.Export

By dimming Report as an object, I was able to set it to whatever report I was currently using. Then I only had to call Export once instead of calling it for each report.|||I found a way

Dim Report As CRAXDRT.Report
Set Report = CRViewer91.ReportSource

'Then for every report
Report.Export

It worked^_^

No comments:

Post a Comment