23 March 2012

Grouping data in SSRS

To group data on a report you need the grouping pane. If it is not visible click grouping on the view tab.
In the grouping pane right click a group an select add before or after to specify where to add the group. This group dialog opens:


Set the name of the group in this dialog. After that the group expression can be specified. Just add grouping criterias. It is possible to group by data fields or by expressions.
When closing the dialog a new grouping pane is added to the tablix data region. it contains a row or column where group values can be displayed.

22 March 2012

Fast way to refresh args caller datasource

Cause I always forget these two lines of code to research the datasource of the calling args record in Dynamics AX. I will post it here so that I can google it every time I need it ;)


FormDataSource   callerDataSource;
;


if (_args != null
    && _args.record() != null)
{
    callerDataSource = _args.record().dataSource();
    callerDataSource.research(true);
}

21 March 2012

Adding an AX table as Dataset to an SSRS Report

It is important to add the following code in the processReport Method of the DataProvider class in Dynamics AX to use a Table as a new Dataset in an SSRS Report:

newTableNameTmp.setConnection(this.parmUserConnection());

12 March 2012

HTML Tags that can be used in SSRS

To use HTML to format text in SSRS it is important to change the placeholder properties (right click on to the placeholder). In the placeholder properties change the markup type to HTML.


After that it is possible to format text with HTML Tags. The following list of HTML Tags shows possible Tags that can be used in an SSRS control:
  • Hyperlinks: <A href>
  • Fonts: <FONT>
  • Header, style and block elements: <H{n}>, <DIV>, <SPAN>,<P>, <DIV>, <LI>, <HN>
  • Text format: <B>, <I>, <U>, <S>
  • List handling: <OL>, <UL>, <LI>
For further information check out the following MSDN Page about Formatting Text and importing HTML.

03 February 2012

02 February 2012

Change SSRS Report to orientation to landscape

If you need to change the orientation of a report to landscape or to a different format like letter or DIN A4 there is a real easy way. But you'll have to know this way :)

Right click on the background beside the report and select report properties. (or in german: Berichtseigenschaften...)


Than the following form opens where it's possible to change the orientation, the size and so on...


26 January 2012

SSRS Insert new field error - field token is invalid


If you get this error message:

Field token Fields!MyNewField.Value is invalid. Could not find the identifier. \SSRS\Reports\Reports\

when you try to add a new field from AX to a SSRS Report.

The first thing to do is to refresh the datasets in VisualStudio.


After that you should check the Query property of the DS. If there is a fieldlist in the select statement. Just click into the property and open the "Select a Microsoft Dynamics AX Report Data Provider" Dialog. Select the required DataProvider Class and click Next. Than you'll get the possibility to select some or all fields from the tables that are provided by the DP class.