11/15/2022 0 Comments Crystal report viewer chrome![]() The problem I have is that the block of Report Viewer, I mean, what is the repot container, not shown in the browser, open the window where is this embedded but not shown anything in the Report Viewer, what the report will look even less. Now, at the time of publishing (on another server) the first thing we did was install the same version of SAP, so that there are the necessary libraries etc. Making in Local report, it works correctly in browsers (Chrome, Firefox, IE) and the data in the correct exit. ![]() Is installed and implemented an SAP report for VS2012 Crystal Reports Developer. Response.Redirect("ViewPDF.I own a ASP.NET web project with framework 4.5. String exportPath = "D:\\Report_Payslip.pdf" //where file will be exported ![]() This is the updated code which you said me to put :) private void View_Click(object sender, EventArgs e) Now Im able to open the crystal report in pdf form on same tab (not in new tab).īut I am not getting the database data in the report. String exportPath = "D:\\Report_Payslip.pdf" //where file will be exported and ensure that the drive or folder shared or write permission String reportFilePath = Server.MapPath("Report_Payslip.rpt") ĬrReportDocument.SetDataSource(ds.Tables) Report_Payslip rp = new Report_Payslip() SqlDataAdapter da = new SqlDataAdapter(cmd) ĭa.Fill(ds, "Report_Payslip") // debug and check here data is comming from database or not Please debug it and ensure that the data is comming from database to dataset or not.Īnd correct the code private void View_Click(object sender, EventArgs e) hope this will be help full for you, reply Response.AddHeader("content-length", ()) Response.ContentType = "application/pdf" client = new () īyte buffer = client.DownloadData(Request.QueryString) after this code create a new page ViewPDF.aspx and open write the following code under Page_Load event Response.Redirect("ViewPDF.aspx?reportFile=" exportPath) Following code will display the pdf file in new page String exportPath = "d:\\data\\Report_Payslip.pdf" //where file will be exportedĬrReportDocument.ExportToDisk(ExportFormatType.PortableDocFormat, exportPath) ReportDocument crReportDocument = new ReportDocument() ĬrReportDocument.SetDataSource(ds.Tables) // you can set data source as your convinient String reportFilePath = Server.MapPath(" Report_Payslip.rpt") ![]() Write the following code after the line rp. I want to open this "Report_Payslip.rpt" file in new tab of browser in pdf form. Report_Payslip is my crystal report of ".rpt" format. Here in the code Report_Payslip rp = new Report_Payslip() PdfRtfWordFormatOptions CrFormatTypeOptions = new PdfRtfWordFormatOptions() ĬrDiskFileDestinationOptions.DiskFileName = "D:\\Report_Payslip.pdf" ĬrExportOptions.ExportDestinationType = ExportDestinationType.DiskFile ĬrExportOptions.ExportFormatType = ExportFormatType.PortableDocFormat ĬrExportOptions.DestinationOptions = CrDiskFileDestinationOptions ĬrExportOptions.FormatOptions = CrFormatTypeOptions String mfiletime = () ĭiskFileDestinationOptions CrDiskFileDestinationOptions = new DiskFileDestinationOptions() Report_Payslip rp = new Report_Payslip() SqlDataAdapter adt = new SqlDataAdapter(cmd) SqlCommand cmd = new SqlCommand(sql, conn) String sql = "SELECT * FROM employee_sal AS es,employee_info AS ei WHERE ei.employee_id = '" TextBox1.Text "' AND es.sal_month = '" TextBox2.Text "' AND es.sal_year = '" TextBox3.Text "'" Using (SqlConnection conn = new SqlConnection(GetConnectionString())) ![]() Report name and path would be "D:\\Report_Payslip.pdf"" private void View_Click(object sender, EventArgs e) This is my code to print my report in pdf form. Curretly I'm able to print the crystal report in pdf form. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |