Print Page | Close Window

Export Crystal report in asp.net 2003

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Writing Code
Forum Discription: .NET 2003 programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=4523
Printed Date: 27 Apr 2024 at 7:10am


Topic: Export Crystal report in asp.net 2003
Posted By: yasinirshad
Subject: Export Crystal report in asp.net 2003
Date Posted: 13 Oct 2008 at 11:47pm

Hi,
I am exporting crystal report to excel file, I face the following problems.
1.Border of the cells are not visble in the excel sheet.
2.Some columns are getting overlapped.

please provide me the steps to solve this problem.

Below is the part of code am using:

Select Case ExportFormatType
                Case "MS Excel (XLS)"
                    oStream = DirectCast(crReportDocument.ExportToStream(CrystalDecisions.[Shared].ExportFormatType.Excel), MemoryStream)
                    Response.Clear()
                    Response.Buffer = True
                    Response.ContentType = "application/vnd.ms-excel"
                    Response.BinaryWrite(oStream.ToArray())
                    Response.End()
            End Select

Is there any service pack to fix this?
Thanks.



-------------
Thanks,
Yasin.



Replies:
Posted By: BrianBischof
Date Posted: 14 Oct 2008 at 10:02am

Getting Excel exports to work is tricky business. You have to play with the alignment of the rows and columns to get rid of the overlapping. Re the border missing, this is most likely a bug. You just have to do to their website to download the most recent service pack and see if that fixes it or not.



-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: GlennC
Date Posted: 24 Oct 2008 at 1:58pm
I agree with BrianB.  It can be tricky.  Even if you get it to work well once, it may not work exactly the same if run later with different data. 
 
The only time I've done this in a reliable manner is to export to a CSV file and have the user open a template Excel sheet and import the CSV file.
 
It's more steps than I would've liked, but it's the only way I'm guaranteed that the columns will line up and the formatting will be right.



Print Page | Close Window