Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

report heading needs to display in excel export report in ax 2012 r3

(0) ShareShare
ReportReport
Posted on by 18

hi all,

i have write code for excel export. it's working fine. i am using SysExcelApplication.

6052.sales.jpg

before printing the columns , i wants to display the report name same like in pic.

code example --

excelWorksheet.cells().item(m,1).value("@GDT458");  // 1st column of header

Kindly let me know how will acheive?

please give me more shed on this.

thanks!

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Sure, but in line 5 in your code you have this mistake and you must fix it. Seems that you made a mistake when trying to apply the example code shared to you earlier. Please try to check the suggested code one more time.

    The error message that you get is clear. Just pay attention to return value of the method that you use, and the type of the variable where you try to assign the return value.

  • @rp@n Profile Picture
    18 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Hi Nikoloas,

    actually,in 1ST column , i wants to display report heading and from column3 , i wants to display header parts to join tell

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    It's line 5 in your code. I'm sure that the value() method is not returning such value (most likely it's not returning any value) that you could assign to your "com" variable. What are you trying to do with this line of code?

  • @rp@n Profile Picture
    18 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

        excelWorksheet.cells().item(m,1).value("@GDT523");
        excelWorksheet.cells().item(m,1).font().bold(true);
        m = 3;
        
        com = excelWorksheet.cells().item(m,1).value("@GDT458");
        com.backGroundcolor(WINapi::RGB2int(220, 220, 220));

    i tried that, but it's throwing error

    Operand types are not compatible with the operator.

    please give me more shed on this.

  • udaY-ch Profile Picture
    4,643 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    hj

    Its seems, changing background color of cells are not that easy, Not sure, its possible or not. I'm trying and let you know if succeed. FYI - The above code for background color will not work.

    Uday

  • @rp@n Profile Picture
    18 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Ok

  • udaY-ch Profile Picture
    4,643 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Column header starts printing in row 3

  • @rp@n Profile Picture
    18 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Thanks Uday

    What is M3 here?

  • udaY-ch Profile Picture
    4,643 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Hi,

    Use this code to print the header,

    excelWorksheet.cells().item(m, 1).value("Name you want");

      excelWorksheet.cells().item(m, 1).font().bold(true);

    M= 3;

    Use this set the header background,

    com = excelWorksheet.rows().item(3).comObject();

    com.backGroundcolor(WINapi::RGB2int(220, 220, 220));

    Then header prints as your code

    Uday

  • @rp@n Profile Picture
    18 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Please reply me on this to print report name

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,145 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,896 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans