Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

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

Posted on by 5,901

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
    nmaenpaa 101,156 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
    @rp@n 5,901 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
    nmaenpaa 101,156 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
    @rp@n 5,901 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
    udaY-ch 4,624 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
    @rp@n 5,901 on at
    RE: report heading needs to display in excel export report in ax 2012 r3

    Ok

  • udaY-ch Profile Picture
    udaY-ch 4,624 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
    @rp@n 5,901 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
    udaY-ch 4,624 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
    @rp@n 5,901 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans