Skip to content

Cannot access a closed Stream. Object name: 'MemoryStream'. #16

@Ketanchavdadev

Description

@Ketanchavdadev

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)
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions