Writing Code
 Crystal Reports Forum : Crystal Reports .NET 2003 : Writing Code
Message Icon Topic: Export Crystal report in asp.net 2003 Post Reply Post New Topic
Author Message
yasinirshad
Newbie
Newbie
Avatar

Joined: 24 Sep 2007
Location: Saudi Arabia
Online Status: Offline
Posts: 39
Quote yasinirshad Replybullet Topic: Export Crystal report in asp.net 2003
    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.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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>
IP IP Logged
GlennC
Newbie
Newbie
Avatar

Joined: 24 Oct 2008
Location: United States
Online Status: Offline
Posts: 5
Quote GlennC Replybullet 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.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.