web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Print management settings for a new report is not working

(0) ShareShare
ReportReport
Posted on by 145

Hi All,

If I do the print management settings from “SalesLedger/Setup/Forms/Form setup/button: Print management”, my custom report is considering the print management settings, but if I delete the settings from here and do it from this path "Sales ledger/Common/Customers/All customers/General tab/ SetUp/Print management button" the report is not considering the print management settings (similarly for Purchase Ledger also).

What could be the issue?

Details for the code changes are below:

I have a new report for which I have to create the new node in print management setting.

I manage to bring the report in print management by adding code in the below classes and table:

My issue is:

If I open the print management settings from “SalesLedger/Setup/Forms/Form setup/button: Print management”

 

And do the setting here it’s working fine, my report is picking the print destination setting correctly from here.

But if I delete the settings from the above path and do the same setting from the other path which is “Sales ledger/Common/Customers/All customers/General tab/ SetUp/Print management button”

The report is not considering the print management settings here and running on screen only.

 

Changes

Enum:

Added report name in the below Enums:

\Data Dictionary\Base Enums\PrintMgmtNodeType

\Data Dictionary\Base Enums\PrintMgmtDocumentType

Tables:

\Data Dictionary\Tables\PrintMgmtReportFormat\Methods\populate: 

addAX (PrintMgmtDocumentType::SalesAdvancePayment);
addAX (PrintMgmtDocumentType::PurchAdvancePayment);
addAX (PrintMgmtDocumentType::LoadAdviceNote);

 

Classes:

\Classes\PrintMgmtHierarchy_Purch\getNodesImplementation: 

supportedNodes.addEnd(PrintMgmtNodeType::PurchAdvancePayme
supportedNodes.addEnd(PrintMgmtNodeType::LoadAdviceNote);

\Classes\PrintMgmtHierarchy_Purch\getParentImplementation:

case PrintMgmtNodeType::PurchAdvancePayment:
// When no parent is present, return null
result.parmReferencedTableBuffer(null);
result.parmNodeDefinition(PrintMgmtNode::construct(PrintMgmtNodeType::PurchAdvancePayment));
break;


case PrintMgmtNodeType::LoadAdviceNote:
// When no parent is present, return null
result.parmReferencedTableBuffer(null);
result.parmNodeDefinition(PrintMgmtNode::construct(PrintMgmtNodeType::LoadAdviceNote));
break;



Similarly for PrintMgmtHierarchy_Sales:

\Classes\PrintMgmtHierarchy_Sales\getNodesImplementation

\Classes\PrintMgmtHierarchy_Sales\getParentImplementation

 

\Classes\PrintMgmtNode_CustTable\getDocumentTypes

if (isConfigurationkeyEnabled(configurationKeyNum(LedgerBasic)))
{
docTypes.addEnd(PrintMgmtDocumentType::SalesAdvancePayment);
}

Similarly for these classes also:

\Classes\PrintMgmtNode_VendTable

if (isConfigurationkeyEnabled(configurationKeyNum(LedgerBasic)))
{
docTypes.addEnd(PrintMgmtDocumentType::PurchAdvancePayment);
docTypes.addEnd(PrintMgmtDocumentType::LoadAdviceNote);
}

\Classes\PrintMgmtNode_Purch

if (isConfigurationkeyEnabled(configurationKeyNum(LedgerBasic)))
{
docTypes.addEnd(PrintMgmtDocumentType::PurchAdvancePayment);
docTypes.addEnd(PrintMgmtDocumentType::LoadAdviceNote);
}

\Classes\PrintMgmtNode_Sales:

if (isConfigurationkeyEnabled(configurationKeyNum(LedgerBasic)))
{
docTypes.addEnd(PrintMgmtDocumentType::SalesAdvancePayment);
}

\Classes\PrintMgmtNode:

case PrintMgmtNodeType::SalesAdvancePayment:
return new PrintMgmtNode_Sales();

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

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

 

Class: PrintMgmtDocType

\Classes\PrintMgmtDocType\getDefaultReportFormat

case PrintMgmtDocumentType::SalesAdvancePayment:
return ssrsReportStr(AdvSettlPayment, Report);

case PrintMgmtDocumentType::PurchAdvancePayment:
return ssrsReportStr(AdvSettlPayment, Report);

case PrintMgmtDocumentType::LoadAdviceNote:
return ssrsReportStr(AdvSettlPayment, Report);

 

\Classes\PrintMgmtDocType\getQueryTableId

case PrintMgmtDocumentType::SalesAdvancePayment:
tableId = tableNum(SalesTable);
break;

case PrintMgmtDocumentType::PurchAdvancePayment:
tableId = tableNum(PurchTable);
break;

case PrintMgmtDocumentType::LoadAdviceNote:
tableId = tableNum(CTMContractLoads);
break;

\Classes\PrintMgmtDocType\getQueryRangeFields

case PrintMgmtDocumentType::SalesAdvancePayment:
fields.addEnd(fieldNum(SalesTable, InvoiceAccount));
fields.addEnd(fieldNum(SalesTable, SalesId));
break;

case PrintMgmtDocumentType::PurchAdvancePayment:
fields.addEnd(fieldNum(PurchTable, InvoiceAccount));
fields.addEnd(fieldNum(PurchTable, PurchId));
break;

case PrintMgmtDocumentType::LoadAdviceNote:
fields.addEnd(fieldNum(CTMContractLoads, LoadId));
break;

 

 

 

Please suggest some solution.

Best Regards

Pranav

*This post is locked for comments

I have the same question (0)
  • Pranav Gupta Profile Picture
    145 on at

    No, I have extended my Controller class with SrsPrintMgmtController

  • Pranav Gupta Profile Picture
    145 on at

    Thanks Crispin,

    Do you know how to explicitly read it from customer, if you have the code can you please provide it.

  • Pranav Gupta Profile Picture
    145 on at

    Thanks Crispin,

    I will try with these details.

  • Verified answer
    Pranav Gupta Profile Picture
    145 on at

    Hi Crispin,

    It helped, I have found the PrintMgmtSettings and pass it's "PrintJobSettings" field to the SRSPrintDestinationSettings class and it worked, the code is as below:

    select firstOnly DocumentType, ReferencedRecId, ReferencedTableId, RecId from printMgmtDocInstanceCust

                   join  RecId, AccountNum from custTable

                   join PrintJobSettings from PrintMgmtSettings

                       where printMgmtDocInstanceCust.DocumentType      == PrintMgmtDocumentType::SalesAdvancePayment

                   &&        printMgmtDocInstanceCust.ReferencedRecId     == custTable.RecId

                   &&        printMgmtDocInstanceCust.ReferencedTableId  == tableNum(custTable)

                   &&        custTable.AccountNum                                        == salesTable.CustAccount

                   &&        printMgmtSettings.ParentId                                == printMgmtDocInstanceCust.RecId

                   &&        printMgmtSettings.Description                           != "";

       if (PrintMgmtSettings.PrintJobSettings)

       {

           printDestinationSettings = new SRSPrintDestinationSettings(printMgmtSettings.PrintJobSettings);

           printDestinationSettings.overwriteFile(true);

           dataContract.parmPrintSettings(printDestinationSettings);

       }

  • ksv1 Profile Picture
    555 on at

    Hi Pranav,

    I have requirement to implement Print management setup for a new custom report and i

    have followed the same steps, but i am facing the issue when the code hits

    formletterreport.loadPrintSetting(mytablebuffer,mytablebuffer,languageId) in controller class.

    \Classes\PrintMgmtHierarchy_Invent\getParentImplementation -> i am passing the parmReferencedTableBuffer as null in my case.

    Could you please help me in sharing your controller class code for reference.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans