Skip to main content

Notifications

Announcements

No record found.

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

  • 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

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,492 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans