Archive for the ‘SSRS’ Category

Custom Lookup for Dimensions in AX 2012 – for User Defined Dimensions

In this article, giving an example for defining the lookup for dimensions in simple way.

This example will cover only for user Defined dimensions.

For this

1)      Created a form and added two string controls.

2)      Named as

Control: Name: Dimensionlist, Auto declaration – Yes

Control: Name: DimValues

3)      Override the lookup method for Dimensionlist

public void lookup()


Query           query;

SysTableLookup  sysTableLookup;


sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), this);

sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));

query = new Query();


addRange(fieldNum(DimensionAttribute, Type)).





4)      Override the lookup method for DimValues

public void lookup()


DimensionAttribute                  dimensionAttribute;

DimensionAttributeDirCategory       dimAttributeDirCategory;

Query                               query = new Query();

SysTableLookup                      sysTableLookup;

dimensionAttribute = DimensionAttribute::findByName(Dimensionlist.text());


// Only user defined dimensions will have a financial tag category

if (dimensionAttribute.Type == DimensionAttributeType::CustomList)


select firstonly DirCategory from dimAttributeDirCategory where dimAttributeDirCategory.DimensionAttribute == dimensionAttribute.RecId;

sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);

// Add name field to be shown in the lookup form.

sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value));

sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));

query = new Query();


addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)).



// Perform the lookup.





Dim list

Dim Values

We can use the same concepts for Dimension controls on Ax 2012 SSRS reports dialog. To build the report dialog UI with dimension controls.


Categories: Dynamics Ax 2012, SSRS

Report Server WMI Provider Error

The following article will be useful for two issues..

Error – 1: Report Server WMI Provider Error

Error – 2: Windows Management Instrumentation service is not running.

In my situation, suddenly report server stopped responding, after system and services are re-started.

Failed in trying to connect to Reporting services configuration manager and Reporting Services from SQL Server,

Facing the following error…

Report Server WMI Error

While searching for this issue, did not get exact answer for the above issue.

Tried to repair the report services installation by using SQL Server installation setup file, then found the following reason, in installation check list Windows Management Instrumentation service is not running.

Checked for the same in windows services, service is running, and no issues, successfully re-started also.

Still the same error during installation check list…..

With this error again started searching, got the following link as a solution to my issue.


Categories: Dynamics Ax 2012, SSRS

Save The SRS Printer Settings in Table and Re-Use

In this article,

1)      We can store the printer settings of a report in the table, like in parameters table as a container type field. (Section –I)

2)      While printing the reports, we will read the settings from the parameter table and we will apply the same for report printing.  (Section – II)

static void myPrinterSettingsReport(Args _args)


SrsPrintDestinationSettings printSettings;

FormRun                     printSettingForm;

boolean                     ok = true;

Args                        args = new Args();

container                   myPrint;

SrsReportRun                        reportRun;

SRSPrintDestinationSettings srsPrintSettings;

//Section – I

//This we can implement on the parameters form by adding button and define this in click event

printSettings = new SrsPrintDestinationSettings();


//calling printersettings form;

printSettingForm = classfactory.formRunClass(args);



ok = printSettingForm.closedOk();

if (ok)


//Retrieving printer settings to a container and this container we can store in to a table

myPrint = printSettings.pack();


//Section –II

reportRun = new SRSReportRun();


// Set printersettings

srsPrintSettings = reportRun.printDestinationSettings();

// while generating the report we can read the printersettings from table (container field value) and pass to the following method.








Categories: Dynamics Ax 2012, SSRS