The standard reports delivered with Dynamics AX have a plain design. This post looks at some tricks that can be used to get more impressive looking reports out of AX.
Font and color
Since Microsoft Word has a good font selection for headings it’s a good starting point. For headings use Cambria with bold and a dark blue color. For body text use Calibri. Also there should be a large whitespace before a heading and a little whitespace after it. In the below example I have used the same formatting for the fonts as the standard Microsoft Word theme.
It’s much better to view the data visually than to just be looking at numbers. The below graph is generated using the Chart Object ActiveX control. This is quite a powerful tool that can be used to create many different types of graphs. An example of the use of this control can be seen in the form "Tutorial_Form_Graph". When the report runs it loads this control in the background, generates the graph, then calls the Export() method on the graph control to generate a bitmap image. The report has a bitmap control on it linked to a display method that passes in the bitmap data.
Overlapping report sections
Not shown in the example below but a handy tool. The ax report designer uses sections to build the report. Examples of sections would be PageHeader, ColumnHeadings, Rows. Sections span the entire width of the page and are added from the top of the page to the bottom as the report is generated. The problem is that if you want a grid of some transactions on the left hand side of the page and a textbox next to it on the right hand side then you will find you can’t add the grid and text box to the same section. To get around this you can put textbox into a programmable section. In the exectueSection() method use the element.gotoYmm100() before calling super() to move the section position back up the page. The two sections will be drawn on top of each other. This doesn’t always display correctly in the preview but will print and export correctly.
Solid background and alternating colors for grids
There are a few limitations with the report designer that make this more difficult, the shape controls don’t have a 'fill' property and also setting the backStyle property of text controls to 'transparent' seems to have no effect. The below grid was achieved using a bitmap control with a solid color image, stretched out to the correct size underneath the text, then the backgroundColor property of the text controls is set to be the same color as the bitmap. For the alternating color rows a bit of code in the executeSection() method that shows/hides the bitmap and sets the background color before drawing the controls.
A final tip
Use the aot tree and properties window for adding and setting properties for report controls rather than using the visual designer. The visual designer can be buggy when dragging things around and it will be difficult to get things to line up using it.
Report with modified layout
Example of a standard AX report