open-insight/SYSPROG/STPROC/OIPI_PIECHART_EXAMPLE.txt
2024-03-25 15:17:34 -07:00

45 lines
1.2 KiB
Plaintext

Subroutine OIPI_Piechart_Example(void)
Declare Function Set_Printer
$Insert COLORS
$insert OIPI_EQUATES
$Insert OIPI_PIECHART_EQUATES
* Start the OIPI report with the INIT message
FileName = "OIPI_PIE_Example1"
PrintTitle = "OIPI Printing..."
PreviewTitle = "OIPI Pie Chart Preview"
Margins = .5:@FM:.5:@FM:.5:@FM:.5 ;* half inch margins On the sides, one inch margins On the top
Orientation = Portrait$
PrintSetup = ""
PrintSetup<Print_Style$, 1> = Preview_normal$
PrintSetup<Print_Style$, 2> = Display_AllButtons$
PrintSetup<2> = -1 ;* Set initial zoom to PageWidth
PrintSetup<3> = 5 ;* Set the Print Preview position at 5% from top and left
PrintSetup<4> = 5
PrintSetup<5> = 95
PrintSetup<6> = 95
VAL = Set_Printer("INIT", FileName, PrintTitle:@FM:PreviewTitle, Margins, Orientation, PrintSetup)
if VAL < 0 then
* Always check the return value of the INIT message for error
ErrorMsg = "Fatal error with the INIT message:":VAL
Return ''
end
colors = ""
colors = Red$ :@fm: Blue$ : @fm : ORANGE$ : @fm: MAGENTA$
wedges = ""
wedges = 27:@fm:13:@fm:18:@fm:30
rslt = oipi_piechart_helper(2,2,1,wedges, colors, LEGEND_DEFAULTS$)
X = Set_Printer('TERM')
Return ''