Showing posts with label Reporting service. Show all posts
Showing posts with label Reporting service. Show all posts

July 16, 2024

How to Install 'Globalization Solution for Microsoft Dynamics 365 Finance' for ER reporting

Hi Folks, 

I recently been working on ER reporting was referring Microsoft documentations for Electronic reporting (ER) overview , the detaisl inthsi document have some conditions (as of today July 11, 2024) which is not clearly mentioend in this document that the repository mentieodn are only applicate till version 10.0.38, from this version onwards thigs changed (Yes changed again!!!)

In this post I will explain how to setup ER reporting for your environment. 

Thigs to note before start:

1. Admin access to Admin center of power platform
2. Admin access to D365FO
3. LCS and Operations resources are not supported any more, Regulatory Configuration Service (RCS) will be deprecated as well
4. New Solution will be deployed on Dataverse
5. This works only with Tier 2 instances 

Worth the know: 

1. If you check your ER reporting work space (with version 10.0.30 and above) you will only get two options in 'Configuration repository' which are
i. Dataverse
ii.  Operation resource

and if you try to setup data verse and open it, you may get below error,  Error when opening Data version in ER repository, 

ER reporting workspce
















Request to Dataverse failed. Check that solution is installed and application user has access to Dataverse tables. Error code: d02c0bcd Timestamp: 2024-07-04 13:20:10 Correlation Id: <####> Exception thrown: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: RetrievePrivilegeForUser: The user with id <####> has not been assigned any roles. They need a role with the prvReadmsdyn_ElectronicReportingConfigurationsIndexFile privilege. (Fault Detail is equal to Exception details: ErrorCode: 0x80042F09 Message: RetrievePrivilegeForUser: The user with id <###> has not been assigned any roles. They need a role with the prvReadmsdyn_ElectronicReportingConfigurationsIndexFile privilege. TimeStamp: 2024-07-04T13:20:10.5918579Z -- Exception details: ErrorCode: 0x80042F09 Message: RetrievePrivilegeForUser: The user with id <###> has not been assigned any roles. They need a role with the prvReadmsdyn_ElectronicReportingConfigurationsIndexFile privilege. TimeStamp: 2024-07-04T13:20:10.5918579Z -- ).

2. If you have already setup some other repositores in past version and than updated your environment, you still be able to see and access these repository. But you wont be able to create new repository on same type. 

Now coming to solution: 

1. Navigate to Microsoft app source and search for  Globalization Solution for Microsoft Dynamics 365 Finance or click here


Microsoft app store





2. Click on 'Get it now', it will nevugatre you to https://admin.powerplatform.microsoft.com/ portal where you need to select further details. In select environment option you can only selelct a sanbox or productoin ( no tier 1 option by default)

(Note: To install an app, you must have a successfully provisioned environment in the region where the application is available and the environment must have a database connection)


Dataverse install solution




























3. After the installation you will be able to see this under solution tab, check if there are update on this solution , 

Dataverse update solution

I would recommend to udpate this to latest version, 

Dataverse solution






































Dataverse update solution


















Once these steps finished successfully , go back to your environment and select data verse and click on Open. 
D365FO ER reporting workspace















You should be able to see all reporting configuration and choose what you need and import to use. 

D365FO ER reporting workspace
































Further references


Happy ER reporting, and may your data flow smoothly!


February 04, 2023

QuickFix: [Solved] SSRS Report Deployment failed - The number of defined parameter is not equal to the number of cell definitions in the parameter panel

While duplicating an SSRS report for customization sometimes you may face this error at the time of report deployment. 

Error Message:
"SSRS Report Deployment failed - The number of the defined parameters is not equal to the number of cell definitions in the parameter panel."

Solution

The first thing you need to check for any extra parameter is this report, compare with the standard report. There are two places you need to compare
1. DataSet parameters
2. Report Parameter







































There might be an extra parameter(s), try to remove this extra parameter from the report. In case you are unable to delete it from the front end you need to open the report in XML (Right-click on the report in solution and select open with > Open with XML Text editor).

In the XML file search for this parameter and carefully remove it from everywhere. If you are not familiar with XML better to take help. Save your changes and build the solution. This time your report should be deployed without any error. 


-Harry Follow us on Facebook to keep in rhythm with us. https:fb.com/theaxapta

January 19, 2015

Run, Save and Email Purchase order report through X++ code

Sending SSRS Reports via Email in D365FO: Simplified Steps

Sending SSRS Reports via Email in D365FO: Simplified Steps

Introduction

In some cases, customers may require the ability to send SSRS reports directly to their email addresses, such as Purchase Order or Sales Order reports. In this blog post, we will demonstrate how to achieve this functionality using simple and straightforward steps.

Step 1: Running the Report and Saving it Locally as PDF

To begin, create a new class and add a method that runs the report and saves it to a local or shared path. Here is an example code snippet:

    
public str runAndSaveSSRSReport(PurchTable _purchTable)
{
    // Initialize variables
    SrsReportRunController ssrsController = new SrsReportRunController();
    PurchPurchaseOrderContract contract = new PurchPurchaseOrderContract();
    SRSPrintDestinationSettings printerSettings;
    VendPurchOrderJour vendPurchOrderJour;
    str reportPath;

    // Retrieve the latest purchase order for the specified PurchTable
    select firstOnly vendPurchOrderJour
        order by vendPurchOrderJour.createdDateTime DESC
        where vendPurchOrderJour.PurchId == _purchTable.PurchId;

    // Set the report path to save the PDF
    reportPath = "C:\\" + _purchTable.PurchId + ".pdf";

    // Configure the report controller
    ssrsController.parmReportName(ssrsReportStr(PurchPurchaseOrder, Report));
    ssrsController.parmExecutionMode(SysOperationExecutionMode::Synchronous);
    ssrsController.parmShowDialog(false);
    contract.parmRecordId(vendPurchOrderJour.RecId);
    ssrsController.parmReportContract().parmRdpContract(contract);

    // Link the printer settings to the controller
    printerSettings = ssrsController.parmReportContract().parmPrintSettings();
    printerSettings.printMediumType(SRSPrintMediumType::File);
    printerSettings.fileFormat(SRSReportFileFormat::PDF);
    printerSettings.overwriteFile(true);
    printerSettings.fileName(@reportPath);

    // Run and save the report
    ssrsController.runReport();

    return reportPath; // Return the file location where the PDF is saved
}
    
  

Step 2: Emailing the Report

Once the report is saved locally, you can proceed with attaching and sending it via email. Add the following method to your class:

    
public void POConfirmationEmail(PurchTable _purchTable)
{
    // Initialize variables
    PurchTable purchTable;
    Map parameterMap = new Map(Types::String, Types::String);
    Email requester;
    SysEmailId ApprovalEmailTemplate;
    SysEmailId ReopenEmailTemplate;
    str companyDetails;
    FilenameOpen attachmentFilename;

    companyDetails = curext();
    parameterMap.insert('CompanyDetails', companyDetails);

    purchTable = _purchTable;
    attachmentFilename = this.runAndSaveSSRSReport(purchTable);

    // Set email parameters
    parameterMap.insert('VendorName', VendTable::find(purchTable.OrderAccount).name());
    parameterMap.insert('PurchaseID', purchTable.PurchId);
    requester = LogisticsElectronicAddress::findRecId(DirPartyTable::findRec(VendTable::find(purchTable.OrderAccount).Party).PrimaryContactEmail).Locator;

    if (!requester)
    {
        throw error("No Email address is available");
    }
    else
    {
        // Send email using the "PoEmail" template and delete the report file after sending
        SysEmailTable::sendMail("PoEmail", companyinfo::languageId(), requester, parameterMap, attachmentFilename);
        this.deleteReportFile(attachmentFilename);
    }
}
    
  

Step 3: Deleting the Report File

Finally, add the following method to your class to delete the report file from the local drive:

    
public void deleteReportFile(str _reportPath)
{
    str reportPath = _reportPath;

    if (!reportPath)
        warning("No file in local drive to remove");
    else
        WinAPI::deleteFile(@reportPath);
}
    
  

Conclusion

By following the above three steps, you can easily send SSRS reports via email in D365FO. Consolidating the code into a single class enhances reusability and simplifies maintenance. Feel free to leave your feedback, questions, or queries in the comments section.

Enjoy the streamlined process!

- Harry

September 02, 2014

Error while deploying SSRS report in Dynamics AX 2012 R3- An error occurred : The network path was not found. If User Account Control (UAC) is enabled on the machine, close the application, right-click the application, and then click Run as administrator.

Hi Folks,


Below are troubleshooting for Error while deploying SSRS report in Dynamics AX 2012 R3

clip_image001

Error 1:
The deployment was aborted. You do not have privileges to deploy to server: ######. For deployment, you must have administrative rights to the SQL Server Reporting Services (SSRS) server. Contact your administrator to deploy.

Error 2:
An error occurred: The network path was not found. If User Account Control (UAC) is enabled on the machine, close the application, right-click the application, and then click Run as administrator.

Solution:

Go to services-> Remote Registry and change the start type to automatic. And start the service.

clip_image002

Now deploy your report, it should deploy successfully.

clip_image003


Hope this will help you. Keep sharing your feedback under comment box. 
-Harry




August 31, 2014

Error While deplying SSRS report DAX 2012 R2/R3

 Hi Folks,

Here is one more troubleshoot for SSRS report. Please check my previous post for similar errors and solutions.

Error:

A call to the Microsoft Dynamics AX SRSFrameworkService service failed. There was no endpoint listening at net.tcp://####srv:8202/DynamicsAx/Services/BIServices that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.


Possible Reason: 
Inbound port deactivated.

Solution:

Go System administration > Setup > Services & Application Integration Framework > Inbound ports.

Select BIServices port and activate it.


While activating you may one more error, and we will fix this as well :)



For that please follow below,

Goto AOT > Service Groups > BI Services, double check it has two services

Also check both services have the underline service operations:

 
If everything is correct then U can right click on BIServices service group and say Deploy Element.  

Enjoyyyyyyyy…. !!!

-Harry

June 04, 2014

Debugger is not working on RDP class – SSRS report-AX 2012

Hi Guys,

Here is another very common issue we might face any normal day,

Issue: 
While inserting breakpoint (By both “breakpoint” keyword and f9) , RDP Class not hitting by debugger in SSRS reports.

Solution: 
Here is a trip to do it
1. Open debugger manually
2. Put your breakpoint in code
3. Run code

Wowwwww its working now, isn't it….


-Harry

March 30, 2013

How to handle SSRS reports which will take long time

How to handle SSRS reports which will take long time

We know that there are/will be some reports which will take more time to render due to the many rows/transactions. This post will help you to show appropriate warning/error messages to the end user while running the report.

The number of records that are processed by report might be large and the user experience will be affected, because the client will be locked up if printing to the screen. 

In this case, you might want to return a warning message to the user that indicates that time to process the report might be long and confirm that they want to run the report. 

Another case could be where the number of records being processed is very large and a time-out might occur in report processing and clearly, we should not run this report.
In this case, we should not run the report and therefore, should return anSrsReportPreRunState::Error enumeration value with the error message.
In AX 2012, SSRS reports, through SrsReportRunController we can easily let the user know the report will take more time with warnings or error messages through preRunValidate method.

Example : General Journals report

Take the standard example of Print journal from General Ledger >> Reports >> Journal >> Print journal.

Use standard LedgerJournalController class to help you understand preRunValidate method: this validates container before running the report. Override this method to do custom pre-validation for any report. Typical use of this method will be to validate if the time taken to run the report is acceptable.
In this standard example: If the query is going to retrieve more than 1000 rows, a confirmation Box will be displayed to the user as shown below.

To get the confirmation box and for the sake of the demo/understanding: I have hardcoded the rows count to 1001 as shown below. There is a new static method in QueryRun::getQueryRowCount that will get the row Count of the query.

Please note: Remove hardcoded values later. This is hardcoded only for the sake of demo/Walk through
Clearly in the below standard example : warning limit is 1000 and error limit is 100000. 


image

Run this report as shown below...

image


Here comes the confirmation Box: 
If your report is long running, it may time-out. Do you want to continue?

Note: In order to resolve/by pass this confirmation Box, a developer can change the macro #define.warningLimit to greater value

Example : #define.warningLimit(2000);

image

you can increase the row count : to 1000001.

image

Let us run the report One more time as shown below.

image


Here comes the error message: Running the report has been cancelled due to the time it will take to run. Adjust the parameters of the report and retry.
In order to resolve this problem, Increase the ErrorLimit macro value in thepreRunValidate method.
Please note, it is not recommended to increase as it will take more time and your box cannot handle load.


Example : #define.ErrorLimit(150000);
image


Click below for original post...

-Harry 

February 11, 2013

How to pass values between form and report

How to pass values between form and report

Here is for example the code of the button that calls the report:

void clicked ()
{
    Args     args;
    ReportRun          reportRun;
    ;
    super();
    args = new Args();
    args.name(Reportstr(HistoryHolidays));
    args.parm( LogId  );
    reportRun = classfactory.reportRunClass(args);
    reportRun.init();
    reportRun.run();
    reportRun.wait();
    args.parmObject( args );
}

in the init method of your report try this:

public void init()
{
    if( element.args() )
    {
        logId =  element.args().parm();
    }
     super();
}

then you can use this parameter in your report form example: 

public void executeSection()
{
    ;
    if  ( employee_1.LogId == logId)
    {
        emplId = employee_1.empId;
        super();
    }
    if ( logid == "1")
    {
        emplId = DropHoliday_1.EmpId;
        super();
    }
}

You can use this logic in your code for many purpose.

-Harry
 

January 12, 2013

How to pass values from form to report

How to pass values from form to report

Hi Folks,

Follow below steps to understand this, 

1. Make the report as Interactive

image

2. Create Method initFromCaller and pass the args to it.     

image

3. Set the report caption (it will appear in dialog).  

image

4. The Method initFromCaller.
Method initFromCaller  Basicllt this form will call whenever you call this menu item from FORM. 

public void initFromCaller(Args _args)
{
InventJournalTable inventJournalTable;
QueryBuildDataSource qbds;
;
if (_args.caller())
{
if (! _args.record().recId)
   throw error(strfmt("@SYS22338",funcname()));
switch (_args.dataset())
{
case tablenum(InventJournalTable):

inventJournalTable = _args.record();
if (inventJournalTable.journalType != InventJournalType::Transfer)
throw error(strfmt("@SYS23396",funcname()));

break;
default:
throw error(strfmt("@SYS23396",funcname()));
}
}

if (true || inventJournalTable.journalId)
{
qbds = element.query().dataSourceTable(tablenum(InventJournalTrans));
SysQuery::findOrCreateRange(qbds, fieldnum(InventJournalTrans, journalId)).value(inventJournalTable.journalId);
SysQuery::findOrCreateRange(qbds, fieldnum(InventJournalTrans, journalType)).value(queryValue(InventJournalType::Transfer));
}
}

Enjoy Guys......

-Harry