Saturday, 30 November 2013

An error has occurred during report processing.(rsProcessingAborted) in SSRS ax 2012

Dynamics ax 2012 SSRS report rendering problem, it is asking for userId and password, every time when it is launch.

During the SSRS report deployment, i run the report to test it, but is asking me for the userId and password. I think this is happend to me because i restore database from other machine, but i am not sure about the reason. After google on internet i got some help. I am publishing here what help i got.
Below is the screenshot of error i got while publishing the ssrs report.

How i have Solved this ?

The problem here is in a malconfigured SSRS server.
Open this config file rsreportserver.config usually located here:
C:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportServer\rsreportserver.config
With in the config file, locate the <Authentication> tag, and make sure the only active tag in there is <RSWindowsNTLM />, ie:
 <Authentication>
  <AuthenticationTypes>
   <RSWindowsNTLM />
<!–
 comment out, or delete other tags, and keep <RSWindowsNTLM />
   <RSWindowsNegotiate/>
   <RSWindowsKerberos />
–>
  </AuthenticationTypes>
After you save the file you have to restart the Reporting server service. You can do this from Report server configuration. After that we have to redeployed the report by deleting the previous one available.

Displaying SSRS report in Ax-EP page

Some of my blog readers and my friends are asking me how we will show the SSRS report in EP.
I want to share the same through my blog for all.
In my previous example we had seen how to create a sample report in SSRS, for this article I will use the same report.
Assume that report is ready and free from Errors.
1)      In the solution explorer right click on the project and select the option of Save to AOD. 
2)      Come to Ax Client and open AOTàReport LibrariesàSantoshPracticeReportsright click on our report library and select the option of Deploy. The report will be deployed to the report server.
3)      Create a new Menu Output Item in Ax client for this new SSRS report and name it as follows and set the properties also.
AOTàMenu ItemsàOutputàSampleCustomers
Note: In EP, SSRS report will be identified by using the Label property of the Menu Output Item.
4)      In Ax-EP-SharePoint site create a new page and add the web part related to Dynamics Ax SSRS report as shown in following figure.

5)      On the newly added web part select the option of Modify Shared Web Part and assign our Ax Menu Output Item to this web part as shown in below figure. Click oOK

6)      We have done with the attaching the SSRS report to the EP pages of Ax.

7)      For the same page we can create new web menu URL item.

8)      This URL menu item can be placed in Quick launch or in Web Menus accordingly.

Custom Lookup for Dimensions in AX 2012 SSRS – 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;
super();
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), this);
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));
query = new Query();
query.addDataSource(tableNum(DimensionAttribute)).
addRange(fieldNum(DimensionAttribute, Type)).
value(queryValue(DimensionAttributeType::CustomList));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
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());
super();
// 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();
query.addDataSource(tableNum(DimensionFinancialTag)).
addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)).
value(queryValue(dimAttributeDirCategory.DirCategory));
sysTableLookup.parmQuery(query);
// Perform the lookup.
sysTableLookup.performFormLookup();
}
}
Run:
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.

Ax 2012 Reports (SSRS) Print Utilities

This article gives the examples, to print the reports of Dynamics Ax 2012 (SSRS Reports), in different ways.
1)Sending the Ax report through mail.
2)Save the report as file in local computer. (example covered to save the report as .pdf file)
Mail the report
static void myJobPrintReportMail(Args _args)
{
SrsReportRun                        reportRun;
Query                               query;
SRSReportPrintDestinationSettings   SRSReportPrintDestinationSettings;
SRSPrintDestinationSettings         srsPrintSettings;
;
delete_from SRSReportPrintDestinationSettings;
reportRun = new SRSReportRun();
reportRun.reportName(“Vend.Report”);  //<ReportName>.<DesignName>
// Set printersettings
srsPrintSettings = reportRun.printDestinationSettings();
srsPrintSettings.printMediumType(SRSPrintMediumType::Email);
srsPrintSettings.emailTo(“mail@gmail.com”);
srsPrintSettings.emailAttachmentFileFormat(SRSReportFileFormat::PDF);
srsPrintSettings.emailSubject(strfmt(‘vendor report – %1′, systemdateget()));
srsPrintSettings.pack();
reportRun.showDialog(false);
reportRun.init();
reportRun.run();
}
Save the Report To PDF File
static void myJobPrintReportPDF(Args _args)
{
SrsReportRun                        reportRun;
SRSPrintDestinationSettings         srsPrintSettings;
SRSReportPrintDestinationSettings   SRSReportPrintDestinationSettings;
;
delete_from SRSReportPrintDestinationSettings;
reportRun = new SRSReportRun();
reportRun.reportName(“Vend.Report”);  //<ReportName>.<DesignName>
// Set printersettings
srsPrintSettings = reportRun.printDestinationSettings();
srsPrintSettings.overwriteFile(true);
srsPrintSettings.printMediumType(SRSPrintMediumType::File);
srsPrintSettings.fileFormat(SRSReportFileFormat::PDF);
srsPrintSettings.fileName(“D:\\Vendors.pdf”);
srsPrintSettings.pack();
reportRun.showDialog(false);
//reportRun.saveParameters();                         //For Report parameters
reportRun.init();
reportRun.run();
}
In case of Parameterized reports
If the report has parameters (Using Contract Class),
Use the following line, to read the parameters and save to the table called,SRSReportParameters
reportRun.saveParameters();
For the same parameters, provide the required values to run the report.
I have tried the example of Vendor Transactions report, with my customized version. This standard report has 4 parameters, have used same parameters and provided the values inSRSReportParameters table to run the report.
For clear idea, have a quick look in to the following picture.

Displaying the Standard Ax report in EP pages of AX

If we have scenario like, client not ready to adapt the SSRS, and he wants the report in EP pages of Dynamics Ax 2009. Eventually we need to use standard Ax reports for generating the reports.
Can we show the standard Ax reports in EP pages?
Yes, we can utilize the same standard Ax reports and can be displayed in the EP pages.
The following example will illustrate the same.
 Displaying the Standard Ax Customers report in EP pages.
 Create the following Class and add to the Proxies node.
 class PSReportRunFromEP
{
    Args                 reportArgs;
    ReportName           reportName;
    ReportRun            reportRun;
    Report               report;
    PrintJobSettings     printJobSettings;
    Query                query;
    CustAccount          custAccount;
}

void initValue()
{
    ;
    reportName = "Cust";
    reportArgs = new Args(reportName);
    reportArgs.name(reportName);
}

void reportRun()
{
    ;
    reportRun = new ReportRun(reportArgs);

    // Set printersettings
    printJobSettings = reportRun.printJobSettings();
    printJobSettings.setTarget(PrintMedium::File);
    printJobSettings.format(PrintFormat::PDF);
    printJobSettings.fileName("D:\Customers.pdf");
    printJobSettings.suppressScalingMessage(true);
   
    reportRun.report().interactive(false);
If we want add any filters to the query like passing customer account number, then we will use the following statement.
    //reportRun.query(query); 
    reportRun.query().interactive(false);
    reportRun.init();
    reportRun.run();
}
public static void reportToPDFFile()
{
    PSReportRunFromEP reportRunFromEP = new PSReportRunFromEP();
    ;
    reportRunFromEP.initValue();
    reportRunFromEP.reportRun();
}

static void main(Args args)
{
    ;
    PSReportRunFromEP::reportToPDFFile();
}

We can test the same, by executing the above class. PDF file will be generated with the customer details.

Development for EP:

Add the above class to the Proxies under  AOT àWebàWeb FilesàStatic FilesàProxies

/class:PSReportRunFromEP
    /method:PSReportRunFromEP.reportToPDFFile

 Create the new web part and add the following code to the web part:

using Microsoft.Dynamics.Framework.BusinessConnector.Session;
using System.IO;
using ApplicationProxy = Microsoft.Dynamics.Portal.Application.Proxy;
using Proxy = Microsoft.Dynamics.Framework.BusinessConnector.Proxy;

protected void Page_Load(object sender, EventArgs e)
    {
        FileInfo fi = null;

//calling the proxy method for generating the report into PDF file and the same report we are displaying in EP       
Microsoft.Dynamics.Portal.Application.Proxy.PSReportRunFromEP.reportToPDFFile(this.AxSession.AxaptaAdapter);
        fi = new FileInfo("D:\Customers.pdf");

        if (fi.Exists)
        {
            Response.Clear();
            Response.ContentType = "application/pdf";
            Response.Flush();
            Response.WriteFile(fi.FullName);
            Response.End();
           
        }
       
    }

Add this web part to the new page, import the URL definition in to the Ax AOT, and add this URL to web menus of Sales module.


This way, we can show the standard Ax reports in EP pages. Gift with a bow

SSRS Report Debug in AX2012

Recently I posted a question on "how to debug a Report Data Provider" in AX 2012: https://community.dynamics.com/product/ax/f/33/p/59930/110686.aspx#110686. This was back when we used Contoso Demo System.
A few months later, now on our own AX 2012 live system, i phased  the same issue but in a different situation. AX 2012 is running on a distributed environment with separated RDS, AOS and SQL Servers.
Unfortunately i was not able to get the Debugger hit the breakpoint, even doing everything on the AOS Server itself. Debugging Report Data Provider is different in the way that it is called via Service from SSRS.
With the support from Microsoft i actually found out that there is a much easier way to test if your Data Provider is working: Just create a test job for your Data Provider:
static void Job3(Args _args){
TmpABC tempTable;
InventABCDP dataProvider = new InventABCDP();
InventABCContract contract = new InventABCContract();
contract.parmABCModel(ABCModel::Link);
contract.parmCategoryA(10);
contract.parmCategoryC(20);
contract.parmCategoryB(70);
contract.parmInterest(2.5);

dataProvider.parmDataContract(contract);
dataProvider.processReport();
tempTable = dataProvider.getTmpABC();

while
 select tempTable
{
info(tempTable.ItemName);
}
}

AX 2012 - AX-SSRS Report Design Concepts





Recently I have been focusing on the BI and reporting aspects that come as part ofMicrosoft Dynamics AX 2012. There is a lot of great resources for this topic, and it's a topic that drives a lot of value, when speaking about AX 2012. 

Since this is the case, I wanted to continue my focus on reporting, with this blog post, focused on the two categories, if you will, of types of AX-SSRS reports. These are Model Driven Solutionsand Code Driven Solutions


Model Driven Solution Diagram


First up, lets talk about the model driven solution, in terms of AX-SSRS reports. When speaking about the model driven approach to AX-SSRS report development, the focus is around the use of Query objects, from the AOT, to model your report with. The idea, with such reports, in that very little X++ code is needed to enable them. 

This path, should be favored as much as possible, as it's the least amount of TCO in terms of report development. With this approach, and with report design in general, we have the report itself, and surrounding it is the design, data and control aspects of the report. 

When talking in terms of the model driven approach, the design, as you can see from above is created within Visual Studio 2010. Further, the data aspect, is represented via a Query object, and a good example of the control for such a designed report is ranges. 

Keep in mind, when thinking about such design patterns, that the Query object is meant to be a re-usable API in AX 2012. The same query object that powers a AX-SSRS report design, could also enable a PowerPivot report, or could be used to help define and deliver Contextual BI elements, say for an InfoPart. 

Moveing forward with this thought process, lets look to the next category, for AX-SSRS report design. This is the Code Driven Solution.


Code Driven Solution Diagram


With this concept, we have our basic design elements, or constructs for reference. It's the design, data and control points. Looking at the above diagram and comparing the code driven solution vs. the model driven, we see that at the heart of the design, is still Visual Studio 2010. 

Beyond that though, these are much different than the Model driven solution, and the use of queries. The idea for this concept, is when code is needed to create the data behind a report. When this is the case, the data, for the above is represented by RDP, or Report Data Provider. This is a new class type for AX 2012, that enables the ability to design more complex reports, when the need to "mash" data from different sources arises. 

Moving along with this concept, we also see that for the control, we have a Data Contract. This too is new to AX 2012, and we have seen some of these, in my coverage of services in AX 2012..

The data contract, when used in a design pattern that is laid out in the above, is meant to act as a simple class, that ties extended data types, that represent the data contract properties, to the report design itself. Enabling, therefore, the correct formatting of data, based on underlying table and data type designs. 

With these two concepts in mind, we can start to move forward with report design. A big focus, and understanding point needs to be seen here. That is, you don't see the mention of BIDS, or Business Intelligence Development Studio. That is the standard SSRS design piece. The reason this is the case, is that VS2010 and a special project type are used to enable the creation of AX-SSRS reports. BIDS is actually hosted within VS2010, at least the design space is, so once in the VS2010 project, it's very familiar process for those use to using BIDS. However BIDS, and standard SSRS reports are not meant to be used in delivery data, with AX 2012. 

To help you further, with learning these concepts, there are a couple of resources I would like to point you to. First, the Microsoft Dynamics AX BI team blog: Dynamics BI Team Blog. This is a resource I have highlighted before, and one I want to make sure everyone is aware of and makes use of. 

Also, the same team, behind that blog, creates YouTube videos, at the following YouTube channel: Dynamics AX BI YouTube Channel. Here again, we have another great resource, in which the main topics of this post are discussed more fully, and taking to a deeper level. Some really great video's out there, so I highly recommend reviewing them, as you can. 

Finally, Microsoft recently published the Whats New: Reporting for Developers in AX 2012. This is a really great resource, espically for those that have done AX-SSRS report development in AX 2009. All the concepts contained within that page, need to be fully understood, so that you can take full advantage of all the great improvements Microsoft has given us with this release, around report development. 

Well that's all for this post, check back soon though as there is a whole lot more to come.