reportviewercore icon indicating copy to clipboard operation
reportviewercore copied to clipboard

Different output format position on render to PDF and render to DOCX

Open agunghanifan opened this issue 3 years ago • 3 comments

Hello, I am using .NET 6, ReportViewerCore.NETCore version 15.1.16 and trying to make Docx format look like a Pdf format. What am I supposed to do?

this is an example I just try using report.Render("WORDOPENXML", null, out mimeType, out encoding, out fileNameExtension, out streamIds, out warnings); for docx format and create file with the byte array to Docx file with File.WriteAllBytes();. For pdf format, i am using report.Render("PDF", null, out mimeType, out encoding, out fileNameExtension, out streamIds, out warnings); and creating a file with the byte array to a Pdf file with File.WriteAllBytes(); too.

DOCX format image

PDF format image

You can see the different positioning in the picture above. Thanks in advance.

agunghanifan avatar Jun 20 '22 10:06 agunghanifan

Hi. I don't think it's directly related to .NET 6 or Core version of Report Viewer. What results do you get using original Microsoft's Report Viewer packages?

lkosson avatar Jun 20 '22 11:06 lkosson

Sorry for late response, thank you for your response. I can't using the original packages because I'm currently using .NET 6 and when I am force to use .net framework, some error appear and this is not the point of my problem, is there anything else I need to do? some settings or something in my code? Thanks in advance.

agunghanifan avatar Jun 27 '22 08:06 agunghanifan

Create a new .NET Framework project, add original RV references, plug in your report with some minimal dataset and see if the layout still changes between PDF and DOCX.

lkosson avatar Jun 27 '22 08:06 lkosson