How to export the crystal reports to Excel pdf etc...
I am trying to How to export the crystal reports to Excel pdf etc. I am not getting the solution it shows the invalid path but i am giving correct path.pls suggest me,How to solve the problem.
Thanks in Advance.
I am trying to How to export the crystal reports to Excel pdf etc. I am not getting the solution it shows the invalid path but i am giving correct path.pls suggest me,How to solve the problem.
And to export your crystal report data to PDF try the below function.
Sub printReport()
' FIRST ADD REFERENCES.
' CrystalDecisions.CrystalReports.Engine
' CrystalDecisions.ReportSource
Dim Report As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
Dim CrystalReportViewer As CrystalDecisions.Web.CrystalReportViewer = New CrystalDecisions.Web.CrystalReportViewer
CrystalReportViewer.BorderStyle = BorderStyle.Solid ' OPTIONAL
CrystalReportViewer.DisplayGroupTree = False ' OPTIONAL
CrystalReportViewer.Zoom(150) ' OPTIONAL
CrystalReportViewer.HasCrystalLogo = False
CrystalReportViewer.BestFitPage = False ' SET THIS FALSE, SO YOU CAN SET THE WIDTH AND HEIGHT.
CrystalReportViewer.Width = "1200" : CrystalReportViewer.Height = "800"
' NOW LOAD THE REPORT.
Report.Load(System.AppDomain.CurrentDomain.BaseDirectory() & "\reports\" & YourCrystalFileName & "")
' NOW EXPORT THE DATA TO A "PDF" FILE.
Dim sPath_N_File As String = ""
sPath_N_File = "FOLDER\TESTFILE.pdf"
Report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat)
Report.ExportToDisk(ExportFormatType.PortableDocFormat, Server.MapPath(sPath_N_File))
End Sub
Crystal report itsel can export to pdf and excel, but you have to install Office interop. Here I introduce you a data export component that can export data to PDF, excel, word, html, xml etc without using any third party library. http://www.e-iceblue.com/Introduce/data-export-for-net-intro.html.