Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

Automatic PDF export

Posted on by 110

Hello!

We've been trying to automatically export a report to an Acrobat file. For a specific standard report, when the user clicks Print in the ROI screen, the output should be a PDF file no matter what printer is selected. It seems that the File Type value is not saved in the rptruntime table but in an environment variable and therefore can't be manipulated with a SQL trigger. If we set the RI_PRINTER field to A and we set RI_OUTFILE to C:\TEST.PDF, the file that is created is a standard text file, not an Acrobat one. Does anybody has been able to change the output file type through a pre-process Stored Procedure, Trigger, or VB Tools Application?

Thanks!

Miguel

*This post is locked for comments

  • Paul Phillips Profile Picture
    Paul Phillips 590 on at
    Re: Re: Re: Automatic PDF export

    Hi Miguel,

    You might be able to accomplish what you are trying to do by calling ROI from a command line. This may not work for some scenarios. Here is a sample of the Customization manager code to do this:

    ParmStr = "ROI.EXE " 
    + PRMSEP + "01650/RUN" 
    + PRMSEP + "01650/FORMAT"
    + PRMSEP + "C:\accounts.pdf/EXPFILENAME"
    + PRMSEP + "0/EXPFORMAT"
    serr1 = Launch(ParmStr, True, True, 0)
    Where EXPFORMAT is one of the valid formats that ROI supports. This example uses '0', the value for PDF. Full documentation on the command line parameters supported is in the SIV_RPTGD.pdf (Solomon 6.5) or sl_roi.pdf (SL 7.0) documentation files.
    The EXPFILENAME parameter can be used to specify the name of the exported file. I'm not sure offhand how you will determine the batch number prior to running the report if this is intended to be used with automatic batch control report printing during data entry. You will most likely need to write custom code for each screen to override the standard behavior.
    Similar code can be used from VBTools application code by substituting the SDK API call of CallApplic or CallApplicWait instead of 'Launch'.
    Note that it is also possible to pass a WHERE clause in through the command line, if you need to run a report with selection criteria in the same manner. The documentation will give full detail on all of the options. There is also a knowledgebase article at the following address which describes the above code in more detail and provides the available export file type flags:
     
    https://mbs.microsoft.com/knowledgebase/KBDisplay.aspx?WTNTZSMNWUKNTMMYLSVQUSPTNTNSMQPYWVZQPQTWSYXLTWXOPUVRXSUMVWTXWRMZYZOYNSWSNKXONZZLKKKLXQMNQPVUSKKN&wa=wsignin1.0

    Hope this helps.

    Paul Phillips
    Kono Consulting, Inc.
    268 Bush St. #429  |  San Francisco, CA 94104

     

  • al561914 Profile Picture
    al561914 110 on at
    Re: Re: Automatic PDF export

    Thanks for the info Dinesh. Actually we need the PDF export just for the AP Batch Control report and the client requested that the name of the file to be the batch number generated.

     Miguel

  • Dinesh Parashar Profile Picture
    Dinesh Parashar 295 on at
    Re: Automatic PDF export

     

    Set default printer to PDF. This is working fine on my system.

     

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans