× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The POI FAQ addresses this at http://poi.apache.org/faq.html

Pay particular attention to #15

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Fear of becoming a has-been keeps some people from becoming anything."
-- Eric Hoffer
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of tim
Sent: Thursday, August 27, 2009 10:13 AM
To: 'RPG programming on the IBM i / System i'
Subject: Scotts HSSFR4 and "too many different cell formats" error

I am using Scotts HSSFR4 to create an excel sheet via RPG. When I open
the
created sheet in excel 2007, it looks fine. When I open it in Excel
2003, I
get the following errors:

"Too many different formats"

"Excel encountered an error and had to remove some formatting to avoid
corrupting the workbook. Please re-check your formatting carefully"

Any ideas on how to fix this?

Thanks.

Sample code:
col# = 0;
HSSFCellStyle = HSSFWorkbook_createCellStyle(HSSFWorkbook);
HSSFDataFormat = HSSFWorkbook_createDataFormat(HSSFWorkbook);
jString = new_String('######');
NumFmt = HSSFDataFormat_getFormat(HSSFDataFormat : jString );
HSSFCellStyle_setAlignment(HSSFCellStyle :ALIGN_Center);
HSSFCellStyle_setBorderBottom(HSSFCellStyle :border_thin);
HSSFCellStyle_setBordertop(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderleft(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderright(HSSFCellStyle :border_thin);
HSSFCell = HSSFRow_createCell(hssfRow:col#);
HSSFCell_setCellType(hssfcell: CELL_TYPE_NUMERIC);
HSSFCell_setCellStyle(hssfcell: HSSFCellStyle);
HSSFCell_setCellValueD(hssfcell: p5cl);

col# = 1;
HSSFCellStyle = HSSFWorkbook_createCellStyle(HSSFWorkbook);
HSSFDataFormat = HSSFWorkbook_createDataFormat(HSSFWorkbook);
jString = new_String('m/d/yyyy');
NumFmt = HSSFDataFormat_getFormat(HSSFDataFormat : jString );
HSSFCellStyle_setDataFormat(HSSFCellStyle :NumFmt);
HSSFCellStyle_setAlignment(HSSFCellStyle :ALIGN_center);
HSSFCellStyle_setBorderBottom(HSSFCellStyle :border_thin);
HSSFCellStyle_setBordertop(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderleft(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderright(HSSFCellStyle :border_thin);
HSSFCell = HSSFRow_createCell(hssfRow:col#);
HSSFCell_setCellType(hssfcell: CELL_TYPE_NUMERIC);
HSSFCell_setCellStyle(hssfcell: HSSFCellStyle);
julian = %DIFF ( cl_t : d'01/01/1900' : *DAYS) + 2;
HSSFCell_setCellValueD(hssfcell: julian);

col# = 2; // Appr
HSSFCellStyle = HSSFWorkbook_createCellStyle(HSSFWorkbook);
HSSFDataFormat = HSSFWorkbook_createDataFormat(HSSFWorkbook);
HSSFCellStyle_setAlignment(HSSFCellStyle :ALIGN_center);
HSSFCellStyle_setBorderBottom(HSSFCellStyle :border_thin);
HSSFCellStyle_setBordertop(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderleft(HSSFCellStyle :border_thin);
HSSFCellStyle_setBorderright(HSSFCellStyle :border_thin);
HSSFCell = HSSFRow_createCell(hssfRow:col#);
HSSFCell_setCellType(hssfcell: CELL_TYPE_STRING);
HSSFCell_setCellStyle(hssfcell: HSSFCellStyle);
if c_c = 'Y';
jString = new_String(%trim( 'O' ));
else;
jString = new_String(%trim( '3' ));
endif;
HSSFCell_setCellValueStr(hssfcell: jString);



Etc for several columns....

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.