Saturday, 6 December 2014

Common Issues while installing SSRS reporting extensions in AX 2012

Errors in AX 2012 while installing SSRS reporting extension

Setup cannot connect to the Application Object Server Instance (AOS) by using Business Connector.

·        Check whether service is up
·        Traverse to client configuration. Select Business connector. Cross check whether AOS detail is same as the service which you are using.
·        If not create new Business proxy configuration; You can edit it too.
·        IISReset , Service restart: Not Mandatory.

The AOS ‘MicrosoftDynamicsAX@ @’ cannot be reached. Setup cannot continue. Verify that you entered the correct server information and that the AOS service is running.

·        Check whether service is up
·        Traverse to client configuration. Select Business connector. Cross check whether AOS detail is same as the service which you are using.
·        If not create new Business proxy configuration; You can edit it too.
·        IISReset , Service restart: Not Mandatory.
·        Check if wizard works fine.
·        If not,Delete all records from sysserversession table except the one in use.
·        Check if wizard works fine.

Unable to find appropriate service endpoint information in the configuration object

·        Check in Sys Administration -> Inbound ports -> Bi Services that whether service is active
·        If not, Full CIL needs to be generated. If you are out of time
·        Go to services node in AOT and Right click SRSFrameworkService ->Add ons and click register service.
·        In the form select SRSFrameworkservice and click refresh.
·        If it did not work ; proceed with full CIL.
·        Refresh WCF config in client config.
·        Check if wizard works fine.
·        If not, Delete WCFConfig from regedit in following path
HKEY_CURRENT_USER\Software\Microsoft\Dynamics\6.0\Configuration\Orig

The operation failed with error code 1055.

·        Check if service is up. Or restart the service
·        If not, Restart server

Reporting Services Extension was not configured. An unknown issue occurred. Please contact your administrator.

·        Check if reporting extension has any active configuration.
·        If yes delete report configuration in AX.
·        Delete report and temp report database and create new data base through reporting configuration tool. Either SQL Server 2008 or 2012.
·        Before everything check event viewer.

The report server cannot open a connection to the report server database. A connection to the database is required for all requests and processing.

·        Restart SSRS Service
·        Check whether user or admin has access to reporting service instance in SQL.
·        In SQL Server report configuration check test connection for data base
·        Still if you face the same issue delete report and temp report database and create new data base through reporting configuration tool. Either SQL Server 2008 or 2012.
·        Restarting service is suggested.

If you are stuck up in Business connector page during AX setup

 If you are stuck up in Business Connector page where Domain and User name is not editable, try this
·        Check System Service Account of AX ->System Administration module and update.
·        Check if problem is fixed.
·        Update business connector proxy from Client Configuration as explai8ned in top of this post.


Last Note
Majority of the errors should get cleared with one or the other steps mentioned above. Of course there is a chance of Touch luck J

Thursday, 16 October 2014

Creating AX 2012 Report through Wizard

Creating Report through Wizard
·         Open AX and press Ctrl+D
·         In Development Workspace, Click Tool->Wizard ->Report Wizard






·         In Report Wizard check the box to include system table and click next.


·         In the wizard page enter the title for report and click next.

·         Select the tables which you need in report to be shown up. The related table window will ease out the burden to search tables.
·        


·         Click Next


·         Select the fields that needs to be displayed in report.


·         Specify sorting order with selection.

·         Specify the range you need to query


·         Select the layout of report


·         Click Finish
·         Traverse to AOT->Reports->Admin_report

·         Right Click the report and click open query dialog will appear as shown below.Click next after filling the filter value(optional)

·         Click OK.

·         X++ Report will appear on screen.



Saturday, 27 September 2014

CSV supported AX SSRS reports

CSV supported AX SSRS reports
It’s a common ask that user wants to export csv file from the report generated. The immediate feedback would be extra columns or columns which shows something like textbox1 or textbox2…

It’s better to develop CSV supported report at start itself to avoid the modification later.

What does CSV prints?

All fields in your rdl which has Data Element Output as Auto or Output


The column will have values of the field where as column header will have value of “DataElementName” or “Name” property of the textbox field.

How does CSV Work?
CSV just prints the value of each text box as columns in excel headed by text box name as column header.
The column headers which we use in report does also considered to be label as values text box name as textbox control name. Which creates unnecessary columns in csv output.

Anything CSV does not print?
Yes . All fields in your rdl which has Data Element Output as NoOutput.

And Now How to Make SSRS Report CSV Supported
·         Give valid name for the text box which has values instead of default naming like textbox1, textbox2 etc.
·         All textboxes which prints the label should have data element output property as NoOutput
·         All textboxes which prints the totals , title should be set to property NoOutput.







Adding parameter to AX SSRS Report

Adding RDP parameter to report
Let us see how to add parameter to existing report. We will take up customer transaction report and add from date and to date as parameters.
Step 1: Create 2 parm methods in CustTransListContract
 For FromDate and ToDate
/// <summary>
/// Gets or sets the value of the datacontract parameter FromDate.
/// </summary>
/// <param name="_fromDate">
/// The new value of the datacontract parameter FromDate; optional.
/// </param>
/// <returns>
/// The current value of datacontract parameter FromDate.
/// </returns>
[
    DataMemberAttribute('FromDate'),
    SysOperationHelpTextAttribute(literalStr("@SYS26930"))
]
public FromDate parmFromDate(FromDate _fromDate = fromDate)
{
    fromDate = _fromDate;
    return fromDate;
}

/// <summary>
/// Gets or sets the value of the datacontract parameter ToDate.
/// </summary>
/// <param name="_toDate">
/// The new value of the datacontract parameter ToDate; optional.
/// </param>
/// <returns>
/// The current value of datacontract parameter ToDate.
/// </returns>
[
    DataMemberAttribute('ToDate'),
    SysOperationHelpTextAttribute(literalStr("@SYS26929"))
]
public ToDate parmToDate(ToDate _toDate = toDate)
{
    toDate = _toDate;
    return toDate;
}


Step 2: Check for initialisation code in processReport method of CustTransListDP class
  contract = this.parmDataContract() as CustTransListContract;

Step 3: Assign the parameter value to local variable and use it for filtering in process report.
FromDate FromDate;
ToDate  ToDate;

fromDate = contract.parmDate();
toDate   = contract.ToDate();

if ((cursor.TableId == custTable.TableId ||
                    !(remainAmount &&
                (custTrans.CurrencyCode ? custTrans.AmountCur == custTrans.SettleAmountCur : custTrans.AmountMST == custTrans.SettleAmountMST))) &&
                (custTrans.TransType != LedgerTransType::ExchAdjustment ||
                (custTrans.TransType == LedgerTransType::ExchAdjustment && this.balanceMST(exchangeAdjustmentType) != 0)) && (custInvoiceJour.InvoiceDate >= fromdate && custInvoiceJour.InvoiceDate <= toDate) )

{
// insertion code as is
}


Step 4: Add fromDate and ToDate form control(dialog control) in form(dialog) for end user input in CustTransListUIBuilder-> build method.

    FromDateField          = this.bindInfo().getDialogField(custTransListContract, methodStr(CustTransListContract, parmfromDate));
ToDateField          = this.bindInfo().getDialogField(custTransListContract, methodStr(CustTransListContract, parmToDate));




               
Step 5:Compile forward the contract class,UI builder and DP classes which were updated before.
Step 6: Open the report design in visual studio and check the parameters node available for fromDate and toDate




If Available,
Build and Deploy the report.
If parameter is unavailable then
                Delete CustTransListDS datasource in report


               
Right click datasets and add new dataset . Update the properties as below.

Click the continue button in property section in Query control. DP selection window will open.


Select CustTransListDP and all fields . Click next  and finish the wizard.
Redeploy the report.
Step 6: Delete report from report manager site.
Report manager url is available at following location.
System Administration -> Setup-> Business Intelligence -> Reporting Services-> Report servers
Redeploy the report.
Restart AOS.
Restart SSRS service.


Saturday, 28 June 2014

Examples of SSRS Reporting Approaches in AX 2012


Types in AX reports

The helpful factor with any ERP would be you need not bring something from google; you can search it within your application itself. Same with SSRS Reports in AX. Let us move out of these normal 3 types of SSRS reports i.e. (RDP, Query & EnumProvider) and look at where can we find solutions for common requirements in report.

Query based report

It’s a Hello world for SSRS starter in AX. The best example would be AssetAddition report. Here a static query of AssetAddition is used as report data source and auto design is used to print the query.
Anything above select button in dialog where by default the field is disabled or greyed out can be created from range of this static query.  Check the vend query you can see range Vendor.

Simple Data Processing class

We write a DP class here which will have 3 methods generally ; processReport, InsertintoTempTable and GetTmpTable .

One can create DP with or without base query. 
·         Without Base Query: You can use Purchase order(PurchPurchaseOrderDP) as example.
·         With  Base Query: You can use VendListBasicDP as example. You can register base query in class declaration.


DP class with Barcode

You can find the detailed steps to create barcode in this blog.  Example is WmsPickingListReportDP.

Pre Processing DP

Pre processing report is used usually with respect to Accountable documents where the session starts post process . Example would be PurchPurchaseOrder .  inheriting class and userConnection in processReport is mandatory in this approach.  


And in process report,

You won’t be able to use pre-processing DP in EP reports.

Reports as Forms


There are places where DP classes are used to show the data in forms. The best example is Trial Balance. LedgerTrialBalanceListPage is the form which uses the DP with name LedgerTrialBalanceDP to fetch data and display it in UI.  

Marshaller Reports


SalesTaxTransReportDP_IN is one of the standard report DP which runs with Marshaller approach. This SalesTaxTransReport_IN report prints columns selected by end user in run time.  Here The dialog or form proposes 50 fields to end user in which one can select any 20 fields and click print to get the customized report.

HTML Reports

You can print report as HTML . The best example would be HcmSkillMappingReport ; which is taken as is from AX 2009.
Classes HcmSkillMappingReport & HcmSkillMappingReportGenerateHTML is the ones which does this operation. There will not be any SSRS designs in this case where as the tags you write in HcmSkillMappingReportGenerateHTML will get converted as design.

Print Management Report

 Examples are PurchPurchaseOrder ,PSAProjInvoice and so on. For All AD’s in AX we use print Management approach.
You can find the detailed steps to create PrintManagementReport  in this blog.

Cube Reports

You can find the detailed steps to create Cube report in this blog. However in AX most of the time this feature is used for charts or KPIs .
Report Object
Usage Type
ProjKPI
KPI
SalesAnalysis
Auto Bar Chart
YearToYearExpensesByPeriod
Role Center
Remember there won’t be any DP for this. All you can have is Contract and UI Builder.

EnumProvider Report

Here you will be passing enum as data source to report. WorkflowTrackingReport is the report which uses 3 approaches. The three approaches used are query , AX EnumProvider and DP class.

XMLExcel Report

These are the reports which you can use to directly export to excel. Obviously no design required.
Example can be XMLExcelReport_SalesBook_AddList_RU.

Some doesnot need DP and some doesnot design.. Its you who has to take wise decision that which approach to go with.

Happy DAXING :-)

Sunday, 2 February 2014

Print Management Report


Print Management Report

What is this?

Managing print settings of report with the help of print management framework. It can be number of copies, printing style, printer , design selection based on country, module ,customer specification.

When we need this?

Generally when we have Accountable documents which we will be sharing with customers r vendors our report should match reporting standard and sometime customer specific requirements may be design, copy styles.

Examples of Reports where print management is used.

·         Project Invoice
·         Purchase Order
·         Project Quotation and many more
The DP approaches for these reports are not same .. Some of the reports DP are developed with Normal DP approach and some with pre-processor.

Lets Do It

Create any DP based report either pre-processor or normal DP. I will take Purchase Requisition as example.Let us modify PurchReq to print Management report.
Purchase Requisition is not a form letter report. So update the class from report run print management specific controller



Lets save it here and proceed with populating required prerequisites i.e. 2 enum 4 classes.

Create a node in Doctype and NodeType base enums

Add new Node with report name to base enum PrintMgmtNodeType and PrintMgmtDocumentType.

Specify base table id and default report format in PrintMgmtDocType

Edit getQueryTableId() method and add following code


case PrintMgmtDocumentType:: PurchReq:
            tableId = tableNum(PurchReqTableVersion);
            break;

Edit getDefaultReportFormat and add following code


 case PrintMgmtDocumentType:: PurchReq:
            return ssrsReportStr(PurchReq, Report);

Never ever dare to keep break statement after this code.

Register the new report in document type of node derivative and construct the derivative in node.

Edit getDocumentTypes in PrintMgmtNode_Purch

docTypes.addEnd(PrintMgmtDocumentType:: PurchReq);

Edit construct in PrintMgmtNode

case PrintMgmtNodeType::PurchReq:
            return new PrintMgmtNode_Purch();

Never ever dare to keep break statement after this code.

Edit the PrintMgmtHierarchy derivative so that you get to default the design in printManagement

Edit getNodesImplementation in PrintMgmtHierarchy_Purch and add following code

supportedNodes.addEnd(PrintMgmtNodeType::PurchReq);

Edit getParentImplementation in PrintMgmtHierarchy_Purch and add following code

case PrintMgmtNodeType::PurchReq:
 // No record to reference, but there is another node in the hierarchy
result.parmReferencedTableBuffer(null);
result.parmNodeDefinition(PrintMgmtNode::construct(PrintMgmtNodeType::PurchReq));
break;

Move back to controller and add following methods

Override initPrintMgmtReportRun

And runPrintMgmt


Populate the report design to printMgmtReportFormat table

Register the design names which should be available in print management options
Through addax and AddOther

addAx(PrintMgmtDocumentType::PurchReq);
addOther(PrintMgmtDocumentType::PurchReq, ssrsReportStr(PurchReq, Report), ssrsReportStr(PurchReq, Report), countryRegionId);

That’s Itt!! Done with Print Management ..

How will you set the Print Management design?

·         Select a module the report is related to.
·         GoTo Setup -> Forms -> Form Setup



Click Print Management Button and in Print Management Setup form select the design you would like to go for in Purchase Requisition node.









Saturday, 11 January 2014

Barcodes in SSRS Reports

Barcode in SSRS Reports

Barcode logic

We can fetch barcode to SSRS through 2 ways.
Approach 1:Simple way: Use font with font name Prefixed with BC in text box property of report design


Approach 2:To convert the text to barcode with AX framework; and to fetch font and size properties from AX.

Example of Report in standard AX where they have used approach 2

WMSPickingList

Code Snippet for Sample Report which uses Barcode with Approach 2

Here we go! All we need is a string field.
Steps in short : Get a table which has string field declare it in DP. Fetch the barcode font and size from the parameter table if you need the one selected by end user. Encode your string to barcode in DP. Simply send it to report. In Design update the font tab controls with user entered font name and font size. There comes the bar code.
Steps in detail with code snippet:

·        Declare Barcode specific EDT, table and class in Class declaration


·        Define initBarcode where the record from Barcode setup is selected based on inventory parameter.


Inventory parameter table is just an example whereas the base table for bar code types are available in Organization Administration ->Setup ->Barcode.


·        Define process report and call initBarcode method.


·        Convert string to barcode using encode method of barcode class in barcode method.






·        Rest is inserting into table and getting from table methods.







·        In Design for the text box where you need to print the barcode use barcode font name and size fields in text box properties->Font tab controls just as in Approach 1 where you used to select font manually.