Link to home
Create AccountLog in
Avatar of cybeh
cybeh

asked on

Directlly Export crystal report to an Excel file

Hi,

I am using VB and Crystal Report XI. May I know how can I export crystal report directly to excel once it's generated?

I know if I want it to be print, I can call this
CRViewer1.PrintReport

Is there anything that I can do to export to excel?

Please advice. Thanks.
Avatar of Spykair
Spykair
Flag of South Africa image

ASKER CERTIFIED SOLUTION
Avatar of dylanyee
dylanyee

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of cybeh
cybeh

ASKER

Really appreciate if someone can convert dylanyee code into VB. Thanks.
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of cybeh

ASKER

m_Report.ExportOptions.ExportFormatType = ExportFormatType.Excel

The of "ExportFormatType" of "ExportFormatType.Excel" gave error of variable not defined.
You may need to include additional dlls or VB may use different constants.  

If you delete Excel and the . then add the . do you get a list?

mlmcc
I think ExportFormatType is reference from CrystalDecision.shared dll, I can't figure it out now since I am away from my office currently.

dylan
Avatar of cybeh

ASKER

"If you delete Excel and the . then add the . do you get a list?"

NO
ExportFormatType is reference from CrystalDecisions.Shared.
CrystalDecisions.Shared.ExportFormatType
Could you try add a reference to CrystalDecisions.Shared.dll and add Import CrystalDecisions.Shared to your code?

dylan
Glad i could help

mlmcc