

ExportToDisk(ExportFormatType.PortableDocFormat,
#Open crystal report file online pdf#
FINALLY, CREATE THE PDF FILE USING EMPLOYEE DETAILS. Report.SetDataSource(objDataSet) // SET REPORT DATA SOURCE. Load(Server.MapPath("report\\") + rptFileName) ObjDataAdapter.Fill(objDataSet, sTableName) Private bool CreatePDF(string sQuery, string rptFileName, string sTableName) String sQuery = "SELECT *FROM dbo.Employee" ĬreatePDF(sQuery, "Employee.rpt", "Employee") Protected void btPDF_Click(object sender, EventArgs e) SqlConnection m圜onn = default(SqlConnection) Using CrystalDecisions.Shared // FOR ExportFormatType. Once you have created a project with the Crystal report, just write another function called CreatePDF(), which will create a PDF file using the data extracted from an SQL Server table. I am using the same procedure in this article too. This article is very important, as it will help you understand the basics of creating and embedding a Crystal Report in your Asp.Net project.
#Open crystal report file online how to#
I am assuming that you have read my previous article on How to create Crystal Report in Asp.Net?. Later, you can email or print the PDF file.

However, in this article, I’ll show the use of Crystal Report ExportToDisk() function, which will allow you to convert the report into a PDF file and save it in a folder.

We just need to dig it out.Ĭrystal Report’s ExportToStream() function can export a pre-designed report into various file formats and its ExportToDisk() function can export the entire formatted data into a file. Generating a PDF file or exporting data into a PDF file from a Crystal report is not a difficult task, since this feature is readily available in Asp.Net. Here in this article I am going to show you with an example on how to create a PDF file from a Crystal Report in Asp.Net. A Portable Document Format (PDF) file is useful for sharing data on the web and has many useful features that make it an ideal choice for making documents.
