Setting margins works with ExportToDisk, but not with ExportToStream... RRS feed

  • Question

  • I'm filling out a report with SetParameterValue, and not with database, and setting the margins with:

    After that when i call ExportToDisk to write as pdf, the margins that i setted are there, but when i use ExportToStream like that: 

    MemoryStream stream = (MemoryStream)credentialTemplate.ExportToStream(ExportFormatType.PortableDocFormat)
    And call stream.ToArray() as return in FileResult, the pdf that shows up on browser is without the margins that i setted. Does anyone have idea how can i return the pdf to the browser with correct margins without get file from disk, using only the stream?
    Wednesday, November 30, 2011 1:40 PM