Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 04 NOV 2006 12:40:10PM dsig@sigafoos.org wrote:

I had thought i had this all sussed out a long time ago but ..

trying to get report to go directly to file

Have set the export file name

have set the export format to 6 (pdf)

have tried various things for PrintSetup - style

nothing seems to work

anyone have an example?

thanks


At 04 NOV 2006 11:01PM Richard Hunt wrote:

Hope this helps…

FILENAME='
FILENAME=INVOICE'
FILENAME=6
FILENAME=PATH
TITLE=Preview Invoices'
TITLE=&Cancel'
TITLE=On printer %s located at %s'
TITLE=Printing page %d'
PAGEINFO='
PAGEINFO=.5
PAGEINFO=.5
PAGEINFO=0
PAGEINFO=0
PAGEINFO=1
PAGESETUP=0'
PRINTSETUP='
PRINTSETUP=5'
PRINTSETUP=1'
PRINT_DEVICE=PDF'
PRINT_DEVICE='
ERROR=SET_PRINTER('INIT',FILENAME,TITLE,PAGEINFO,PAGESETUP,PRINTSETUP,PRINT_DEVICE)

At 05 NOV 2006 12:39AM dsig@sigafoos.org wrote:

SO only difference i see in what i am using is in printer device ..

i'll give it a try .. thanks


At 06 NOV 2006 08:07AM Sean FitzSimons wrote:

Dave,

That should be all that's necessary to send to PDF. What error message is coming back from the Set_Printer call.

Sean


At 06 NOV 2006 08:35AM Bob Orsini wrote:

Dave, the option supplied by Richard is not the option used normally by OIPI. If you are using option 6 in the export file you must make sure the printer option is set to 2 for preview. It will not work if the init is directed to the printer. Richard's way will also work but you do not need the option 6 for PDF this way and you must have installed the PDF printer driver.


At 06 NOV 2006 10:19AM dsig@sigafoos.org wrote:

i had 'guessed' that 6 was for 'device' and must be printer/device

So you told me what wouldn't work .. what will?

what params do i need to simply pdf directly to the file?


At 06 NOV 2006 10:25AM Sean FitzSimons wrote:

Dave,

In the first parameter for the INIT message, fieldmark 3 should be a 6 and fieldmark 4 should be the path & filename.

Sean


At 06 NOV 2006 10:41AM dbakke@srpcs.com's Don Bakke wrote:

DSig,

I believe Sean's response will help you. However, if you want a more thorough treatment of the subject you should read Mike Ruane's Using OIPI for Exporting whitepaper.

dbakke@srpcs.com

SRP Computer Solutions, Inc.


At 06 NOV 2006 12:21PM dsigafoos wrote:

]]In the first parameter for the INIT message, fieldmark 3 should be a 6 and fieldmark 4 should be the path & filename.

the following routine simply goes to the printer .. i have stripped out as much as possible but really must be missing something simple

SUBROUTINE DSIG(VOID)

declare subroutine set_printer

equ TRUE$ to 1

equ FALSE$ to 0

equ NULL$ to recFileName=NULL$ recFileName=6 ;* PDF recFileName=c:\temp\foo.pdf' recPrintInfo=NULL$ recPageInfo=NULL$ recPageSetup=NULL$ recPrintSetup=NULL$ recPrintCharMap=NULL$ recPrintDevice=NULL$ set_printer("INIT", recPrintHeading, recPrintInfo, recPageInfo, recPageSetup, recPrintSetup, recPrintDevice, recPrintCharMap) for x=1 to 40 set_printer('TEXT',x) next x set_printer('TERM') return </QUOTE> —- === At 06 NOV 2006 12:25PM dsig@sigafoos.org wrote: === <QUOTE>sorry muffed the first parameter name .. and because of that it went directly to the printer .. after fixing the name .. it goes to a rtf file .. have new file c:\foo\oipi.rtf </QUOTE> —- === At 06 NOV 2006 12:38PM dsig@sigafoos.org wrote: === <QUOTE>it went to the rtf file 1 .. next time (and there after recompile) it flashes up a message .. the hangs. if i force a debug it stops in set_printer. I have modified the routine below by adding param to go to preview .. that works correctly if i comment out the preview it again locks up SUBROUTINE DSIG(VOID) declare subroutine set_printer equ TRUE$ to 1 equ FALSE$ to 0 equ NULL$ to

recFileName=NULL$

recFileName=6 ;* PDF

recFileName=c:\temp\foo.pdf'

recPrintInfo=NULL$

recPageInfo=NULL$

recPageSetup=NULL$

recPrintSetup=NULL$

recPrintSetup=2

recPrintCharMap=NULL$

recPrintDevice=NULL$

set_printer("INIT", recFileName, recPrintInfo, recPageInfo, recPageSetup, recPrintSetup, recPrintDevice, recPrintCharMap)

for x=1 to 40

set_printer('TEXT',x)

next x

set_printer('TERM')

return


At 06 NOV 2006 12:53PM dsig@sigafoos.org wrote:

it appears that the hang had something to do with the printer being set to offline.

So problem exists ..

if i use this line

recPrintSetup=2

in the program .. it goes to preview as you would expect

if i comment that line out it goes directly to the printer .. NOT TO the pdf file

I am not sure why i got the rtf file .. must have been some other testing i was doing at exactly the same date/time

Any ideas why it is not going to the pdf file?

thanks


At 06 NOV 2006 01:13PM Sean FitzSimons wrote:

Dave,

True. This goes back to what Bob Orsini said above:

If you are using option 6 in the export file you must make sure the printer option is set to 2 for preview. It will not work if the init is directed to the printer.

You cannot go directly to the printer and create a pdf file.

Sean


At 06 NOV 2006 02:59PM Karen Oland wrote:

I use:

recFileName=whatever my title is"

recFileName=1 ;* hide printing window

recFileName=3 ;* hide preview window

recFileName=6

recFileName=c:\temp\foo.pdf'

works every time. The pgm I checked prints invoices - either to preview screen or to a pdf file, depending on the passed in parameters. Code is called via buttons (one reprints to viewer, other creates a temp PDF file, then emails it).

My default printer is not directly connected, so never offline … Perhaps that may be an issue.


At 06 NOV 2006 06:33PM dsig@sigafoos.org wrote:

When i asked .. 'what params do i need to simply pdf directly to the file?'

you replied with 'In the first parameter for the INIT message, fieldmark 3 should be a 6 and fieldmark 4 should be the path & filename.'

which would lead me to believe that i would only need those 2 params .. that is not the case.

you MUST also have

PrintSetup =5 ;* specific location

printSetup =1 ;* minimize the ?process?

thanks


At 06 NOV 2006 06:48PM dsig@sigafoos.org wrote:

thanks for that .. not sure how that works without param 5 set to

5:@vm:@vm:1

using your code i can't get it to work .. I don't believe that the first param has multivalue item in field 1

thanks again

dsig


At 07 NOV 2006 12:06AM Kauko Laurinolli wrote:

So amny answers. This INIT string works and is in daily use.

Page =0.6 ;* Left Margin .6

Page=0.6 ;* Top margin .6

Page=0.1 ;* Right margin .1

Page=0.6 ;* Bottom margin .6

Page=' ;* Page Width in inches

Page=' ;* Page Height in inches

Page=1 ;* Pagesize Letter=1

Page=1 ;* Number of copies=1

PageSetup = 0 ;* 0=portrait, 1=landscape

PageSetup=1 ;* Units, 1=inches, 2=mm

PrintSetup = 5 ;* Specific location

PrintSetup= 1 ;* Hide printing window=1

PrintSetup= 0 ;* Startmode normal=0

PdfFilename =Printing'

PdfFilename=' ;* Load RTF

PdfFilename=6 ;* Export format 6=PDF

PdfFilename=Ouput.pdf' ;* Export filename

Title=Test"

rv=Set_Printer("INIT",PdfFilename,Title,Page,PageSetup,PrintSetup)


At 07 NOV 2006 10:40AM dsig@sigafoos.org wrote:

Kauko ..

as you say .. so many answers .. funny how some of them just didn't work

as i asked 'what params do i need to simply pdf directly to the file?'

Simple answer

param1=6

param1=pdf file name.location'

param5=5

param5=1

This appears to be all that is needed ..

thanks


At 08 NOV 2006 04:16PM dsig@sigafoos.org wrote:

as mentioned else where .. to force printing directly to PDF these are the params needed ..

param1=6

param1=pdf file name.location'

param5=5

param5=1

Why does the param5 have to be set to HIDE. why can't the message window be displayed?

is this something that can be *corrected* or is it a problem with vsprinter?

thanks


At 08 NOV 2006 05:04PM Sean FitzSimons wrote:

Dave,

param1=6

param1=pdf file name.location'

param5=5 or could be 2,3,4

param5=1 - only if you want to hide the display of the window. If you want to see the preview leave it off.

So you need param1 and param1 and param5 needs to be anything but the printer options. The display options are ok.

Sean


At 08 NOV 2006 07:37PM dsig@sigafoos.org wrote:

can you drop me a note off line ..

thanks


At 10 NOV 2006 07:46AM Bob Orsini wrote:

Since there seems to be so must confusion on this let me clarify. The OCX will not export any data unless the preview window is available and has the report. Does not matter wether you use a 5 or a 2 in the preview option. The preview must be available since the pdf works off the preview. Must options are 1, 1 and 5 must define a preview and not the printer. All other options are irrevelant.


At 10 NOV 2006 02:03PM Karen Oland wrote:

Not sure why either, but since it ain't broke, I'm not fixing it….

If you mean the 5th parameter to set_printer, view mode, then it is set to 4 plus some other values (none of which get used, as the viewer is hidden). I almost never set it to any value other than 0 (for direct to printer, for our check printing) or 4/0/1/2/1/7|-1 (where /=@VM,|=@FM).

And yes, when trying to cut and paste to work in example, I grabbed two values that went in field 5, not 1 (recFileName and recFileName override the default 4… setting above, which was 1/2, not 1/3)


At 10 NOV 2006 02:05PM Karen Oland wrote:

Except that

param5=5

isn't needed either – it can be

param5=4


At 10 NOV 2006 02:08PM Karen Oland wrote:

, 1 and 5 must define a preview and not the printer. All other options are irrevelant. ]]

Which is what I found long ago .. I use 2 in param5 (and hide the window by preference).

For those that don't want users confused by the preview window flashing up (or worse, have the users close it while the report is generating), hiding the preview can be important. I hide it completely so it doesn't even pop up on the task bar.


At 10 NOV 2006 07:09PM dsig@sigafoos.org wrote:

worked out exactly what we needed with sean and put a request for enhancement in the tracker

thanks

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/eb350f29fad99c768525721c005b9176.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1