Exporting Cystal Report to Excel
-
Hi How can i export a crystal Report containing Bar Charts to Excel and Pdf files. When i try to Export my Report with the following code All other things except Bar chart is geting exported. ReportDocument rptExcel=new ReportDocument(); String strExportFile= "D:\\CareMapRelease03-03-09\\WpfCareMap on iq42\\WpfApplication1\\bad.xls"; rptExcel.Load("D:\\CareMapRelease03-03-09\\WpfCareMap on iq42\\WpfApplication1\\CrystalReport1.rpt"); rptExcel.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; rptExcel.ExportOptions.ExportFormatType = ExportFormatType.Excel; DiskFileDestinationOptions objOptions=new DiskFileDestinationOptions(); objOptions.DiskFileName = strExportFile; rptExcel.ExportOptions.DestinationOptions = objOptions; rptExcel.Export(); Thanks & Regards Prajeesh
-
Hi How can i export a crystal Report containing Bar Charts to Excel and Pdf files. When i try to Export my Report with the following code All other things except Bar chart is geting exported. ReportDocument rptExcel=new ReportDocument(); String strExportFile= "D:\\CareMapRelease03-03-09\\WpfCareMap on iq42\\WpfApplication1\\bad.xls"; rptExcel.Load("D:\\CareMapRelease03-03-09\\WpfCareMap on iq42\\WpfApplication1\\CrystalReport1.rpt"); rptExcel.ExportOptions.ExportDestinationType = ExportDestinationType.DiskFile; rptExcel.ExportOptions.ExportFormatType = ExportFormatType.Excel; DiskFileDestinationOptions objOptions=new DiskFileDestinationOptions(); objOptions.DiskFileName = strExportFile; rptExcel.ExportOptions.DestinationOptions = objOptions; rptExcel.Export(); Thanks & Regards Prajeesh
-
In the Crystal Report Viewer you have an icon ,an option to export your file...once selected you get the Export As box..where in you can select the desired format and save it to the desired location..! Why do u want to code..use it..!!
Jimish
But i need to code it bcos, without opening the cystal report page i want it to be exported to Excel sheet..I have coded it but i am not getting the Charts to be exported to Excel.
-
But i need to code it bcos, without opening the cystal report page i want it to be exported to Excel sheet..I have coded it but i am not getting the Charts to be exported to Excel.
till what I found ... graphs take in the data that is loaded in a crystal report..! in other words graphs are drawn only after report is generated and filled with data...! So without loading the crystal report, it won't be possible to do..! [ The above reply is just based on some researches...though not sufficient...I am a noob...still in process of learning reporting .. :)]
Jimish
-
till what I found ... graphs take in the data that is loaded in a crystal report..! in other words graphs are drawn only after report is generated and filled with data...! So without loading the crystal report, it won't be possible to do..! [ The above reply is just based on some researches...though not sufficient...I am a noob...still in process of learning reporting .. :)]
Jimish
But i have tried it by putting a button in the same page and try to generate it after the graph is generated in the crystal Report. Only an area of lines are coming in place of Graphs.
-
But i have tried it by putting a button in the same page and try to generate it after the graph is generated in the crystal Report. Only an area of lines are coming in place of Graphs.
Chk this out...whenver you add database fields, there is another tab with it,if there are multiple tables...Crystal reports do auto linking...and here by default the linking is inner join...!! Sometimes this linking if not correct creates trouble..that is data is shown but graph does not generate..!generally go for a outer join or no links...whatever suitable to ur tables...! Do let me knw if ur problem is solved..!
Jimish
-
Chk this out...whenver you add database fields, there is another tab with it,if there are multiple tables...Crystal reports do auto linking...and here by default the linking is inner join...!! Sometimes this linking if not correct creates trouble..that is data is shown but graph does not generate..!generally go for a outer join or no links...whatever suitable to ur tables...! Do let me knw if ur problem is solved..!
Jimish
Thank for your quick response, But for me graph is coming properly in crystal report but it is not exported to Excel sheet.
-
Thank for your quick response, But for me graph is coming properly in crystal report but it is not exported to Excel sheet.
Hey.. I dont knw wht code are you writing on the button click in report.. but for me..the graph once generated..I use the crystal report viewer's export button/image...when i click I get variety of options in which this graph can be saved...when i select Excel...it properly saves the graph in excel..! I think there must be some event which is triggered when I click the export button of viewer..if u want to code the process under a button click..u will have to trigger this event in ur button click..! We have some function like ExportReport() in Crystal Report Viewer..!
Jimish
-
Hey.. I dont knw wht code are you writing on the button click in report.. but for me..the graph once generated..I use the crystal report viewer's export button/image...when i click I get variety of options in which this graph can be saved...when i select Excel...it properly saves the graph in excel..! I think there must be some event which is triggered when I click the export button of viewer..if u want to code the process under a button click..u will have to trigger this event in ur button click..! We have some function like ExportReport() in Crystal Report Viewer..!
Jimish
Yes this is what exactly i was looking for, this works fine thank you very much for your quick response. So far i have used the report document objects Export methode, may be because of that it didnt work.
modified on Wednesday, April 15, 2009 1:31 AM
-
Yes this is what exactly i was looking for, this works fine thank you very much for your quick response. So far i have used the report document objects Export methode, may be because of that it didnt work.
modified on Wednesday, April 15, 2009 1:31 AM