HarikrishnanEB Ответов: 0

Получение ошибки при печати отчета RDLC в MVC после размещения его на сервере


В моем приложении я генерирую счет и печатаю его в формате PDF с помощью отчета RDLC. И показывает ошибку "Microsoft.Reporting.Веб-формы.LocalProcessingException: во время локальной обработки отчета произошла ошибка. --- и GT; Майкрософт.Отчетности.DefinitionInvalidException: определение отчета 'E:\NetDocs\digital_coirboard\FundAllocation\RDLC\GenerateBill.rdlc-это недопустимо. --- и GT; Майкрософт.ReportingServices.ReportProcessing.ReportProcessingException: в отчете Pr произошла непредвиденная ошибка"

Но он прекрасно работает на наших локальных серверах и localhost.

Что я уже пробовал:

IEnumerable<FundAllocationOffice.Models.ActionPlanVm> Expenditure = oHOA.GetExpenditure_Detatils();
                               IEnumerable<FundAllocationOffice.Models.HOA_BillDetailsModel> Bill = oHOA.GetHoABill_Details();
                               IEnumerable<FundAllocationOffice.Models.Exp_ScheduleModel> letchure = oHOA.Exp_Schedule_Details();
                               IEnumerable<FundAllocationOffice.Models.Exp_PayeeModel> PayeeDetails = oHOA.Exp_Payee_DetailsForReport();
                               IEnumerable<FundAllocationOffice.Models.Exp_Bill_Details> BillDetails = oHOA.Exp_Bill_DetailsForReport();
                               IEnumerable<FundAllocationOffice.Models.Exp_Bill_Details> EFileDetails = oHOA.Exp_Efile_Details();




                               LocalReport localReport = new LocalReport();
                               //localReport.SetBasePermissionsForSandboxAppDomain(new PermissionSet(PermissionState.Unrestricted));
                               localReport.ReportPath = Server.MapPath("~/RDLC/GenerateBill.rdlc");

                               ReportDataSource reportDataSource = new ReportDataSource("GetExpenditure", Expenditure);
                               localReport.DataSources.Add(reportDataSource);

                               ReportDataSource reportDataSource2 = new ReportDataSource("GetHoABill_Details", Bill);
                               localReport.DataSources.Add(reportDataSource2);

                               ReportDataSource reportDataSource3 = new ReportDataSource("Exp_Schedule_Details", letchure);
                               localReport.DataSources.Add(reportDataSource3);

                               ReportDataSource reportDataSource4 = new ReportDataSource("Exp_Payee_DetailsForReport", PayeeDetails);
                               localReport.DataSources.Add(reportDataSource4);

                               ReportDataSource reportDataSource5 = new ReportDataSource("Exp_Bill_Details_Report", BillDetails);
                               localReport.DataSources.Add(reportDataSource5);

                               ReportDataSource reportDataSource6 = new ReportDataSource("Exp_GenerateEoffice_PDF", EFileDetails);
                               localReport.DataSources.Add(reportDataSource6);




                               string reportType = "PDF";
                               string mimeType;
                               string encoding;
                               string fileNameExtension;

                               //////////////////
                               clsActivity.action = HttpUtility.HtmlEncode("GenerateBill_Report Event");
                               clsActivity.error_details = HttpUtility.HtmlEncode("22222");
                               clsActivity.page_Name = HttpUtility.HtmlEncode("Master/GenerateBill_Report");
                               insert_coir_error_log();
                               //////////////////

                               //The DeviceInfo settings should be changed based on the reportType
                               //http://msdn.microsoft.com/en-us/library/ms155397.aspx
                               string deviceinfo;
                               deviceinfo = "<DeviceInfo>" +
                                               "<OutputFormat>PDF</OutputFormat>" +
                                               "<PageWidth>11in</PageWidth>" +
                                               "<PageHeight>8.69in</PageHeight>" +
                                               "<MarginTop>0.5in</MarginTop>" +
                                               "<MarginLeft>0.2in</MarginLeft>" +
                                               "<MarginRight>0.2in</MarginRight>" +
                                               "<MarginBottom>0.5in</MarginBottom>" +
                                               "<Magnification>100%</Magnification>" +
                                               "</DeviceInfo>";

                               //////////////////
                               clsActivity.action = HttpUtility.HtmlEncode("GenerateBill_Report Event");
                               clsActivity.error_details = HttpUtility.HtmlEncode("33333");
                               clsActivity.page_Name = HttpUtility.HtmlEncode("Master/GenerateBill_Report");
                               insert_coir_error_log();
                               //////////////////

                               Warning[] warnings;
                               string[] streams;
                               byte[] renderedBytes;
                               string extension = string.Empty;

                               //////////////////
                               clsActivity.action = HttpUtility.HtmlEncode("GenerateBill_Report Event");
                               clsActivity.error_details = HttpUtility.HtmlEncode(deviceinfo);
                               clsActivity.page_Name = HttpUtility.HtmlEncode("Master/GenerateBill_Report");
                               insert_coir_error_log();
                               //////////////////

                               //Render the report
                               renderedBytes = localReport.Render(
                                   reportType,
                                   deviceinfo,
                                   out mimeType,
                                   out encoding,
                                   out fileNameExtension,
                                   out streams,
                                   out warnings);

                               //////////////////
                               clsActivity.action = HttpUtility.HtmlEncode("GenerateBill_Report Event");
                               clsActivity.error_details = HttpUtility.HtmlEncode("55555");
                               clsActivity.page_Name = HttpUtility.HtmlEncode("Master/GenerateBill_Report");
                               insert_coir_error_log();
                               //////////////////

                               Response.Buffer = true;
                               Response.Clear();
                               Response.ContentType = mimeType;
                               Response.AddHeader(
                               "content-disposition",
                               "attachment; filename= Bill" + oHOA.Expid + "." + fileNameExtension);
                               Response.OutputStream.Write(renderedBytes, 0, renderedBytes.Length); // create the file
                               Response.Flush(); // send it to the client to download
                               Response.End();
                               Session["Exp_ID"] = null;

                               //////////////////
                               clsActivity.action = HttpUtility.HtmlEncode("GenerateBill_Report Event");
                               clsActivity.error_details = HttpUtility.HtmlEncode("66666");
                               clsActivity.page_Name = HttpUtility.HtmlEncode("Master/GenerateBill_Report");
                               insert_coir_error_log();
                               //////////////////

                               return File(renderedBytes, mimeType);

AdamASPGeek

Кажется, вы используете crystal report? Это верно? Если да, то вам необходимо убедиться, что ваш текущий поставщик поддерживает crystal report. Если нет, ваше приложение не будет работать. Если вы используете crystal report, я рекомендую вам взглянуть на asphostportal.com план хостинга. Они его полностью поддерживают.

0 Ответов