Open Ketanchavdadev opened 1 year ago
Hi, We are getting above error when we do export ViewAsPdf. Below is the code snippets.
return new ViewAsPdf { Model = objReportProperty, CustomSwitches = customSwitch, FileName = reportName, PageOrientation = !string.IsNullOrEmpty(objReportProperty.ReportOptions.PageOrientation) && objReportProperty.ReportOptions.PageOrientation.ToLower() == MitoviaCamp.Utils.ConstantValues.PAGEORIENTATION_LAND ? Orientation.Landscape : Orientation.Portrait, PageSize = !string.IsNullOrEmpty(objReportProperty.ReportOptions.PageSize) && objReportProperty.ReportOptions.PageSize.ToLower() == MitoviaCamp.Utils.ConstantValues.PAGESIZE_A4 ? Size.A4 : Size.Letter, PageMargins = new Margins(ConstantValues.PAGEMARGIN_TOP, ConstantValues.PAGEMARGIN_RIGHT, ConstantValues.PAGEMARGIN_BOTTOM, ConstantValues.PAGEMARGIN_LEFT) };
"The Stream was already Closed when you tried to operate on it" error, so you need to look at the call stack when the exception occurs to make a determination.
Hi, We are getting above error when we do export ViewAsPdf. Below is the code snippets.
return new ViewAsPdf { Model = objReportProperty, CustomSwitches = customSwitch, FileName = reportName, PageOrientation = !string.IsNullOrEmpty(objReportProperty.ReportOptions.PageOrientation) && objReportProperty.ReportOptions.PageOrientation.ToLower() == MitoviaCamp.Utils.ConstantValues.PAGEORIENTATION_LAND ? Orientation.Landscape : Orientation.Portrait, PageSize = !string.IsNullOrEmpty(objReportProperty.ReportOptions.PageSize) && objReportProperty.ReportOptions.PageSize.ToLower() == MitoviaCamp.Utils.ConstantValues.PAGESIZE_A4 ? Size.A4 : Size.Letter, PageMargins = new Margins(ConstantValues.PAGEMARGIN_TOP, ConstantValues.PAGEMARGIN_RIGHT, ConstantValues.PAGEMARGIN_BOTTOM, ConstantValues.PAGEMARGIN_LEFT) };