Skip to main content

Posts

Showing posts with the label SSRS

Alternate way to print a report as a byte array via X++ in #MSDyn365FO

Earlier this month I posted on how to print a report as a byte array . I will do the same but using an alternative method. I will use the print archive instead. You need to create an extension class for the SRSPrintArchiveContract class to add a parm method for the RecId. [ExtensionOf(classStr(SRSPrintArchiveContract))] final class SRSPrintArchiveContract_NAVAX_Extension { public RefRecId navaxPrintJobHeaderRecId; public RefRecId parmNAVAXPrintJobHeaderRecId(RefRecId _navaxPrintJobHeaderRecId = navaxPrintJobHeaderRecId) { navaxPrintJobHeaderRecId = _navaxPrintJobHeaderRecId; return navaxPrintJobHeaderRecId; } public RecId savePrintArchiveDetails(container binData) { RecId recId = next savePrintArchiveDetails(binData); this.parmNAVAXPrintJobHeaderRecId(recId); return recId; } } This is the alternative method I wrote. public static str printSalesInvoiceBase64StrV2(SalesInvoiceId _salesInvoiceId) { ...

How to fit address fields correctly in a Windows Envelope

I am still a subscriber of some Dynamics NAV blogs. Sometimes you find some things that related to both products AX and NAV. Claus wrote a great piece on making address fields fit in a window envelope (for SSRS). http://mibuso.com/blogs/clausl/2013/08/24/how-to-fit-address-fields-correctly-in-a-windows-envelope/ It got me thinking that I saw something like this when I did a purchase order report. Here it is. Notice how there is a clear text box. The property is set to CanShrink=False. This is to lock the position of the address so it does not move up if a we have the company logo not visible.

SRS report does not reflect the new query changes – cache issue [AX 2012]

In some scenarios you may see that your query changes doe not reflect in the report. This is due to some caching that is done. The obvious thing is to delete the AUC files and clear out your data usage. But there is a new table that we need to be aware of in this scenario. Navigate to the AOT and delete the SRSReportQuery table. In table browser, you can only delete records that have the same user id (Note: you can only delete your records. You can not delete other users.). The reason you don’t have permission is because the delete method was overridden to restrict this. Below I wrote a job to delete them all with out hitting the delete trigger. Code: static void deleteSRSReportQuery( Args _args) { SRSReportQuery srsReportQuery;     ttsBegin; while select forUpdate srsReportQuery     {        srsReportQuery.doDelete();     }     ttsCommit; } See the troubl...

How to: Add a Drill Through Action on a Report [AX 2012]

MSDN does document how to add a drill through action on a report. http://msdn.microsoft.com/EN-US/library/cc582049.aspx However I feel it is quite invasive and it could be done a lot cleaner without touching too many standard objects. Open up the SRSDrillThroughCommon class. Change the method GetDrillThroughUrl from a protected method to a public method. Then from the business logic class write a drill through method like so.     [ DataMethod ( ) , PermissionSet ( SecurityAction. Assert , Name = "FullTrust" ) ]     public static string ToTermOfPayment ( string reportContext, string termOfPayment )     {         const string PaymTermMenuItem = "PaymTerm" ;         const string PaymentTable = "Payment" ;         const string PaymTermIdField = "PaymTermId" ;           return Drill...

SSRS built in methods [AX 2012]

This post is just as a reminder to the msdn links and for those that are not aware. There are a number of built in methods that can be used on SSRS reports. Such things as formatting numbers, getting current user etc. http://msdn.microsoft.com/en-us/library/ee874032.aspx http://msdn.microsoft.com/en-us/library/cc570403 These can be used in the expression in the design of the report. Here are some examples: =Microsoft.Dynamics.Framework.Reports.DataMethodUtility.GetFullCompanyNameForUser(Parameters!AX_CompanyName.Value, Parameters!AX_UserContext.Value)   =Microsoft.Dynamics.Framework.Reports.BuiltInMethods.ToDisplayStringAmount(Parameters!AX_RenderingCulture.Value, Sum(Fields!Balance02.Value), true)

Inventory dimension fields on reports [AX 2012 Feature pack]

Some minor changes in the feature pack with the way inventory dimension fields are handled in reports. They are now using a map (\Data Dictionary\Maps\InventDimFieldsMap).\ Lets look at an example. I decided to look at the InventTransferOrderOverview report. Notice how populating each InventDim field is now changed to use a map. The way you do the contract hasn’t changed. You use the InventDimViewContract to show the tick box parameters. If you open up the design it uses a column visibility to control if it should be shown. Lets look at the report now.

Compile AOT Visual Studio Project changes the Report [AX 2012]

This is something to be aware of. If you compile the AOT visual studio projects node (AOT > Visual Studio Projects > Dynamics AX Model Projects), it modifies the SSRS report in the current layer you are in. This doesn’t happen if you do a full AOT compile. I picked it up because I wanted to compile my Shared project which contained the visual studio project node in it. When you do an AOT compare nothing comes up but if you export it out to xpo. Then do a text compare, it looks like it has modified the DataSourceID element. I have raised this with Microsoft and they have come back with this is a design feature (it is working as expected). So, keep in mind next time when including reports in your visual studio project. If you are not going to modify a report. Then don’t include it as part of your visual studio project.

Modify Microsoft Dynamics AX 2012 SSRS configuration files using PowerShell

This post is to highlight a pet project I have been working on. Working for a partner I frequently do new environment installations. AX 2012 allows you install multiple SSRS environments on the one machine but it can be tedious with the SSRS configuration file changes. http://technet.microsoft.com/en-us/library/hh389762.aspx I have scripted the process and loaded on here  http://dax2012ssrs.codeplex.com . Updated 26 March 2012: Added permission issue http://blogs.msdn.com/b/axsupport/archive/2012/02/02/microsoft-dynamics-ax-2012-reporting-extensions-error-system-security-permissions-environmentpermission-while-running-report.aspx Updated 21 January 2013: Added changes to be compatible with R2 http://dynamicsnavax.blogspot.com/2013/01/modify-microsoft-dynamics-ax-2012-r2.html

AX2012 - Install multiple instances of Reporting Services (SSRS) on the same computer scripted with powershell

I have been working on a side project to script Install multiple instances of Reporting Services on the same computer (for use with Microsoft Dynamics AX) [AX 2012] Most of the steps are straight forward but the Modify Reporting Services configuration files [AX 2012] is a little tedious. I have scripted some of the steps. It is incomplete but I think it could be useful for our internal SSRS installs. I hope someone out there can contribute and we can share the load to complete it. 1) Modify the Report Manager Web.config file 2) Modify the report server RsReportServer.config file 3) Modify the report server RsSrvPolicy.config file 4) Modify the report server Web.config file If you get a message saying scripting is not allowed. Just start powershell - run as administrator. Then type the following Set-ExecutionPolicy Unrestricted Warning: This is in no way complete but a start. I will update when I have something. Updated 12 September 2012 Refer to...