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



More of a curiosity than a call for help.
We are using POI and Scott Klement's HSSFR4 to generate excel workbooks from RPG.
Recently decided to implement XSSF instead of HSSF.
We had setup a CellStyle using the Accounting format without the currency symbol.

TempStr = new_String('_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)');
NumFmt = SSDataFormat_getFormat(DataFmt: TempStr);
SSCellStyle_setDataFormat(Accounting0: NumFmt);

In .XLS and HSSF the format would show 12345 as "12,345". - perfect.

When we changed from HSSF and .xls to XSSF and .xlsx 12345 shows up as "$ 12,345". - Not perfect.
Excel shows the formatting as: "'_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)" (Note the "$")

I had to change the formatting to this:
TempStr = new_String('#,##0_);(#,##0)');
NumFmt = SSDataFormat_getFormat(DataFmt: TempStr);
SSCellStyle_setDataFormat(Accounting0: NumFmt);

Now Excel sees the cell as formatted as a number: "'#,##0_);(#,##0)"

Paul
+++++ This email and related attachments may contain confidential information intended exclusively for the addressee. Unauthorized use, disclosure or distribution of this material is prohibited. If you received this message in error, please advise the sender and delete all copies of it. Content is provided by the individual sender and does not necessarily reflect the views of the Company. Though sender believes this transmission to be virus-free, it is the recipient's responsibility to ensure that it is.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.