Skip to main content

Notifications

Microsoft Dynamics SL forum
Unanswered

Print to file

Posted on by 1,245

Many screens in SL (we use 6.5) prints reports directly to printer.  e.g. Allocation Processor (PA.PRO.00) runs the process and then prints to printer which is currently configured. 

What I'm looking for is a way in which I can control this default behaviour and redirect the output to a file.  One way to achieve is to set pdf printer before running this process. Another way is to set "Print to file" under Printer Setup (98.220.00). The problem with these two approaches is that users need to remember (many times does not) to set this prior to running the process.  Is there a way by which when this screen is opened, I can write some VBA code that will change the printer setup?  And then set it back to whatever it was before upon close.

To this effect, I came across RptRuntime in system database where I can set the ri_printer to A and ri_outfile to full path filename.  This works except that the report gets exported in ASCII rather than pdf (which it does when "Print to file" is set).

Any hints, pointers, thoughts are appreciated.

TIA

  • Cherie Kane Profile Picture
    Cherie Kane 595 on at
    RE: Print to file

    Nayan:

    Did you have to create the ROI pre-process?  I'm trying to do the same but for the Requisition module when the Reqs are generated into a PO.

    Cherie

  • Nayan Mansinha Profile Picture
    Nayan Mansinha 1,245 on at
    Re: Re: Re: Print to file

    Atlast got this working.  ROI pre-processors allow you to tweak rptRuntime entries at the very last moment before Crystal does its part.  ROI user guide (pdf in User Manual folder) describes many ROI parameters that can be set using AddRIParam call in pre-processor.  e.g. shown below:

        Dim ROIParms As String
        Dim RI_ID As Integer, ierr As Integer

        ' get RI_ID
        ROIParms = ApplGetParms()
        RI_ID = CInt(ROIParms)

        ' set the name of the printer to receive the report output. D = preview
        ierr = AddRIParam(RI_ID, "RI_PRINTER", "A") ' check ROI manual for declaration of AddRIParam
        If ierr <> 0 Then
             ' error
        End If

  • Nayan Mansinha Profile Picture
    Nayan Mansinha 1,245 on at
    Re: Re: Print to file

    I get that part.  But that is not what I'm looking for.  May be I did not frame the  question correctly.  Let me re-phrase:

    I want to print to PDF only for some reports and not all.  I dont want users to remeber everytime to switch the printer.  So, effectively I want to automate the whole process of printing specific reports (eg. Allocation Process generated reports) to be printed as pdf and with unique names without user bothering themselves with the task.

    Hope this clarifies what I'm looking for. 

    FYI  I'm exploring pre-processors and RIParam to see if this will work out.  Will keep posted.

     TIA.

  • pbrattin Profile Picture
    pbrattin 1,850 on at
    Re: Print to file

    We use PrimoPDF, a printer driver that redirects output to a PDF file. The computer thinks it is a printer but is really a print to PDF. You can use it in all the screens and do not have to set the printer on th start-up page to use it.

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans