Friday, March 23, 2012

Export Crystal Report from VB

Mr. Babu,
After the crystal report is displayed in VB using Crystal report viewer, is there a way to export the report to Excel.
When is getlastpagenumber method used.
Regards,
SatishHi,

The folg. code may help you. This will export a report to excel file.

'For exporting to disk file
Report.ExportOptions.DestinationType = crEDTDiskFile
'To set the format to excel
Report.ExportOptions.FormatType = crEFTExcel80Tabular
'To set the constatant column width
Report.ExportOptions.ExcelUseConstantColumnWidth = True
Report.ExportOptions.ExcelConstantColumnWidth = 36
'To set the file name
Report.ExportOptions.DiskFileName = "C:\Cr_Reports\dummy.xls"
'For avoiding prompt window
Report.Export False

Sorry, I have no idea about getLastPageNumber. Somebody may help you.

Regards,
harmonycitra|||Using the Crystal Viewer, you should be able to set the 'EnableExportButton' to True and it will prompt you for all the things that Harmonycitra listed. Just keep in mind that you need to have the correct export dlls installed on the computer you're using in order for exporting to work properly.|||Originally posted by malleyo Just keep in mind that you need to have the correct export dlls installed on the computer you're using in order for exporting to work properly.

EXACTLY my problem in a thin-client environment, I've tried every fix mentioned on both Crystal's and Citrix's sites, no joy...

I've tried them in

C:\Winnt\Crystal
C:\Winnt\System32
C:\Program Files\Seagate Software\SI\X86 (The recommended solution from Crystal)

Still, when I click the export button, nothing happens...
:confused:|||How do you export a sub report (drill down verion) to excel. The code that you've provided prints only the main report, but I want to print the drill down version.|||hello everyone! i have a solution for the page count in vb.net!

but first, i have to say that registering process on this site almost made me change my mind on posting it...

yeah... here's the sollution

myreport.GetReport.PrintingStatus.NumberOfPages

you can use this instead of GetLastPageNumber

cheers|||Hai,
I am new to crystal report.
I am using Crystal Report XI.
Can you guide me how to create crystal report from vb 6.0 or vb.net 2005 ?
Ms access 2000 is my database.
Thanks in advance.sql

No comments:

Post a Comment