cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Exporting Crystal report into Excel with code

former_member1012208
Participant
0 Likes
1,134

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)

View Entire Topic
former_member188030
Active Contributor
0 Likes

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.