Using SaveAsPdf with a request page.

csilvajrcsilvajr Member Posts: 6
edited 2015-03-18 in NAV Three Tier
Is there a way in NAV 2013 R2 to use the SaveAsPdf function, but have a request page (the request page that is set up in the report) come up when code runs? I can get it to work by creating a Page then adding a button that runs the SaveAsPdf function, but it seems to be a waste of a page.

Comments

  • TonyDuarteTonyDuarte Member Posts: 92
    NAV 2013 R2 comes with an option to print with the following in the request page:

    Printer, PDF, Word, Excel.

    I think what you need to do is in the request page change the method, if you check the print button it has an arrow down if you click in the arrow you can select the options.

    Also when printing to PDF you can choose to save or open the document.

    Think this is what you need, no? :)
  • csilvajrcsilvajr Member Posts: 6
    Thanks for the reply, but it's not exactly what I need. I have a action on a page that print the report to a pdf then emails that pdf file. What I need it to do is before it saves the report to pdf to give me the report's request page so I can enter parameters of the report then save it to pdf then email. I am trying to do this with code and I thought USEREQUESTPAGE:=TRUE; would enable the request page before it saved it, but it doesn't.
  • TonyDuarteTonyDuarte Member Posts: 92
    Is that page action have code do print and send, and how is it calling?
  • BardurKnudsenBardurKnudsen Member, Microsoft Employee Posts: 137
    @csilvajr: The short answer to your question is "No." which is why we in NAV2015 introduced the new REPORT.RUNREQUESTPAGE() function that does exactly what you ask for. And in order to print/save/execute the report using those parameters, we also introduced a new set of functions to do exactly that. Take a look at https://msdn.microsoft.com/en-us/library/dn762361(v=nav.80).aspx
    In our case we primarily use it for scheduling reports to be executed in the background using Job Queue (https://msdn.microsoft.com/en-us/library/dn757302(v=nav.80).aspx).
    Bardur Knudsen
    Microsoft - Dynamics NAV
  • TonyDuarteTonyDuarte Member Posts: 92
    REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])

    Or even

    REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])

    https://msdn.microsoft.com/en-us/library/dd301122(v=nav.71).aspx

    Probably this can do the trick
  • csilvajrcsilvajr Member Posts: 6
    Thanks for all the replies.
Sign In or Register to comment.