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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

SSRS report Error: "Report name in report contract cannot be null or empty."

(0) ShareShare
ReportReport
Posted on by 25

Hi All,

I am getting this error "Report name in report contract cannot be null or empty." when i run my custom report which uses print management.

I am not able to repro the issue also as the debugger is not taking me to the info class "Add " method so that i can check from where the issue is coming.

Please help if anyone faced the same issue in Dev environment.

Thanks in advance,

Siddharth K

I have the same question (1)
  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Siddharth K,

    How did you add your report in x++ for print management?

    About debugging, Have you unmarked checkbox "Load symbols only for items in the solution" from Dynamics 365 - Debugging options (can be opened from Dynamics 365 menu -> Options?

  • Sidd.Harth Profile Picture
    25 on at

    Hi Sergei,

    Thanks for the quick reply.

    I have followed the base customer account statement way.

    I have extended my controller class with SrsPrintMgmtController.

    I have kept runPrintMgmt method and controlled the customers flow in it.

    I have unticked that check box now. Thank you for that!

    The run print mgmt method is like below,

                 

    protected void runPrintMgmt()
    {

    printMgmtReportRun = PrintMgmtReportRun::construct(PrintMgmtHierarchyType::Sales ,PrintMgmtNodeType::CustTable,PrintMgmtDocumentType::GSGFXGSMemberStatement);

    printMgmtReportRun.parmReportRunController(this);

    printMgmtReportRun.load(this.parmArgs().record(),this.parmArgs().record(), Global::currentUserLanguage());

    var customerList = new Set(Types::Int64);

    var customerQueryRun = new QueryRun(query);
    while (customerQueryRun.next())
    {
    try
    {
    CustTable custTable = customerQueryRun.get(tableNum(CustTable));

    if (!customerList.in(custTable.RecId))
    {
    customerList.add(custTable.RecId);

    select firstOnly DocumentType, ReferencedRecId, ReferencedTableId, RecId from printMgmtDocInstance
    join RecId, AccountNum from custTable
    join PrintJobSettings from PrintMgmtSettings
    where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::GSGFXGSMemberStatement
    && printMgmtDocInstance.ReferencedRecId == custTable.RecId
    && printMgmtDocInstance.ReferencedTableId == tableNum(custTable)
    && printMgmtSettings.ParentId == printMgmtDocInstance.RecId;

    if (PrintMgmtSettings.PrintJobSettings)
    {
    printDestinationSettings = new SRSPrintDestinationSettings(printMgmtSettings.PrintJobSettings);
    printDestinationSettings.overwriteFile(true);

    printMgmtReportRun.load(custTable,custTable, Global::currentUserLanguage());

    }
    else
    {
    printMgmtReportRun.load(this.parmArgs().record(),this.parmArgs().record(), Global::currentUserLanguage());
    }
    QueryBuildDataSource qbds = SysQuery::findOrCreateDataSource(query,tableNum(CustTable));
    QueryBuildRange qbr = SysQuery::findOrCreateRange(qbds,fieldNum(CustTable, AccountNum));
    qbr.value(custTable.AccountNum);

    if(custTable.RecId)
    {
    this.outputReports();
    }
    }
    }
    catch
    {
    throw Error('');
    }
    }
    }

    Cn you please tell me where i have done the mistake?

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Siddharth K,

    I haven't used that way. Usually, I just add a new layout and register it via delegate PrintMgmtReportFormatPublisher.notifyPopulate. Then you can select your report in UI in print set up form.

    MS whitepaper for AX2012 (the idea is the same in D365)

    www.microsoft.com/.../details.aspx

  • Sidd.Harth Profile Picture
    25 on at

    Hi Sergei,

    Actually my report is a totally custom report.

    How can we register in the delegate PrintMgmtReportFormatPublisher.notifyPopulate. ? .. Just by adding our report code ?

  • Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Siddharth K,

    If it's a custom report, why do you need to use print management? Are you planning to add several different layouts for it?

  • Sidd.Harth Profile Picture
    25 on at

    HI Sergei,

    My actual requirement is:

    I need to run a batch job for the customers given in my custom query and get some details related to the customers from my custom tables and print them (one report per one customer ) and also mail them the report without printing it to screen nor saving as pdf in server.

    After the report is run ..I need it to be mailed to the customer. So I was using the print management scenario to send the mail directly.

    There will be once report and only one design for that report..

    That needs to be sent to customer email address directly when the batch job is run.

  • Verified answer
    Sergei Minozhenko Profile Picture
    23,097 on at

    Hi Siddharth K,

    Have you specified somewhere report name in your controller class? In standard class (CustAccountStatementExtController), it's specified in the main method and if you have only one static layout for all customer you can specify it without print management using ssrsReportStr function

  • Suggested answer
    Sidd.Harth Profile Picture
    25 on at

    Hi Sergei,

    Thank you so much for understanding and helping me out.

    The error is resolved now.

    The solution was, I have deleted the print management settings from the Customer -> Print management form.

    I forgot to add them back.
    Because of that issue was coming.

    Thanks & regards,

    Siddharth K

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 477 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 470 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 412

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans