× 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.



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....


As an Amazon Associate we earn from qualifying purchases.

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-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.