on ‎2011 Dec 28 9:09 PM
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)
Request clarification before answering.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
-
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Don,
What happens if you export from the Viewer?
How do you have the fields defined in your report for the number format?
Don
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Exporting from the viewer direct works fine. I have formatted all numbers and currency fields not to show thousand separator, but til it didn't work.
So I used the totext(x,y,z) function to convert all numbers and currency to text and that worked. Still I would like to know how to do this without totext function.
I have Crystal reports 2008 with VS 2010
Hi Don,
Can you duplicate it if you use CR for VS 2010 or use VS 2008 with CR 2008 runtime? We don't support CR 2008 in VS 2010.
Go to this page to get the free CR for VS 2010 plug-in, it is full featured and gives you inProc RAS also...
http://www.sdn.sap.com/irj/boc/crystalreports-dotnet
Bottom of the page to get the installer and runtime.
Don
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.