web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

Print to file

(0) ShareShare
ReportReport
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

*This post is locked for comments

I have the same question (0)
  • pbrattin Profile Picture
    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.

  • Nayan Mansinha Profile Picture
    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.

  • Nayan Mansinha Profile Picture
    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

  • Cherie Kane Profile Picture
    639 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

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans