Hi everyone

We have a V7R2 server running POI 3.15.

I have a problem with the POI 3.15 functions of SetRepeatingRows and
SetRepeatingColumns. When I set in in my RPG program, it messes up the
printing part, by causing the columns to be squashed. In the program I am
forcing the document to "fit everything on one page wide", but instead of
the 6 columns to be printed, it now has around 7 or 8 empty additional
columns more to print, causing the squashing of the printout.

The ironic part is that the repeating headers rows and columns are
actually
working correctly and showing correctly inside Excel, but somehow the
columns now become squashed on printing. I suspect the problem is caused
when I use a cellrangeaddress with the functions, as the document now
seems
to think it has to include more columns as part of print region, but that
is
just a guess.

Here is the prototypes for both Java items:

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* SSSheet_SetRepeatingRows;
* Set Repeating rows
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D SSSheet_setRepeatingRows...
D PR EXTPROC(*JAVA
D : SHEET_CLASS
D : 'setRepeatingRows')
DRowRange like(CellRangeAddress) const

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* SSSheet_SetRepeatingColumns
* Set Repeating Columns
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D SSSheet_setRepeatingColumns...
D PR EXTPROC(*JAVA
D : SHEET_CLASS
D : 'setRepeatingColumns')
DColumnRange like(CellRangeAddress) const

Here is my prototype where I call the two Java POI prototypes in the
program:

dcl-proc ss_SetRepeatingHeaders;
dcl-pi ss_SetRepeatingHeaders;
peSheet like(HSSFSheet);
peRowFrom like(jint) value;
peRowTo like(jint) value;
peColFrom like(jshort) value;
peColTo like(jshort) value ;
End-Pi;
dcl-s myRegion like(CellRangeAddress);
//
myRegion = new_CellRangeAddress( peRowFrom
: peRowTo
: peColFrom
: peColTo);
ssSheet_setRepeatingRows(sheet:myRegion);
ssSheet_setRepeatingColumns(sheet:MyRegion);
hssf_freeLocalRef(myRegion);
end-proc;

And here is the actual program call, where the Excel file is generated:

// Force the page to print one page wide.
SSSheet_SetFitToPage(sheet:*On);
ps = SSSheet_getPrintSetup(sheet);
HssfPrintSetup_setLandscape(ps:*off);
SSPrintSetup_setFitHeight(ps:0);
SSPrintSetup_setFitWidth(ps:1);
SSSheet_Setmargin(Sheet:MARGIN_LEFT:0.5);
SSSheet_Setmargin(Sheet:MARGIN_RIGHT:0.5);
ss_SetRepeatingHeaders(Sheet:RowCount:RowCount:0:5);

Any help would be greatly appreciated.

Thanks

Pieter



This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].