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 NAV (Archived)

Save statements reports

(0) ShareShare
ReportReport
Posted on by

Hi,

When using the statements report in the customer page you can choose to save you pdf's. 
I have created a mirror of this rapport (116) and made some changes, so now I have 2 of the statements reports similar to each other.

The second one i created does not give the option to save it to a location on the computer. I have created a page action like this:

Customer.SETFILTER("No.","No.");
REPORT.RUNMODAL(REPORT::"Statement Open Post CC",TRUE,FALSE,Customer);

The orginal report is run with a RunObject wich runs a codeunit.

Will it take a lot of work to change my second report to do as the orginal and how can i do it?

Thanks in advance 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RockwithNav Profile Picture
    8,600 Super User 2025 Season 2 on at

    Hey Chris,

    First of all update your code.

    community.dynamics.com/.../193691

    Never use this piece code on Page Action while executing Reports from Pages.

  • Community Member Profile Picture
    on at

    Its almost the same lines of code you suggested and I have not experienced any issues with the lines of code i wrote.

    If i need to change the way to solve the problem i wrote in the question of the thread i see no reason to start fixing a third problem which may get replaced anyway.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    Are you getting a request page of the report ?

  • Community Member Profile Picture
    on at

    Yes, there is nothing wrong with it - its working fine.

    The client just want to have this option to save the files local on their PC like it does on the orginal Statement action.

     save.png

  • Suggested answer
    Community Member Profile Picture
    on at

    Try following code on page action.

    //Local Variables

    ReportSelections   Record   Report Selections

    CustomLayoutReporting   Codeunit   Custom Layout Reporting

    RecRef     RecordRef

    RecRef.OPEN(DATABASE::Customer);

    CustomLayoutReporting.SetOutputFileBaseName(StatementFileNameTxt);

    CustomLayoutReporting.ProcessReportForData(ReportSelections.Usage::"Statement Open Post CC",RecRef,Customer.FIELDNAME("No."),

     DATABASE::Customer,Customer.FIELDNAME("No."),TRUE);

    Hope this helps.

  • Suggested answer
    Suresh Kulla Profile Picture
    50,243 Super User 2025 Season 2 on at

    So you are not getting above option when you run the action ? What do you get when you ask to print to PDF ?

  • Community Member Profile Picture
    on at

    I tried the solution you came with Vishal, but nothing happend.

    To clarify I will attach a picture where I have drawn on it to show what I am looking for.

    When pressing the statement report in the left I get first the popup to the left and when I click ok with those settings i get the option to save to a location on the PC.

    How can I make it happend on the new report i have added to the button to the right of the orginal statement called Statements open? Right now its only show the first popup and open the PDF with adobe.

    save-reports.png

  • Suggested answer
    Community Member Profile Picture
    on at

    Try making another copy of report (WITHOUT ANY CHANGES) and attach the same at customer card and see if it works or not?

    Ideally, if you have not changed anything, it should should work fine as it is working in standard NAV report.

  • Community Member Profile Picture
    on at

    The report is fine.

    Its the way I add the report object.

    The standard report is added by using the action properties -> RunObject -> Codeunit Customer Layout - Statement.

    The way I added was just write the 3 lines of code I wrote in the beginning of the thread.

    Can I have more Customer Layout - Statement? (Codeunits)

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 NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans