How to export crystal report to excel through progeam

Hi,
Can any help me how to export crystal report to excel through program(C#). I'm using VS2005.
Also, the report should be in a pivot table format after exporting to the excel..please help me how to do this
Thanks,
Venky

Hi Venkat,
The link below provides the code C# in an ASP.NET codebehind file
http://www.codeproject.com/KB/cs/Crystal_Report_Export.aspx
http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.2
Regards,
Abhijeet  T.

Similar Messages

  • Exporting Crystal report into Excel with code

    I have written the following code to export crysal reports to excel. My problem is, when it exports number it adds the thousand seperator (,), but if I export the report from Crystal designer, it works fine. So I believe I am missing something in my code. Could some one help me with this? Any help is greatly appreciated.
           Dim xlApp As Microsoft.Office.Interop.Excel.Application
            Dim xlBook As Workbook
            Dim myReport1 As New ReportDocument
            Dim reportPath1 As String = ""
            reportPath1 = "C:\test\su.rpt"
            myReport1 = New ReportDocument
            myReport1.Load(reportPath1)
            Dim tmpExcelFile As String = ""
            tmpExcelFile = "C:\test\test.xls"
            myReport1.ExportToDisk(ExportFormatType.Excel, tmpExcelFile)

    Hi Don,
    Please provide
    - Crystal Reprots version
    - Visual Studio version
    - Win or web app?
    Try using 'ExportToStream' see if it reproduces the issue.
    [1198587 - How to export a report to stream in C Sharp (C#) for Visual Studio .NET |http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333133393338333533383337%7D.do]
    - Bhushan.

  • How to Export SSRS report into Excel format using query string

    Hello all,
    I am new to SSRS world.
    Last night i was trying to add a hyperlink  on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
    Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)

    Hi Suman85,
    Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
    Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
    to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
     ="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
    Then preview the report ,you will see
    Click here and export the report to excel 
    when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled. 
    I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
    Regards,
    Challen Foo

  • Formating issue after export crystal report to excel format

    Hi Everyone,
    I have a crystal report devloped in crystal 8.5 and i am calling this report from my .net windows application.  I have a problem when i export the report in excel format. One of the column size(which is report footer) gets increased because of which my report is not properly formated. I have reoved all the blank lines and extra space but still i am not able to reduce the column size. Any help will be appriciated.
    Thanks in advance.

    Hi,
    Please let us know the Visual Studio Version that you are using, just to inform you, VS2005 is compatible with CRXIR2 and above and VS2008 is compatible with CR2008 + SP0.
    Do the report display properly from the designer? Does the Export from the designer in xls works fine?
    Thanks,
    AG.

  • Export crystal report to excel with subreport

    I have a report with two subreport, and the question is when I export the main report to excel ( data only ) there is no data in the excel file, but when I just export the subreport to excel ( data only ), the excel file shows all data correctly. Does anybody know a solution can resolve this problem? Thanks.

    1. Add one more Report Footer by right clicking on the Report Footer and selecting insert section below
    2. Put Subreport 1 in the Report Footer a i.e. RFa
    3.Put Subreport 2 in the Report Footer b i.e. RFb
    4.Export the report to Excel Data Only.
    5. You should be able to see the data for both the subreports

  • Exporting Crystal Report To Excel

    Hello,
    I have created a report in crystal for my company. It sorts by rep name, then customer, then products they purchased. When I export to excel, it comes over fine, but the customer name, address, etc. is in the same column as quantity, price, etc.
    I want to be able to sort this date in excel by customer, or product, etc. but cant since some of the data from the crystal report takes up the same columns as other data within excel, also the formating,"******: and other stuff that sperates the data in crystal report to make it easier to read when printed comes over to.
    How can I export this report without all the formating, page formats, etc. not coming over to excel and be able to have each unique field within its own column so i can sort easily in excel.
    thanks
    don

    Hi,
    Place the fields next to each other in report design. Set appropriate width. While exporting in Export window select following format from dropdown
    Microsoft Excel 97-2000 Data only (XLS)
    click OK
    then in Excel Format Options window select
    Excel Format 'Custom: Data is exported according to selected options' radio button. There are three radio buttons.
    In Column Width select 2nd radio button
    Column width based on objects in the : Details (there is dropdown for this)
    And at the end there 8 check boxes. Out of 8 you have to select 4
    check - Export object formatting
    check - Maintain relative object position
    check - Simplify page headers
    check - show group outlines
    Hope this helps.

  • Export Crystal Report to Excel with Grids

    Can anyone tell me how or if it's possible to include the grid lines when exporting from Crystal Reports (version 10) to Excel?   I am exporting as "data only" because I need to include field properties (color, bold, etc.).  Because of this, I don't see a "Show Gridlines" option on the export.   On the Crystal report, I have selected both single line and double line borders for each field on the report, but it's not transferring over to Excel.
    Thanks for any help you can provide.

    I did adjust the col. widths, but on larger col. headings, the text was chopped off.   I could get around this by making the field wider on the Crystal report.  With having so many cols., this was an issue.   And if the detail wasn't the same width as it's corresponding header, the report was not pretty.  
    This report was an evolution with me trying different things to get everything to fit in the designer until I finally discovered the Image Writer.   By exporting as Data Only, it doesn't matter how wide the heading/field is in the designer because the entire text exports.   Then I just select the entire worksheet and adjust the col. alignment so that everything shows.   I had to play around with things to get my colors and fonts to export - but the grids were the only remaining piece to the puzzle.  
    As it turns out, the users are happy with the end result without the grids.   They can add them manually if they so choose.
    Thanks

  • Error while exporting crystal report to excel format or word format

    i am using vs 2010 and sap crystal report(version 13.0.0.99) for vs 2010. when i export report to excel(97-2003 format) from crystalreportviewer, i am getting error that application has stopped working.  I also have ms-office 2007 install on my pc.
    when i see eventlog of system i notice following error:
    Faulting application name: NBFCForms.exe, version: 1.0.0.0, time stamp: 0x4e170b01
    Faulting module name: crxf_xls.dll, version: 13.0.0.99, time stamp: 0x4cc412ac
    Exception code: 0xc0000409
    Fault offset: 0x0009742e
    Faulting process id: 0xc60
    Faulting application start time: 0x01cc3e1e5657a4a4
    Faulting application path: C:\Users\Harshada\Desktop\NBFCDeploy\NBFCForms.exe
    Faulting module path: C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86\crxf_xls.dll
    Report Id: f0bae850-aa11-11e0-a98e-0019d144259b

    Thanks Roberto and Kalpana.
    This link solved the problem:
    http://social.msdn.microsoft.com/Forums/en-US/bcf792f4-4da3-4dac-b689-60168e695683/error-internet-explorer-cannot-download-edreportviewerwebcontrolaxd-from-site?forum=vsreportcontrols

  • Exporting Crystal report to excel 2007 with an image

    Hi - I hope this is the correct forum for this question.
    We are using the Crystal report viewer and everything works just fine . When I go to export to excel (using office 2007) the images are not exporting, do you know if this is an excel 2007 problem or a Crystal issue?
    Thanks in advance
    DanPlo

    Hi;
    I still recommend installing the Service Pack. If the issue persists, and is contained to the version 8.5 reports, then yet, they will likely need to be converted to version 11.0 to work correctly. The Crystal Reports engine was completely re-written in version 9.0, so moving from 8.5 can cause some issues.
    If you try exporting one of the 8.5 reports from the verison 11.0 Designer, do you have the issue?
    Regards,
    Jonathan

  • Problem with Exporting crystal report to Excel

    Hi !
    I am new to crystal world. I have an application which has csp code. From the csp code (internal website) we invoke crystal using viewer.cwr to view or export reports. Last week we upgraded from Crystal 10 to Crystal Reports XI Release 2. Due to this upgrade we did some modification to the Viewer.cwr url ( Changed to Viewer.asp too). Now the View option is working fine but when the report is exported to an Excel the columns are squeezed up.
    Here is the code for the viewer.asp :
    ExcelWindow = window.open("http://servername/crystalreportviewers115/viewrpt.asp?id=" + id + "&apstoken=" + escape(token) + <%Response.Write("'"&sReportLogin&"'")%>'&promptex-REPORTDATE='pRptDate'&promptex-State='pState'&promptex-usertype='pUserType'&promptex-startreport='pStartpSelect'&cmd=export&export_fmt=U2FXLS:3&',"ExcelWindow", windowprops);                                                         
    Is there any way to solve this formatting issue ? I tried changing the export format option as "export_fmt=U2FXLS:4" but this pulled up the data with the report header and sub heading in one row. Please help. 
    Nandita

    Hi Kedalene,
    Please check below links.
    Microsoft Visual C++ Runtime Library:
    VC++ runtime error
    C++ Runtime Error when installing addons | SCN
    Hope this help
    Regards::::
    Atul Chakraborty

  • How to export crystal report into disk using simple java

    hello
    i m working in the reporting part my j2ee application
    my requirement is that export this rpt file into pdf file and store into disk by writing simple java program
    if any have code this then plz provide me
    thanks & regards
    ram

    Uhm, these messages are not that related. One's a
    JNDI problem, this one's just some vague "how do I
    do" stuff.He wants to produce something in crystal reports and turn it into a PDF. So yes they are related. And yet another thread for this just sprung up.

  • Cannot export crystal report in excel format from crystal report viewer

    This problem occurs on only one workstation.
    Open Advanced Reports > Enter workorder # > Click on 'workorder work(uninvoiced)' > Work order opens.
    Click on icon "Export report"
    Save as type: change to .xls
    Error: Crystal Report Windows Forms Viewer. Error in file
    SAP.......rpt:
    Error detected by export DLL:
    Export failed.

    Try adding c:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86 to your windows enviroment variable PATH then restart.

  • How to export the report to Excel in Essbase

    I have to export a report in exce from Web Analysis.
    I am selecting the option Send to Excel given in services but when I am clicking to Export Pop up appears with message "Could not Export to File"
    Thanks

    Hi Ojha,
    You wish to export to an excel page from a web analysis report.
    When you select "send to excel" as one of the options of the "services", a lable named "send to excel " appears on your report(you can give a desired name of this label/buttion) , then come out of the "designer" mode and click on the buttion "send to excel"( or the buttion which you had just made by providing a name).
    If you are doing this ,then a new excel should open .
    Hope you dont have any problem with your microsoft excel too .It might not be the reason, but re check that too.
    Sandeep Reddy Enti
    HCC
    http://analytiks.blogspot.com

  • Exporting Crystal Report to Excel Data Only Fails On Demand in Infoview

    I am having the following problem with only 1 report in Business Objects.  The report runs fine in Infoview, but the Excel export fails after around 5 minutes.  It exports fine when scheduled.  The reports is over 3,000 pages of data and comes in at around 45MB.  It will export up to 2500 pages fine on demand.  But this whole report used to run and export on demand perfectly.  Perhaps only a few hundred records were added recently but that is all.  I don't know of any other changes to the system.
    The error says:  CrystalReportViewer
                                   handleCrystalEvent failed
                            Unable to retrieve Object
                            The Page Server you are trying to connect to is not accessible.  Please contact your system administrator
    Again, this is the only report this happens on.  I've searched everywhere on the Internet without a solution.
    Page Server settings:  60 and 120 minutes  Unlimited records
    Cache Server settings:  1000000 Kbytes;  80 minutes;  it sees the page server in Metrics
    If any more settings would help to diagnose the problem, please let me know.  Thanks for the help.

    How many number of rows are there in the report?
    -Rahul

  • Export the Report in Excel format

    Hi,
    How to export the Report in Excel format directly from the SAP to my Desktop.
    Plz. give me the process???
    Thanks

    use this,
    INCLUDE OLE2INCL.
    INCLUDE EXCEL__C.
    AND
             H_EXCEL TYPE OLE2_OBJECT,        " Excel object
              H_MAPL  TYPE OLE2_OBJECT,         " list of workbooks
              H_MAP   TYPE OLE2_OBJECT,          " workbook
              H_ZL    TYPE OLE2_OBJECT,           " cell
              H_F     TYPE OLE2_OBJECT,            " font
              H       TYPE I.
    AND
      PERFORM SUB_GET_DATA.
         'get data here
      PERFORM SUB_POP_DATA.
         'populate data here
    AND
      PERFORM SUB_DISP_EXCEL.
    *&      Form  SUB_DISP_EXCEL
    FORM SUB_DISP_EXCEL.
       START EXCEL
      CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
    SET PROPERTY OF H_EXCEL  'Visible' = 1.    " for printing o/p line by line in excel sheet
    get list of workbooks, initially empty
      CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
    add a new workbook
      CALL METHOD OF H_MAPL 'Add' = H_MAP.
    output column headings to active Excel sheet
      PERFORM FILL_CELL USING 1  1 1   10  'Mat Doc Number'(001) 'R'.
      PERFORM FILL_CELL USING 1  2 1    4  'Item'(002) 'R'.
      PERFORM FILL_CELL USING 1  3 1   10  'Mat Doc Date'(003) 'R'.
      PERFORM FILL_CELL USING 1  4 1   10  'Vendor'(004) 'R'.
      PERFORM FILL_CELL USING 1  5 1   20  'Mat Doc Item amount'(005) 'R'.
      PERFORM FILL_CELL USING 1  6 1   15  'Material price'(006) 'R'.
      PERFORM FILL_CELL USING 1  7 1    4  'Currency'(007) 'R'.
      PERFORM FILL_CELL USING 1  8 1   18  'Material'(008) 'R'.
      PERFORM FILL_CELL USING 1  9 1   30  'Material Desc'(009) 'R'.
      PERFORM FILL_CELL USING 1 10 1   19  'Qty in Unit of Entry'(010) 'R'.
      PERFORM FILL_CELL USING 1 11 1   19  'Qty Received'(011) 'R'.
      PERFORM FILL_CELL USING 1 12 1    4  'Unit of Entry'(012) 'R'.
      PERFORM FILL_CELL USING 1 13 1   20  'Mat Group'(013) 'R'.
      PERFORM FILL_CELL USING 1 14 1   16  'Vendor Invoice'(016) 'C'.
      LOOP AT T_OUT INTO W_OUT.
    copy flights to active EXCEL sheet
        H = SY-TABIX + 1.
        PERFORM FILL_CELL USING H  1 0 10 W_OUT-MBLNR 'R'.
        PERFORM FILL_CELL USING H  2 0  4 W_OUT-ZEILE 'R'.
        PERFORM FILL_CELL USING H  3 0 10 W_OUT-BLDAT 'R'.
        PERFORM FILL_CELL USING H  4 0 10 W_OUT-LIFNR 'R'.
        PERFORM FILL_CELL USING H  5 0 20 W_OUT-DMBTR 'R'.
        PERFORM FILL_CELL USING H  6 0 15 W_OUT-NETPR 'R'.
        PERFORM FILL_CELL USING H  7 0  4 W_OUT-WAERS1 'R'.
        PERFORM FILL_CELL USING H  8 0 18 W_OUT-MATNR 'R'.
        PERFORM FILL_CELL USING H  9 0 30 W_OUT-MAKTX 'R'.
        PERFORM FILL_CELL USING H 10 0 19 W_OUT-ERFMG 'R'.
        PERFORM FILL_CELL USING H 11 0 19 W_OUT-WEMNG 'R'.
        PERFORM FILL_CELL USING H 12 0  4 W_OUT-ERFME 'R'.
        PERFORM FILL_CELL USING H 13 0 20 W_OUT-WGBEZ 'R'.
        PERFORM FILL_CELL USING H 14 0 16 W_OUT-XBLNR 'C'.
        CLEAR W_OUT.
      ENDLOOP.
    CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
      CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTIN    G #1 = 2.
      SET PROPERTY OF H_EXCEL  'Visible' = 1.
      PERFORM ERR_HDL USING 'Unable to create workbook'.
    add a new workbook
    CALL METHOD OF H_MAPL 'Add' = H_MAP  EXPORTING #1 = 2. "----------can remove-------THIS IS FOR STAY AT LIST
      PERFORM ERR_HDL USING 'Unable to create new workbook'..
      FREE OBJECT H_EXCEL.
      PERFORM ERR_HDL USING 'Unable to free workbook'.
    ENDFORM.                    " SUB_DISP_EXCEL
          FORM FILL_CELL                                                *
          sets cell at coordinates i,j to value val boldtype bold       *
    FORM FILL_CELL USING I J BOLD COL VAL I_HORIZON_ALIGN.
      CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
      PERFORM ERR_HDL USING 'set cell object error'.
      SET PROPERTY OF H_ZL 'Value' = VAL .
      PERFORM ERR_HDL USING 'set value  object error'.
      GET PROPERTY OF H_ZL 'Font' = H_F.
      PERFORM ERR_HDL USING 'set font  object error'.
      SET PROPERTY OF H_F 'Bold' = BOLD .
      PERFORM ERR_HDL USING 'set bold  object error'..
      SET PROPERTY OF H_ZL 'ColumnWidth' = COL.
      PERFORM ERR_HDL USING 'set columnwidth object error'.
      IF NOT I_HORIZON_ALIGN IS INITIAL.
      IF I_HORIZON_ALIGN = 'L'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLLEFT.
      ELSEIF I_HORIZON_ALIGN = 'R'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLRIGHT.
      ELSEIF I_HORIZON_ALIGN = 'C'.
      SET PROPERTY OF H_ZL 'HorizontalAlignment' = XLCENTER.
      ENDIF.
      ENDIF.
      PERFORM ERR_HDL USING 'set Alignment object error'.
    ENDFORM.                    "FILL_CELL
    *&      Form  ERR_HDL
          outputs OLE error if any                                       *
    -->  p1        text
    <--  p2        text
    FORM ERR_HDL USING VAL.
      IF SY-SUBRC <> 0.
        WRITE: / VAL.
        STOP.
      ENDIF.
    ENDFORM.                    " ERR_HDL

Maybe you are looking for

  • Help with multiple Mail accounts

    There are two user accounts on my computer. I am the administrator and recently set-up a .Mac email-only account for the secondary user. Now, in the Mail application, I am receiving the mail for both myself AND the secondary user in my box. How do I

  • I can no longer use PubMed from Firefox. It works in Safari. How can I fix this?

    This is a new problem as I have been able to use PubMed via Firefox in the past. I haven't noticed any trouble with other websites while in Firefox. I can search PubMed fine while in Safari but my EndNote doesn't interface with Safari for some reason

  • Fire Wire: MBP OS X.4.11 Can't see external devices HELP!

    My MBP will not "see" my new MB or my back-up drive-both connected via a firewire 400 (6 pin) cable. Both running Tiger X.4.11 I have used this cable to connect my MBP and a TiBook in the past as well as to back-up onto the LaCie e-drive. I have run

  • Message getting struck at Request Message mapping

    Hi All, In our interface we have Proxy to HTTP scenario.  When we trigger data from R/3 system the data is getting blocked at SAP XI system. In SXMB_MONI when we see the status of the message it doesnot show any error status flag comes with a grey do

  • Internal table to file - SE16N extract format

    Hello experts, I have a few records in my internal table and would like to throw these records into a file on my PC without displaying these records. The format of the output file should be identical to the format that we get from Export -> Localfile