OIPI and OI 7.2.1 (OpenInsight 32-bit Specific)
At 19 MAY 2011 04:43:17PM Marty Rosenbloom wrote:
Hi,
I am trying to run a report using SET_PRINTER. The report works fine because I can preview it. What I can't get it to do is print. I don't think that I have OIPI installed. What version of OIPI should I be looking for and how do I install it into OI 7.2.1?
TIA,
Marty
At 19 MAY 2011 05:56PM Richard Bright wrote:
Marty,
For your OI v7.2.1 with OIPI each workstation has to have registered two ocx files -
vsprin7.ocx
vspdf.ocx
Note - with much latere versions of OI this registration is done automatically.
So to register the two ocx files, at the dos command line, in the OI directory type:
regsvr32 vsprint7.ocx (enter)
and similar for vspdf.ocx.If you have already registered the ocx then other issues to look at - are gou using legacy code Start32 / Stop32 (part of initialising OIPI required with early versions of OIPI). This is depreciated code.
Try running a RList report to printer - this uses OIPI.
At 20 MAY 2011 10:23AM Marty Rosenbloom wrote:
Richard,
Thanks for the response. I tried all that you suggested and the only thing that worked is the RList trial. When I went to register the .ocx files I received an error message: "Dll Register Server in vsprint7.ocx failed. Return code was: 0x8002801c." The same for vspdf.ocx. I used "START32/STOP32" to no avail.
Marty
At 20 MAY 2011 10:47AM Bill Caisley wrote:
The error code indicates that you are running either Vista or Win 7.
Type the error code 0x8002801c into Google and you should find the answer.
At 20 MAY 2011 01:29PM Marty Rosenbloom wrote:
Thanks for the info. I am running Windows 7. I checked out the error message and did what was suggested. I then registered the two .ocx files, which now succeeded. I still could not get the report to print. I did try with START32/STOP32 but still no go. I then went to Get_Printer("VERSION") and it showed no version available. Apparently that means that there is no OIPI installed. If that is true, where can it be obtained and how is it installed?
Marty
At 20 MAY 2011 04:10PM Sean FitzSimons wrote:
Marty,
The START and STOP messages have been deprecated. They are no longer necessary. Can you post your code and we can review the issue?
Thanks,
Sean
At 20 MAY 2011 05:00PM Marty Rosenbloom wrote:
Hi Sean,
The variables are calculated earlier in the coding and a debug and a print preview shows that they are correct.
This is a snippet that I shortened somewhat for brevity:
SchedTotals=T_M:@VM:T_B:@VM:…….:K_M" ←——TOTAL PIECES"
Margins=.25:@FM:1:@FM:.25:@FM:.25
HeaderFont1 =Times New Roman,10,C,1,1"
HeaderFont2 =Times New Roman,10,L,1,1"
ColHeaderFont=Times New Roman,7,C,1,0"
ColBodyFont =Arial,8,C,0,0"
ColWidth1=QtyCol1:@VM:QtyCol1……..:@VM:500
ColWidth2=QtyCol2:@VM:QtyCol2……..:@VM:500
ColWidth3=QtyCol2:@VM:QtyCol2……..:@VM:250
Table1=Col 1,Col 2,…….Col n"
HeaderText=@VM:"DAILY WORK SCHEDULE":@VM
Convert "," To @FM In HeaderFont1
Convert "," To @FM In HeaderFont2
Convert "," To @FM In ColHeaderFont
Convert "," To @FM In ColBodyFont
Convert "," To @VM In Table1
PrintSetup=0: @vm: 2: @vm: 0: @vm: 0 :@vm: 1: @vm: 1: @fm: -2
PrinterName='
SET_PRINTER
*Stat=Set_Printer("START32")
Stat=Set_Printer("INIT", "WORK_SCHEDULE", "", Margins, 1, PrintSetup, PrinterName)
Stat=Set_Printer("FONTHEADFOOT", HeaderFont1)
Stat=Set_Printer("FONT", ColBodyFont)
Stat=Set_Printer("HEADER", HeaderText, ColWidth1, Table1)
Stat=Set_Printer("FONT", ColHeaderFont)
Stat=Set_Printer("LINESTYLE", PS_SOLID:@FM:50)
Stat=Set_Printer("ADDTABLE", ColWidth1,"", Table1, "", "", "", TB_ALL)
Stat=Set_Printer("FONT", ColBodyFont)
Stat=Set_Printer("ADDTABLE", ColWidth2,"", MyData, "", "", "", TB_ALL)
Stat=Set_Printer("LINESTYLE", PS_SOLID:@FM:128)
Stat=Set_Printer("ADDTABLE", ColWidth3,"", SchedTotals, "", "", "", 7)
Stat=Set_Printer("TERM")
*Stat=Set_Printer("STOP32")
Hope that I captured enough.
Thanks,
Marty
At 20 MAY 2011 05:04PM Marty Rosenbloom wrote:
I should also mention that I inserted OIPRINT_EQUATES.
At 23 MAY 2011 11:22AM Sean FitzSimons wrote:
Marty,
You mentioned that it was ok when you went to Print Preview, but will not print. Does it print from the preview window?
Are there any error codes being returned from your Set_Printer calls? The Set_Printer function returns an error code if an error was encountered during processing. You can capture the error by:
Stat=Set_Printer("INIT", "WORK_SCHEDULE", "", Margins, 1, PrintSetup, PrinterName)
if stat < 1 then
THERE IS AN ERROR - NEED TO HANDLEend
Sean
At 23 MAY 2011 02:57PM Marty Rosenbloom wrote:
Hi Sean,
I will try what you suggest. When I try to print from the preview, my printer gives me a message that it is out of paper, which is not true as the paper tray is filled. The PDF printing works fine and I can print the PDF. When I try to print directly from SET_PRINTER, nothing happens.
Thanks,
Marty
At 23 MAY 2011 05:38PM Marty Rosenbloom wrote:
Sean,
I did a debug and watched the stat variable. It remained at 1 throughout the SET_PRINTER sequence. The margins are set correctly and I am printing landscape. Is my printer setup variable defined correctly? Is the "INIT" call set up correctly?
Marty
At 24 MAY 2011 08:07AM Richard Bright wrote:
Marty,
Just an 'of the wall' thought: if the text to print runs of the page you might not get anything. As a test of this why not simplify everying eg just print simple text string, nothing else. If this prints - work out from there.
At 24 MAY 2011 09:53AM Marty Rosenbloom wrote:
Richard,
That suggestion wasn't so "off the wall" after all, as I copied and printed the OIPI_EXAMPLE_2 (Invoice). It did print, so now the troubleshooting of my data and setup begins. I will let you know what I find.
Thanks,
Marty
At 26 MAY 2011 10:18AM Marty Rosenbloom wrote:
It seems as if the calculation of "MyData" was the culprit. I re-wrote all the coding and now it is working correctly.
Thanks!!!!