We'd like to create Unit-Test for our Reports (RDLCs), where we set an expected Length on the Test, then Print the report and compare the length of the rendered report with the expected length. For this, we use PDF (since XML etc. is not supported by RDLCs). Interesting enought, it seems like the Size is never exactly the same. We even created a small tolerance of 3 bytes, if we check it, but even then, it fails.
We added a step, where we save the PDF if the Test fails, and funny enought there is a point, where one Report has a Pagebreak and the other doesn't. The Test ran on the same Server, same Settings, same Data. If we compare the Files (via overlapping it), there is just this change.
We tried to pass the DeviceInfo, to assure this doesn't change via:
const string deviceInfo =
"<DeviceInfo>" +
" <DpiX>600</DpiX>" +
" <DpiY>600</DpiY>" +
" <HumanReadablePDF>True</HumanReadablePDF>" +
" <EmbedFonts>None</EmbedFonts>" +
" <StartPage>0</StartPage>" +
"</DeviceInfo>";
But this doesn't help as well. Has anyone an Idea, why a PDF can be printed differenly, if it uses the same stuff? Or is there anyhow a possibility to create a XML out of the RDLC?
Thanks in advance.
Matthias
Aucun commentaire:
Enregistrer un commentaire