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



 
In the code example below, (b)  my widths ( intWidth ) corresponds with the maximum character width.  But when I open the spread sheet and select a field that was formatted with a style below (a) the field is maxed out to 256.  My numeric fields, are just fine as  I use the
technic below (c).  Isn't there an attribute on the sheet that can be set to enable autosize to work for all columns to accomodate users wishing to manully resize a column without that column expanding to the width of their screen? Do I need to create a data format for all the text fields similar to what I did for the numeric fields?
 
Thanks,
Erick
 
 
(a) styNormal = HSSFWorkbook_createCellStyle(book); HSSFCellStyle_setAlignment(styNormal: ALIGN_LEFT);
 
 
(b)
  IfintRow = 0;
      HSSFSheet_SetColumnWidth( sheet : intCol : intWidth * 256 );
      HSSFSheet_autoSizeColumn(sheet : intWidth );   
 
 
(c)/ styNumeric0 = HSSFWorkbook_createCellStyle(book);/ DataFmt = HSSFWorkbook_createDataFormat(book);/ Str0 = new_String('#,##0');/ NumFmt = HSSFDataFormat_getFormat(DataFmt: Str0);/ HSSFCellStyle_setDataFormat(styNumeric0: NumFmt);/ HSSFCellStyle_setAlignment(styNumeric0: ALIGN_RIGHT);
 EndIf;I am attempting to format my colums so that that they will not only display the cells in a presentable way, but also so that if an attempt is made to manully autosize a column by a user that column will then size to the maxium width of the widest value.

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.