Announcements
Hi, I'm new to Dynamics 365.
I am trying to modify the CustAccountStatementExt report to add the company logo. I created a copy of the report and added the field, I created an event handler for the InventJournalTrans table to add the company logo into the CompanyLogo field that already exists in the data source, I created a class extension for CustAccountStatementExtController so I could make the parmReportName process point to the copied report, I built the project, I saved, synchronized and deployed the reports verifying there are not error messages, but when I open the report, my changes are not being reflected into the report.
I used the debug mode to verify if the report is being called and It is, I also tried restarting the SQL server reporting service after deploying the report but my changes are still not being reflected in my report, what could I do to modify my report?
Here is the code of my event handler classclass CustAccountStatementExtTmp_EventHandler
{
[DataEventhandler(tableStr(CustAccountStatementExtTmp), DataEventType::Inserting)]
public static void CustAccountStatementExtTmp_onInserting(Common sender, DataEventArgs e)
{
CustAccountStatementExtTmp tmp = sender as CustAccountStatementExtTmp;
CompanyInfo companyInfo = companyInfo::find();
tmp.CompanyLogo = CompanyImage::findByRecord(companyInfo).Image;
}
}
And the controller extension
class CustAccountStatementExtControllerExt extends CustAccountStatementExtController
{
public static CustAccountStatementExtControllerExt construct()
{
return new CustAccountStatementExtControllerExt();
}
public static void main(Args _args)
{
SrsReportRunController formLetterController = CustAccountStatementExtControllerExt::construct();
CustAccountStatementExtControllerExt controller = formLetterController;
controller.parmReportName(ssrsReportStr(CustAccountStatementExtCopy, Report));
controller.parmArgs(_args);
controller.startOperation();
}
}
That's what I was assuming as well. You should be able to select the new design in the print management setup now.
OK I resolved It, I went to Accounts receivable > Setup > Forms > Form setup, then to General > Print management, and in Customer account statement, I deleted the current setup and created a new one with my new report name as the report format name, I saved It, tried to print the report and the printed report finally showed my changes, thank you so much for your help.
Sure
Could you please share a screenshot of the parameter settings you are using to print the report?
Hi Gunjan,
I checked and it is setting the new report name (CustAccountStatementExtCopy.Report), I put some text boxes in my report that have "Sample text" written to check if the new report is being printed, but those changes doesn't show in the printed report.
Hi Chris,
So it is setting the new report name. If you have verified this, is there any specific change apart from the company logo that you could use to verify that the new report is getting printed?
Hi Gunjan,
I debugged from the main method and the line is being triggered.
Hi Chris,
Please start debugging from main method in CustAccountStatementExtController class. The highlighted line of code should call the method you have created CoC on.
Hi Gunjan,
I tried the code you suggested but it didn't work either. I put some breakpoints to the CoC and checked them in debug mode and It seems they're not being triggered.
Hi Chris,
Your report name assignment has to be after the next call as you are overriding the standard functionality. Please try this code and see if that works for you.
[ExtensionOf(classStr(PrintMgmtDelegatesHandler))] final class PrintMgmtDelegatesHandler_Extension { protected static PrintMgmtReportFormatName getDefaultReportFormat(PrintMgmtDocumentType _docType) { str ret= next getDefaultReportFormat(_docType); switch (_docType) { case PrintMgmtDocumentType::CustAccountStatement: ret = ssrsReportStr(CustAccountStatementExtCopy,Report); } return ret; } }
André Arnaud de Cal...
293,289
Super User 2025 Season 1
Martin Dráb
232,068
Most Valuable Professional
nmaenpaa
101,156
Moderator