2 reports to same PDF

DnealDneal Member Posts: 103
Hi All,

I have been reading over much of the forum looking for a solution. I'm hoping someone here can help me.

We have a print button setup on the Sales Quote form which calls a codeunit. The codeunit runs two reports:

REPORT.RUNMODAL(55557,TRUE,FALSE,Rec); //Cover letter
REPORT.RUNMODAL(50101,TRUE,FALSE,Rec); //Sales quote

The client will have the option to preview both reports before printing. The printer selection window appears so they can choose to save to Acrobat Distiller(PDF).

The issue is they want both reports in the same PDF file.

I'm still pretty new with Navision, so I apologize if the solution is simple. I'm just a little confused on how to get Navision to show both reports in one preview or print session.

Dneal
Newbie

Comments

  • DenSterDenSter Member Posts: 8,305
    No I'm afraid you can't get more than one report into one preview. You'll have to combine the two reports into one.
  • PrebenRasmussenPrebenRasmussen Member Posts: 137
    You can use Distiller API or Ghostscript to combine several PDFs to one.
  • DnealDneal Member Posts: 103
    Is it possible to combine two reports that uses the same dataitem? How would the sections have to be set up for that? It wants to merge everything together, I want the cover letter separate from the quote.

    The client only has Acrobat 5, which doesn't have the API for windows.

    Must be a way. ](*,)

    Thank you very much for replying. I really appreciate the help.

    DNeal
  • DenSterDenSter Member Posts: 8,305
    Reports are just sequential computer commands ordered in a certain way. You can put the dataitems of one report after the dataitems of another report and pretend that they're two reports :). Likewise, those dataitems will have their own sections, so you could copy those as well. It becomes tricky when your cover letter is suposed to print a certain number of times, and the other one another certain number of times, but you can program all that. You will also need to take care of are any 'shared' variables and other user defined values.
  • DnealDneal Member Posts: 103
    Hi DenSter,

    Thanks again for the reply. I will start trying to combine the reports. :)

    DNeal
  • DnealDneal Member Posts: 103
    It becomes tricky when your cover letter is suposed to print a certain number of times, and the other one another certain number of times, but you can program all that.

    I got both reports combined! Took care of the variables. I'm having issues with the number of times the report runs. How do I program that?

    Dneal
  • DenSterDenSter Member Posts: 8,305
    You put all your dataitems into an integer dataitem. Look at the standard Navision invoice report for examples. You are looking for the PageLoop dataitem.

    Good work combining the two reports :). Before you know it, you will be teaching us a thing or two.
Sign In or Register to comment.