web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Generating report PDF's: layout problems

(0) ShareShare
ReportReport
Posted on by 285

Hello,

I have some difference between a report printed from AX and the same one exported in PDF (generated from code)  and then printed: the report layout shows some differences positioning the controls in the page.

There is a way to fix this behavior?

Thanks in advance,

Giacomo

*This post is locked for comments

I have the same question (0)
  • venkatesh vadlamani Profile Picture
    3,180 on at
    RE: Generating report PDF's: layout problems

    positioning can be fixed using rectangles.But not sure of what is your requirement

  • Giacomo Tatti Profile Picture
    285 on at
    RE: Generating report PDF's: layout problems

    Thank you for your reply.

    The Rectangles is not what i need to my requirements.

    I think that the problem could be something about the driver of my physical printer versus pdf exporting file rules...

    For example, the report printed has 5 mm of margin. When I extract the same report in pdf format and then I print it, margin is about 10 mm. For this reason I'm trying to set runtime the page properties when I extract in pdf format, but I can't get it...

    G.

  • venkatesh vadlamani Profile Picture
    3,180 on at
    RE: Generating report PDF's: layout problems

    I have observed similar things for few format letter printers and Dot matrix printers. It was in hurry so dint get a chance to check the actual issue . Even though i Add some footer space, it actually takes a certain size of footer and then add the spacing i mentioned on top of it. The strange thing is that font looks much smaller than what i have set on the report . just to cross check i have printed the same report using controller class and set the print destinations twice to different printers and checked this . Found that InkJet printer and laser printer have two different reports, Not even one size matched.

  • Siva S Profile Picture
    180 on at
    RE: Generating report PDF's: layout problems

    The problem is a generic one for some of the SSRS reports in AX 2012.You will not get the same layout what you see in the screen as a print out or PDF.I have got similar kind of problem,when I print to PDF it gets printed in 2 or 3 pages and values being cut even though the report is fine with one page in the screen.After placing the controls within the width and height(not exceeding what it shows in the ruler of the design layout) of report size including margins then the problem has been fixed.

    Let me know this is helpful for you.

  • venkatesh vadlamani Profile Picture
    3,180 on at
    RE: Generating report PDF's: layout problems

    Hi sivananth,

    You are explaining about report page layout setting and report design sizes mismatch.

    (Please check on the tray i.e page size ,A4 and letter. All printable report layouts are Letter in Ax 2012.If you have A4 size printer then you will have additional length and less width in potrait )

    I think it is specific to printer settings along with what you have suggested . As mentioned earlier ,Using 2 different printers to print the same report in my case ,they behaved like 2 different reports for me.

    Font has been shrinked and additional footer spaces are added. Just by tracing them against bright light i was puzzled . I found that printer has paper with company logo and footer. it was set in printer settings to add a footer and header

  • Giacomo Tatti Profile Picture
    285 on at
    RE: Generating report PDF's: layout problems

    Hi,

    I'm sorry but I didn't mentioned that I'm working on AX2009.

    Anyway, I think that problem could be in the classes of file PDF creation.

    For example, I've found that the distances and controls are converted from what you specify in report properties with a method called "twips" in the PDFViewer class.

    This methods take a value expressed in "tenMicroMeterUnit" and with a conversion costant give the value that is used to create the report.

    Now, debugging my code report, for a value of 5mm (that means 500 tenMicrometer), twips return a value of circa 14.17 twips.

    Using a conversion calculator (www.unitconversion.org/.../millimeters-to-twips-conversion.html) I've found that 5mm are converted in circa 283.46 twips.

    Plus, I've found that 1cm is defined as circa 567twips.

    That mean that the conversion factor in twips method is uncorrect...or I'm loosing something in this

    Do you have any point of view about that?

    Thank you,

    Giacomo

  • Community Member Profile Picture
    on at
    RE: Generating report PDF's: layout problems

    Yes, there is a way, just set the margin of the page from Visual Studio then save it in the PDF format, it will solve your problem.

  • Giacomo Tatti Profile Picture
    285 on at
    RE: Generating report PDF's: layout problems

    Thanks for your reply, Gulshan but I think that your solution fix the problem on AX2012 but not in AX2009.

    Am I wrong?

    G.

  • Community Member Profile Picture
    on at
    RE: Generating report PDF's: layout problems

    Ciao Giacomo!

    Currently I ran into the same problem, being differences between onscreen layout and PDF layout. Fonts are looking slightly different with different margins between characters (same fonts on AOS and client used), different margins between invoice summary lines, etc. I was wondering the same about those twips conversions done in the PDFViewer class.

    Have you come to any conclusion on this topic?

    Regards, Chris

  • Giacomo Tatti Profile Picture
    285 on at
    RE: Generating report PDF's: layout problems

    Hi Chris,

    sorry but I haven't any improvement to the topic..

    Keep in touch!

    Giacomo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Community Member Profile Picture

Community Member 4

#2
Guy Terry Profile Picture

Guy Terry 2 Moderator

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans