OIPI and reports (OpenInsight 32-bit Specific)
At 10 MAR 2003 10:13:10AM Kauko Laurinolli wrote:
1. I have dozens of very long and complicated AREV reports I need to run in OI 4.1.3.
What is the best way to do this to import these to OI?
Two OIPI sample I can find in doc's are only static programs which suppose to print the same page again and again except they bum out with INIT error after the 1st print.
I haven't been able to find any other dynamic samples which print reports out of the tables.
2. Does anybody know some aftermarket OI documentation there which would fill in the enormous gaps in OI documentation?
At 10 MAR 2003 12:37PM Donald Bakke wrote:
Kauko,
You have a few options available, two that I would seriously consider. Which one you choose will depend on what your primary goals are:
1.) If you want to convert these reports into true Windows reports whereby you can use fonts, graphics, on-screen preview, ability to output to fax, pdf, html, rtf, etc., then you need to re-write these using the OIPI. While you will have to do some work to achieve this, using the OIPI Basic+ commands does allow you to reuse the flow and structure of your original reports.
2.) If true Windows printing is not a concern and you primarily want to bring these reports into OpenInsight in the cleanest and most efficient way possible then you need to purchase Direct Print from Splaver Software. This slick little utility allows you to output direct to the printer port so you can reuse all of your legacy AREV print code…including PCL commands or any string that requires embedded ESC sequences. AREV code can be copied directly into an OpenInsight routine and with a few find/replace commands you can pretty much be ready to print your reports in OpenInsight.
dbakke@srpcs.com
At 10 MAR 2003 01:00PM jhenry wrote:
Kauko,
Following code fragments illustrate use of OIPI in AREV or OI generated reports (using the 'SX' option from R/List). If you have used the RLIST 'SX' function to generate basic programs, you will recognize many of the routine and variable names. The PrintTable section handles printing column headers and page breaks.
This fragment sets up report title and column headers for body of report:
………
stat=Set_Printer("INIT",FileName,Title,Margins,PageSetup,PrintSetup,PrintPath)
IF stat ='
font=Arial'
font=10'
font=1 ;* Bold
stat=Set_Printer("FONTHEADFOOT", font)
stat=Set_Printer("HEADER",Header)
footer= 'D' 'T'":@VM:@VM:" Page: 'P'"
colfooter= "
stat=Set_Printer("FOOTER",footer,colfooter)
@RECCOUNT = 0
FirstPass = 1
LastRecord = 0
ReadErr = 0
FirstLine = 1
colHeader =Sched':CRLF$:'Ship Dt' ; colFmt =^1080'
colHeader = 'Cust':CRLF$:'Dock Dt' ; colFmt=^1080'
colHeader = 'Part No':CRLF$:'CustPartNo' ; colFmt=^1440'
colHeader = 'Rev Lvl' ; colFmt=^630'
colHeader = 'SS No' ; colFmt=^900'
colHeader = 'ShipCustNo' ; colFmt=^630'
colHeader = 'Ship Customer Name' ; colFmt= = 'Open Qty' ; colFmt=]1080'
colHeader = 'Po No' ; colFmt=]1440'
colHeader = 'Po Line' ; colFmt=^720'
colHeader = 'Lot/':CRLF$:'Date' ; colFmt=^720'
colHeader = 'Wh Cd' ; colFmt=^720'
colHeader = 'Loc Cd' ; colFmt=^720'
colHeader = 'QOH' ; colFmt=]720'
* Null previous break buckets
Prev.Team='
Last.Team.Break=1
Prev.SchedShipDt='
Last.SchedShipDt.Break=1
* * * * * * *
READRECORD:
* * * * * * *
* Zero Break Flags to False
Team.Break = 0
SchedShipDt.Break = 0
READNEXT @ID ELSE
LastRecord=1END
IF FirstPass AND LastRecord THEN
GOTO BailEND
IF LastRecord THEN GOTO BREAKS
READO @RECORD FROM SchedShipTable,@ID ELSE
stat=Set_Printer('TEXT', 'Read err: ':QUOTE(@ID):' from xyz table.')
GOTO READRECORDEND
@RECCOUNT += 1
………..
First Pass and Break routines look like this:
………..
IF FirstPass THEN
FirstPass=0Header=@VM:'XYZ Company Production Report - Team ':QUOTE(S.Team)Header='font=Arial'font=10'font=1 ;* Boldstat=Set_Printer("FONTHEADFOOT", font)stat=Set_Printer("HEADER",Header)GOTO DETAILEND
* * * * * * *
BREAKS:
* * * * * * *
IF SchedShipDt.Break THEN
stat=Set_Printer('TEXT') ;* Blank lineEND
IF Team.Break THEN
stat=Set_Printer('PAGEBREAK')Header=@VM:'XYZ Company Production Report - Team ':QUOTE(S.Team)Header='font=Arial'font=10'font=1 ;* Boldstat=Set_Printer("FONTHEADFOOT", font)stat=Set_Printer("HEADER",Header)FirstLine=1END
…………..
Detail section and local subroutines for printing line items
* * * * * * *
DETAIL:
* * * * * * *
SchedQty=OCONV(SchedQty,'MD0,')
OpenQty=OCONV(OpenQty,'MD0,')
colData =OCONV(S.SchedShipDt,'D4-')
colData =OCONV(S.CustDockDt,'D4-')
colData =PartNo:CRLF$:CustPartNo
colData =RevLvl:CRLF$:CustRevLvl
colData =SchedShipNo
colData =S.ShipCustNo
colData =ShipCustName
colData =OpenQty
colData =PoNo
colData=PoLine
colData=LotNo
colData=WhCd
colData=LocCd
colData=QOH
GOSUB PrintTable
GOTO READRECORD
* * * * * *
Bail:
* * * * * *
stat=Set_Printer("TERM",1) ;* Terminiate this printing session
IF stat
Test=Get_Printer('POS')
IF Get_Printer('POS') + TableHeight ] 6.50 OR FirstLine THEN
IF NOT(FirstLine) THENstat=Set_Printer('PAGEBREAK')ENDFirstLine=0font=8font=1 ;* Boldstat=Set_Printer('FONT',font,'100')stat=Set_Printer('ADDTABLE',colFmt,colHeader,'',LTGREY$,'',0,7)font=0stat=Set_Printer('FONT',font,fontSpacing)stat=Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',0,7)END ELSE
font=8font=0stat=Set_Printer('FONT',font,fontSpacing)stat=Set_Printer('ADDTABLE',colFmt,'',colData,LTGREY$,'',1,7)END
RETURN
At 10 MAR 2003 01:29PM Kauko Laurinolli wrote:
It all nice and dandy but where do I found a USABLE OIPI sample program.
The ones in help do not even run but one time w/o re-starting OI.
At 10 MAR 2003 01:45PM jhenry wrote:
Kauko,
Are you starting OIPI32 during startup before running the sample routine? The OINSIGHT.INI now contains a couple of flags controlling when OIPI32 gets started and stopped. Check the readme that came with the upgrade for specifics.
John Henry
J.C. Henry & Co., Inc.
At 10 MAR 2003 02:05PM Kauko Laurinolli wrote:
Yes. OIPI32 is running from startup.
At 10 MAR 2003 02:12PM Kauko Laurinolli wrote:
Many thanks.
I will study the code.
At 10 MAR 2003 05:46PM Kevin Revelation wrote:
Kauko,
I responded to your email. Please let me know if you have further questions.
Kevin