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
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
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
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.
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.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148