Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How to get name of the report and design?

(0) ShareShare
ReportReport
Posted on by 210

/// <summary>
/// The <c>SalesBaileeController</c> class is the helper class for the associated SRS Report.
/// </summary>
class SalesBaileeController extends SrsPrintMgmtController
{
PrintCopyOriginal printCopyOriginal;
SalesInvoiceJournalPrint salesInvoiceJournalPrint;
RecordSortedList journalList;
CustInvoiceJour custInvoiceJour;

SalesBaileeContract salesBaileeContract;
/// <summary>
/// Initializes an instance of the print management report run object.
/// </summary>
/// <remarks>
/// This method provides the necessary construction of the <c>PrintMgmtReprotRun</c> class. Customizing
/// this class may cause problems with future upgrades to the software.
/// </remarks>
protected void initPrintMgmtReportRun()
{
printMgmtReportRun = PrintMgmtReportRun::construct(
PrintMgmtHierarchyType::Sales,
PrintMgmtNodeType::SalesTable,
PrintMgmtDocumentType::SalesOrderBailee);

printMgmtReportRun.parmReportRunController(this);

if (salesInvoiceJournalPrint)
{
printMgmtReportRun.parmDefaultCopyPrintJobSettings(new SRSPrintDestinationSettings(salesInvoiceJournalPrint.parmPrinterSettingsFormLetterCopy()));
printMgmtReportRun.parmDefaultOriginalPrintJobSettings(new SRSPrintDestinationSettings(salesInvoiceJournalPrint.parmPrinterSettingsFormLetter()));
printMgmtReportRun.parmForcePrintJobSettings(!salesInvoiceJournalPrint.parmUsePrintManagement());
}
else if (printCopyOriginal == PrintCopyOriginal::OriginalPrint)
{
//forcePrintJobSettings is reversal to usePrintManagement
printMgmtReportRun.parmForcePrintJobSettings(false);
}
}

/// <summary>
/// Loads the instances of the <c>PrintMgmtPrintSettingDetail</c> class that are used to print the
/// report.
/// </summary>
/// <param name="_jourTable">
/// The journal table to print.
/// </param>
/// <param name="_transTable">
/// The table to which the print management information has been related.
/// </param>
/// <param name="_languageId">
/// The language ID that should be used to retrieve the footer text.
/// </param>
/// <param name="_documentKeyValue">
/// A human readable value that uniquely identifies the document to be printed.
/// </param>
/// <remarks>
/// Start by calling the <c>loadPrintSettings</c> method to load print settings for the current
/// instance of the <c>FormLetterReport</c> class. Next, call the <c>moveNextPrintSetting</c> method to
/// iterate over the print settings that have been found. The <c>getCurrentPrintSetting</c> method will
/// then return the current instance of the <c>PrintMgmtPrintSettingDetail</c> class that can be used
/// to retrieve printer settings for the current copy of the report.
/// </remarks>
public void loadPrintSettings(Common _jourTable, Common _transTable, str _languageId, str _documentKeyValue = '')
{
boolean isValidReference(Common _referencedTableBuffer)
{
PrintMgmtNodeInstance nodeInstance = new PrintMgmtNodeInstance();

nodeInstance.parmNodeDefinition(PrintMgmtNode::construct(PrintMgmtNodeType::SalesTable));
nodeInstance.parmReferencedTableBuffer(_referencedTableBuffer);

return nodeInstance.isValidReference();
}

void setSettingDetail(PrintMgmtDocInstanceType _type, SRSPrintDestinationSettings _defaultSettings)
{
PrintMgmtPrintSettingDetail printSettingDetail = new PrintMgmtPrintSettingDetail();

PrintMgmtReportFormat printMgmtReportFormat;

printMgmtReportFormat = PrintMgmtReportFormat::findSystem(PrintMgmtDocumentType::SalesOrderBailee);

printSettingDetail.parmReportFormatName(printMgmtReportFormat.Name);
printSettingDetail.parmSSRS(printMgmtReportFormat.SSRS);

printSettingDetail.parmType(_type);

printSettingDetail.parmInstanceName(enum2str(_type));

// Since this will be reported to the screen, one copy is the only thing that makes sense
printSettingDetail.parmNumberOfCopies(1);

printSettingDetail.parmPrintJobSettings(_defaultSettings);

printMgmtReportRun.loadSettingDetail(printSettingDetail, _documentKeyValue);
}

if (printCopyOriginal == PrintCopyOriginal::OriginalPrint && isValidReference(_transTable))
{
// Print an original
printMgmtReportRun.load(_jourTable, _transTable, _languageId, _documentKeyValue);
}
else if (printCopyOriginal == PrintCopyOriginal::Copy)
{
// Print a copy
setSettingDetail(PrintMgmtDocInstanceType::Copy, printMgmtReportRun.parmDefaultCopyPrintJobSettings());
}
else
{
// Print an original. We also default to print one original when we are trying to
// print using Print Mgmt information, but don't have a valid table reference.
// This covers the reprint case where the original transaction record may not be present.
setSettingDetail(PrintMgmtDocInstanceType::Original, printMgmtReportRun.parmDefaultOriginalPrintJobSettings());
}

if (!printMgmtReportRun.more())
{
checkFailed("@SYS78951");
}
}

/// <summary>
/// Implements the print management functionality.
/// </summary>
/// <remarks>
/// This method loads the print settings for the business object. It then invokes any necessary
/// business logic and then calls the <c>outputReports</c> method.
/// </remarks>
protected void runPrintMgmt()
{
printCopyOriginal = this.parmArgs().parmEnum();

if (this.parmArgs().record())
{
// Get journal list from the selected record/s
journalList = FormLetter::createJournalListCopy(this.parmArgs().record());
}
else
{
journalList = this.parmArgs().object();
}

if (!journalList)
{
throw error("@SYS26348");
}
if (SysDictClass::isEqualOrSuperclass(classIdGet(args.caller()), classNum(FormletterJournalPrint)))
{
salesInvoiceJournalPrint = args.caller();
}

while (journalList.next(custInvoiceJour) && !this.parmCancelRun())
{
if (!custInvoiceJour)
{
throw error("@SYS26348");
}

this.initPrintMgmtReportRun();

this.loadPrintSettings(custInvoiceJour, custInvoiceJour.salesTable(), custInvoiceJour.LanguageId);
this.outputReports();
}
}

public static void main(Args _args)
{
SalesBaileeController reportController = new SalesBaileeController();

if (!NonSSRSPrintMgmtAdapter::runPrintMgmtNonSSRS(PrintMgmtDocumentType::SalesOrderBailee, _args))
{
return;
}

reportController.parmArgs(_args);
reportController.parmReportName(PrintMgmtDocType::construct(PrintMgmtDocumentType::SalesOrderBailee).getDefaultReportFormat());
reportController.parmShowDialog(false);
reportController.startOperation();
}

}

  • Verified answer
    Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: How to get name of the report and design?

    Hi,

    1. You need to check if there is a special set up in "Print management" form. Go to "Accounts receivable" -> Setup -> Forms -> Form setup ->Print management button. Find your specific report and check if there any setup. If it's there you can see the report name from the form.

    2. If there is no set up in "Print management" form. You need to find a default report and it can be found in PrintMgmtReportFormat.populate method.

  • vikash_ Profile Picture
    vikash_ 210 on at
    RE: How to get name of the report and design?

    how to find which report is used in this? i mean the name of the report.

  • Sergei Minozhenko Profile Picture
    Sergei Minozhenko 23,091 on at
    RE: How to get name of the report and design?

    Hi,

    Do you want to understand which report you need to change? Or what was the question?

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans