Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Exporting Cystal Report to Excel

Exporting Cystal Report to Excel

Scheduled Pinned Locked Moved C#
10 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prajeesh 0
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • P prajeesh 0

      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

      J Offline
      J Offline
      jimish1
      wrote on last edited by
      #2

      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

      P 1 Reply Last reply
      0
      • J jimish1

        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

        P Offline
        P Offline
        prajeesh 0
        wrote on last edited by
        #3

        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.

        J 1 Reply Last reply
        0
        • P prajeesh 0

          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.

          J Offline
          J Offline
          jimish1
          wrote on last edited by
          #4

          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

          P 1 Reply Last reply
          0
          • J jimish1

            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

            P Offline
            P Offline
            prajeesh 0
            wrote on last edited by
            #5

            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.

            J 1 Reply Last reply
            0
            • P prajeesh 0

              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.

              J Offline
              J Offline
              jimish1
              wrote on last edited by
              #6

              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

              P 1 Reply Last reply
              0
              • J jimish1

                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

                P Offline
                P Offline
                prajeesh 0
                wrote on last edited by
                #7

                Thank for your quick response, But for me graph is coming properly in crystal report but it is not exported to Excel sheet.

                J 1 Reply Last reply
                0
                • P prajeesh 0

                  Thank for your quick response, But for me graph is coming properly in crystal report but it is not exported to Excel sheet.

                  J Offline
                  J Offline
                  jimish1
                  wrote on last edited by
                  #8

                  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

                  P 1 Reply Last reply
                  0
                  • J jimish1

                    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

                    P Offline
                    P Offline
                    prajeesh 0
                    wrote on last edited by
                    #9

                    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

                    J 1 Reply Last reply
                    0
                    • P prajeesh 0

                      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

                      J Offline
                      J Offline
                      jimish1
                      wrote on last edited by
                      #10

                      good to hear ..ur problem solved..do marks as answer..! :)

                      Jimish

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups