report AX: foreground color

Get our Free Newletter

Don't you have the time to be online here at DUG every day? So how do you follow what is going on in the Dynamics industry and community?
If you subscribe to the DUG Newsletter then you can relax! We will make sure that you don't miss the big news!

Check out our
Newsletter Subscription Center
page a complete list of our different newsletters.

Solution (Verified) This post has 1 verified solution | 3 Replies | 1 Follower

15 Posts
315 Points
Joined: 2012-7-17
Last Online:
2013-3-11 10:24
Location: Italy
Ilenia posted on 2012-10-2 17:00

Hi,

I'd like to setup a foreground color in a report but I can't change the property.

Is it possible?

If I change the foregroundcolor in the design don't get any effect.

Then I try by code:

    for(i=1; i <this.design().sectionCount(); i++)  //
    {
        reportSection = this.design().sectionNumber(i);
        if (reportSection)
            this.design().section(i).foregroundColor(#Gray);

    }

but I get an initialization error at the section number 34.

Can somebody help me?

Thanks a lot!

Solution (Verified) Verified Solution

Male
32 Posts
795 Points
Joined: 2011-12-24
Last Online:
2013-5-23 18:34
Location: Phoenix, USA
Solution (Verified) Bob replied on 2012-10-2 19:59
Verified by Ilenia

I found this blog post on using colors in reports.  Hope it helps, it looks similar to what you are trying to accomplish.

http://dynamics-ax-live.blogspot.com/2009/12/use-colors-in-report.html

Bob

All Replies

Male
32 Posts
795 Points
Joined: 2011-12-24
Last Online:
2013-5-23 18:34
Location: Phoenix, USA
Solution (Verified) Bob replied on 2012-10-2 19:59
Verified by Ilenia

I found this blog post on using colors in reports.  Hope it helps, it looks similar to what you are trying to accomplish.

http://dynamics-ax-live.blogspot.com/2009/12/use-colors-in-report.html

Bob

15 Posts
315 Points
Joined: 2012-7-17
Last Online:
2013-3-11 10:24
Location: Italy
Ilenia replied on 2012-10-3 9:06

Thanks for your help!

I saw this blog post: it's very interesting and I use it for a section.

But I would like to color the entire report where I have many sections so I was looking for this problem.

Regards

15 Posts
315 Points
Joined: 2012-7-17
Last Online:
2013-3-11 10:24
Location: Italy
Ilenia replied on 2012-10-3 11:53

In the end I added a control about the fieldtype:

int     controlcount;
int     counter;
int     usecolor;
object  reportobject;
;

    controlcount=_ReportSection.controlCount();
    if (Custinvoicejour.CurrencyCode != 'PLN')
    {
        usecolor=WinApi::RGB2int(200,240,255);

        _ReportSection.foregroundColor(usecolor);

        for(counter=1;counter<=controlcount;counter++)
        {
            reportobject=_ReportSection.controlNo(counter);
            if (reportobject.controlType() != ReportFieldType::Box)
                reportobject.backgroundColor(usecolor);
        }
    }

And it's works fine.

Page 1 of 1 (4 items) | Get this RSS feed | Bookmark and Share