Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Exporting report to excel Post Reply Post New Topic
Author Message
anupmadathil
Newbie
Newbie


Joined: 11 Jul 2010
Location: India
Online Status: Offline
Posts: 6
Quote anupmadathil Replybullet Topic: Exporting report to excel
     Posted: 11 Jul 2010 at 7:00am
Hi,
 
I have one problem with exporting crystal  report 9 to excel.
 
in the group headers there come an extra free row all others working fine..
if any one knows this solution please help me...
 
 
 
AnupMadathil
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 11 Jul 2010 at 7:43am
there are two things that you can try (as far as i know):
option 1: make sure there is no space(s) in Group Header
 
option 2: when you export it to excel is there any options for 'Export object formatting'?   if yes then check it and see the result.
 
 
hope it help.
 
Emir W
IP IP Logged
anupmadathil
Newbie
Newbie


Joined: 11 Jul 2010
Location: India
Online Status: Offline
Posts: 6
Quote anupmadathil Replybullet Posted: 11 Jul 2010 at 6:21pm
Hi
 
Thanks for you reply. I double check for spaces but there is no extra spaces.Problem is there is one free row before group header and one free row after group header,any thing we need to care while creating reports for avoiding this..
 
i am using the code
 

Nameval = System.Configuration.ConfigurationManager.AppSettings

Dim myExportOptions As ExportOptions

Dim myDiskFileDestinationOptions As DiskFileDestinationOptions

Dim myExportFile As String

Dim FileName, ReportTemp As String

ReportTemp = Nameval("ReportTemp").ToString

FileName = Now.Hour & Now.Minute & Now.Second & Now.Millisecond

myExportFile = Trim(ReportTemp) & Trim(FileName) + ".xls"

myDiskFileDestinationOptions = New DiskFileDestinationOptions

myDiskFileDestinationOptions.DiskFileName = myExportFile

myExportOptions = Crd.ExportOptions

myExportOptions.DestinationOptions = myDiskFileDestinationOptions

myExportOptions.ExportDestinationType = ExportDestinationType.DiskFile

myExportOptions.ExportFormatType = ExportFormatType.Excel

Crd.Export()

Response.ClearContent()

Response.ClearHeaders()

Response.AddHeader("Content-Disposition", "inline;filename=" & FileName & ".xls")

Response.ContentType = "application/ms-excel"

Response.WriteFile(myExportFile)

Response.Flush()

Response.Close()

System.IO.File.Delete(myExportFile)

Crd.Close()

Crd.Dispose()

 
 
IP IP Logged
Emir_W
Senior Member
Senior Member
Avatar

Joined: 25 Apr 2010
Online Status: Offline
Posts: 228
Quote Emir_W Replybullet Posted: 11 Jul 2010 at 7:51pm
it suppose to be ok.
but, i have no experience for exporting a report in programming.
sorry can't help you further.
 
hope someone else can help you.
 
 
Emir W
IP IP Logged
anupmadathil
Newbie
Newbie


Joined: 11 Jul 2010
Location: India
Online Status: Offline
Posts: 6
Quote anupmadathil Replybullet Posted: 11 Jul 2010 at 8:40pm
Thanks Emir for your reply..
IP IP Logged
anupmadathil
Newbie
Newbie


Joined: 11 Jul 2010
Location: India
Online Status: Offline
Posts: 6
Quote anupmadathil Replybullet Posted: 12 Jul 2010 at 1:59am
if anyone know the solution please help me ...only b4 and after group header and group footers there is one extra row..
IP IP Logged
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