Click to See Complete Forum and Search --> : Export .rpt file in to excel sheet
jmendpara
March 8th, 2006, 10:33 AM
Hello friends:
I would like to export report file from crystal report to excel file so can anybody help me withthat , I am using crystal report version 8.5 and if possible I would like to give option when user click on link to view report he get that result directly in excel file so is it possible ??
Thanks
-Jayesh
jmendpara@gmail.com
noshi316
March 14th, 2006, 01:48 AM
well u dint mention which tool u r using
here i m putting the solution if u r using VB.Net for a web application
u can do minor changes by ur self too
public dim DisplayReportInExcel()
{
LoadReport()
Dim dfdoCustomers As New CrystalDecisions.Shared.DiskFileDestinationOptions
Dim szFileName As String = Server.MapPath("")
szFileName = szFileName + "\report.xls"
tempFileName = tempFileName + "xls"
contentType = "application/vnd.ms-excel"
rpt.ExportOptions.ExportFormatType = CrystalDecisions.Shared.ExportFormatType.Excel
dfdoCustomers.DiskFileName = szFileName
With rpt
.ExportOptions.ExportDestinationType = CrystalDecisions.Shared.ExportDestinationType.DiskFile
.ExportOptions.DestinationOptions = dfdoCustomers
.Export()
End With
Response.Buffer = True
Response.ContentType = contentType
Response.AppendHeader("content-disposition", "attachment; filename=" + tempFileName)
Response.WriteFile(szFileName)
Response.End()
}
In
LoadReport() you can set the dataset to the report as u per ur requirement....
tis707
March 14th, 2006, 05:56 AM
Hi
I need to do it in Crystal reports 8.5 i mean export the rpt into excel sheet
pls help me
jmendpara
March 14th, 2006, 11:29 AM
Thank you very much Noshi316 ,, It works for me ...
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.