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)

How can I insert the text and page no# into excel "Header and Footer" area and set the margin in excel from X++?

(0) ShareShare
ReportReport
Posted on by

There are two(2) question in this discussion:

[1] How can I insert the text and page no# into excel "Header and Footer" area from X++?

[2] How can I set the margin from the X++?

[1] How can I insert the text and page no# into excel "Header and Footer" area from X++?

Could you please tell me how to insert the text and the page number into the Excel "Header and Footer"? I am writing a program to export the data into the excel worksheet. It also need to insert some text in the EXCEL Header area and insert the page number in the EXCEL Footer from X++.

[2] How can I set the margin from the X++?

The standard width of margin for the excel worksheet is not enough to show the data. After the margin has been set to Narrow, the width of the page can be shown the data in a line in the worksheet. 

Program Flow

The program flow which is the user choose the MO from the production master and click a button to export the carton list. After the list has been generated, the user only click the "Print" button to printout the excel file. Therefore, insert the text in the header area, page number in the footer area and custom the specific margin in left hand side and right hand side should be completed after the excel has been generated.

Please advise me the method to complete these tasks. Thank you very much.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    236,771 Most Valuable Professional on at
    RE: How can I insert the text and page no# into excel "Header and Footer" area and set the margin in excel from X++?

    I think you can do it via PageSetup. Unfortunately SysExcelWorksheet class in AX doesn't seem to expose PageSetup property, so you will have to add it by yourself.

  • Community Member Profile Picture
    on at
    RE: How can I insert the text and page no# into excel "Header and Footer" area and set the margin in excel from X++?

    Thank you, Martin Drab.

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
AlissonGodoy Profile Picture

AlissonGodoy 2

#2
Community Member Profile Picture

Community Member 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans