Skip to main content

Posts

Showing posts with the label SSRS

AX 2012 : Generate customer account statement as PDF through X++

Customer account statement in AX 2012 R3 can be generated from Accounts Receivable > Reports > External > Customer account statement. However, if we need to generate this report through code - how can we achieve this? I created a new query in AOT with only dataSource 'CustTable', as I want to loop on selected customers only. I created a class extending from RunBase (did not want to touch existing report and class for customer account statement) being considering it a custom process of generating customer account statement using X++ code opposed to what exists in system. New query looks like this with three ranges, these ranges will show on dialog form Created a new class with following methods which are common for every dialog class; main construct new pack unpack dialog getFromDialog run showQueryValues queryRun I will explain important methods from the class which I think need discussion. QueryRun method - this method ...

Error when validate settings in Report servers by any admin account which is not account used to install the AX reporting services extensions.

First thing you need to verify the Service account and Execution Account are properly configured under Reporting Services Configuration Manager. After some troubleshooting, I found UAC was not turned off. I was running on MS Windows Server 2012. UAC has to be turned off via registry by changing the DWORD "EnableLUA" from 1 to 0 in "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system". You will get a notification that a reboot is required. After the reboot, UAC is disabled. After UAC is disabled, the issue is resolved. social.technet.microsoft.com/.../13953.windows-server-2012-deactivating-uac.aspx

Conditional IIF Sum in SSRS report at group level

I got a requirement where I want to show sum amount based on differnent conditions. Simple Sum of amount can be shown with following expression; =Sum(Fields!Amount.Value) I tried following expression to show conditional sum on a group level; It did not work :( =Sum(IIF(Fields!name.value = "Standard", Fields!Amount.value, 0)) I tried following expression after getting idea from this blog and it worked =Sum( VAL( IIF(Fields!name.value = "Standard", Fields!Amount.value, 0) ) )

Use ReportItems in SSRS report

Sommetime we require to use values from textboxes in SSRS for some calculations or data hiding and some other manipulations.  Textbox or any other object on report design is an item of the report and can be accessed through ReportItems!TextBox.value This can be used as on textbox expression  =ReportItems!Amount.Value - ReportItems!Amount1.Value

Show last day of the month from date in SSRS report

Following expression can be used to show last day of the monthin SSRS report. Format(DateSerial(Year(Parameters!Dataset1_AsPerDate.Value), Month(Parameters!Dataset1_AsPerDate.Value), "1" ).AddMonths(1).AddDays(-1), "dd/MM/yyyy" ) Input:   Parameters!Dataset1_AsPerDate.Value = "02/01/2015" Outout:  31/01/2015

Show AX full company in SSRS

Following expression can be used to show full AX company name from legal entities in SSRS report. =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.GetFullCompanyNameForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value)

Show Print Date & Time and Page Number in SSRS report - Custom formatted

Following expression can be used to show print date and time in SSRS report. =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser( Parameters!AX_CompanyName.Value,Parameters!AX_UserContext.Value, System.DateTime.UtcNow , "d", Parameters!AX_RenderingCulture.Value ) &  " at "  & Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "t", Parameters!AX_RenderingCulture.Value ) OutPut:           01/01/2015 at 8:14 AM Following expression can be used to show page number in SSRS report. =System.String.Format(Labels!@SYS182565, Globals!PageNumber & space(2) & Labels!@sys26401 & space(2) & Globals!TotalPages)                    OutPut:   Page 1 of 2

Format a date in SSRS report

After adding a Date parameter in contract class of SSRS report it starts showing in report's parameters node with Data type DateTime. There is no option to make it either short date or format a date at parameter level. You can use following expression in report design where this parameter has been used in design, mostly in textbox. =format(Parameters!Dataset1_AsPerDate.Value, "dd/MM/yyyy" ) Happy Daxur!ng

AOT and X++ queries and ranges in AX 2012

Let's say we have a query in AOT  \Queries\ProjTable And now we want to add more datasources into this query's parent datasource (ProjTable) and some ranges etc. Let's assume we have a class (SRS report data provider class or a dialog class) which is using above query and during processing in this class we want to add more datasources and so on. I created a SRS report data provider class for this example; Class declaration [     SRSReportQueryAttribute ( querystr (MarginAnalysisReportV2Sw)),     SRSReportParameterAttribute( classstr (MarginAnalysisReportContractV2Sw)) ] public class MarginAnalysisReportDPV2Sw extends SRSReportDataProviderBase {     Query                       query;     TempTable               tempTable;     RecordInsertList       recordInsertListTmpTable;    ...

"An item with the same key has already been added" in SSRS report

"An item with the same key has already been added" You may encounter this error while creating SSRS report and the reason behind this error is having fields with the same name in the query used in report. To deal with this issue, in AX go to the query used in report and identify the fields that are duplicated between the datasources in the query. Delete overlap field by setting the Dynamic property to NO at fields node of the datasource in query. Happy Daxure!ing

Unable to find appropriate service endpoint information in the configuration object Dynamics Ax 2012

"Unable to find appropriate service endpoint information in the configuration object Dynamics Ax 2012" There can be multiple reasons to see this error while working on SSRS report in AX 2012.  SSRS reports and AOS services communicate via WCF services and these WCF services are either not running on AOS or need to refresh under AX client configuration. First would be, BIServices is not activated under System Administration > Setup > Services and Application Integration Framework > Inbound ports. Second option to resolve this error is to refresh WCF configuration under Connection tab of Dynamics AX Client Configuration.  This configuration file contains WSDL Port which is used to talk BIServices as shown above. If BIServices are activated in first step then import your AX configuration file into AX Configuration Utility and press Refresh Configuration button. Happy Daxture!ng

The target prinipal name is incorrect - SSRS with AX

Following error made me worried when I was not able to run (existing or customized) SSRS reports from AX. Reports were working fine few days back and there wasn’t a single change done neither at report server nor with AOS service accounts. After digging into issue, came across the issue was services and services groups in AOT. My AOS was connected with TFS and when I got latest from TFS it affects SRSFramework and SSASFramework services and there was some sort of reference lost in service groups. Resolution: Generate FULL CIL Confirm the Business proxy account and AOS service account is same Register SRSFrameworkService and SSASFrwameworkService services from AOT Deploy BIServices and UserSessionServices groups from AOT Restart SQL reporting services

SSRS report expressions - compiled and ongoing

How to get full AX company in SSRS report =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.GetFullCompanyNameForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value) How to show alternate row colour in SSRS report Set following expression to row’s background property =IIf(RowNumber(Nothing) Mod 2 = 0, "LightGrey", "WhiteSmoke") How to format a date =format(Parameters!Dataset1_AsPerDate.Value, "dd/MM/yyyy" ) How to show date and time on report =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "d" , Parameters!AX_RenderingCulture.Value) & " at " & Microsoft.Dynamics.Framework.Reports.DataMethodUtility.ConvertUtcToAxUserTimeZoneForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value, System.DateTime.UtcNow, "t" , Paramete...

Debug/Test SSRS report in AX 2012

People came across issues like report is not showing data on report or data is not per their expectation. It is really hard to judge where it goes wrong and what needs to be correct in which class RDP, Contract, UI or Controller. Following sample job can be used to debug SSRS report processing data and lead to find what goes unexpected. For more information about classes and table used in this example please read my previous post static void FF_ReportDPTest(Args _args) {     // temp table declaration     FF_ReportTmpTable       ffReportTmp;     // RDP class binded with FF_Report     FF_ReportDP             dataProvider = new FF_ReportDP();     // Contract class for report parameters     FF_ReportContract       contract = new FF_ReportContract(); ...