You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Roger Misteli <ro...@abacus.ch> on 2004/07/01 19:42:42 UTC

Re[2]: Uhm.. Bug with HSSFRow.setHeight??

Well.. none, as the sample beyond states. I simply "unhide" them inside
Excel (select the rows and in the context menu, click "unhide").

Regards,
ROg
On Thu, 01 Jul 2004 12:46:38 -0400
Danny Mui <da...@muibros.com> wrote:

> what height do you set to unsupress :)
> 
> Roger Misteli wrote:
> 
> > Hiyas POI team
> > 
> > I think there is a bug in HSSFRow.setHeight. When I use this code:
> > 
> >   private static final short SUPRESS_HEIGHT = 0;
> > 
> >   public static void main(String[] args) {
> >     HSSFWorkbook book = new HSSFWorkbook();
> >     HSSFSheet sheet = book.createSheet();
> >     for (int i=0; i<100; i++)
> >       sheet.createRow(i);
> >     for (int i=10; i<20; i++)
> >       sheet.getRow(i).setHeight(SUPRESS_HEIGHT);
> >     try {
> >       FileOutputStream fos = new FileOutputStream("c:\\test.xls");
> >       book.write(fos);
> >       fos.close();
> >     }
> >     catch (Exception e) { e.printStackTrace(); }
> >   }
> > 
> > The generated XLS file does indeed contain 10 rows which are hidden.
> > However, if I "unhide" those ten rows, they suddenly grow huge.
> > According to Excel, the row height for each of the ten is then 409. 
> > I use a special version of POI 2.5 but I can verify it with the normal
> > 2.5 and 2.0 as well.
> > 
> > Maybe I overlooked something, but I don't see what I did wrong. The real
> > world example I use is more complex, but this sample shows the problem.
> > 
> > Regards,
> > Rog
> > 
> > /*
> >  * Roger Misteli - ABACUS Research AG
> >  * email: roger.misteli@abacus.ch (PGP key available)
> >  * "If you think the problem is bad now, just wait until we've solved it."
> >  */
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org


//-----------------------------------
// Roger Misteli - ABACUS Research AG
// email: roger.misteli@abacus.ch
// To boldly stay where everyone went before


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re[2]: Uhm.. Bug with HSSFRow.setHeight??

Posted by Roger Misteli <ro...@abacus.ch>.
No, via Excel. Let the test code run, open the XLS file inside Excel and
inside Excel, you see what rows are hidden (10 to 19), so click on Row 9
and 20 and mark both rows (which are right now hidden) then right click.
In the context menu that appears, you can hide/unhide rows. Choose
unhide and you see what I mean :-)

Regards,
Rog

On Thu, 01 Jul 2004 17:07:17 -0400
Danny Mui <da...@muibros.com> wrote:

> well when u say "unhide", didn't quite get what you meant.  didn't know 
> if you were setting it via code or excel.
> 
> can you do a biffviewer on an excel hidden row to see what the heights 
> are?  maybe 0 is no the correct value or it stores the "old" height 
> somewhere.
> 
> add this to bugzilla so we dont lose this.
> 
> Roger Misteli wrote:
> 
> > Well.. none, as the sample beyond states. I simply "unhide" them inside
> > Excel (select the rows and in the context menu, click "unhide").
> > 
> > Regards,
> > ROg
> > On Thu, 01 Jul 2004 12:46:38 -0400
> > Danny Mui <da...@muibros.com> wrote:
> > 
> > 
> >>what height do you set to unsupress :)
> >>
> >>Roger Misteli wrote:
> >>
> >>
> >>>Hiyas POI team
> >>>
> >>>I think there is a bug in HSSFRow.setHeight. When I use this code:
> >>>
> >>>  private static final short SUPRESS_HEIGHT = 0;
> >>>
> >>>  public static void main(String[] args) {
> >>>    HSSFWorkbook book = new HSSFWorkbook();
> >>>    HSSFSheet sheet = book.createSheet();
> >>>    for (int i=0; i<100; i++)
> >>>      sheet.createRow(i);
> >>>    for (int i=10; i<20; i++)
> >>>      sheet.getRow(i).setHeight(SUPRESS_HEIGHT);
> >>>    try {
> >>>      FileOutputStream fos = new FileOutputStream("c:\\test.xls");
> >>>      book.write(fos);
> >>>      fos.close();
> >>>    }
> >>>    catch (Exception e) { e.printStackTrace(); }
> >>>  }
> >>>
> >>>The generated XLS file does indeed contain 10 rows which are hidden.
> >>>However, if I "unhide" those ten rows, they suddenly grow huge.
> >>>According to Excel, the row height for each of the ten is then 409. 
> >>>I use a special version of POI 2.5 but I can verify it with the normal
> >>>2.5 and 2.0 as well.
> >>>
> >>>Maybe I overlooked something, but I don't see what I did wrong. The real
> >>>world example I use is more complex, but this sample shows the problem.
> >>>
> >>>Regards,
> >>>Rog
> >>>
> >>>/*
> >>> * Roger Misteli - ABACUS Research AG
> >>> * email: roger.misteli@abacus.ch (PGP key available)
> >>> * "If you think the problem is bad now, just wait until we've solved it."
> >>> */
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: poi-user-help@jakarta.apache.org
> > 
> > 
> > 
> > //-----------------------------------
> > // Roger Misteli - ABACUS Research AG
> > // email: roger.misteli@abacus.ch
> > // To boldly stay where everyone went before
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org


//-----------------------------------
// Roger Misteli - ABACUS Research AG
// email: roger.misteli@abacus.ch
// To boldly stay where everyone went before


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Re: Uhm.. Bug with HSSFRow.setHeight??

Posted by Danny Mui <da...@muibros.com>.
well when u say "unhide", didn't quite get what you meant.  didn't know 
if you were setting it via code or excel.

can you do a biffviewer on an excel hidden row to see what the heights 
are?  maybe 0 is no the correct value or it stores the "old" height 
somewhere.

add this to bugzilla so we dont lose this.

Roger Misteli wrote:

> Well.. none, as the sample beyond states. I simply "unhide" them inside
> Excel (select the rows and in the context menu, click "unhide").
> 
> Regards,
> ROg
> On Thu, 01 Jul 2004 12:46:38 -0400
> Danny Mui <da...@muibros.com> wrote:
> 
> 
>>what height do you set to unsupress :)
>>
>>Roger Misteli wrote:
>>
>>
>>>Hiyas POI team
>>>
>>>I think there is a bug in HSSFRow.setHeight. When I use this code:
>>>
>>>  private static final short SUPRESS_HEIGHT = 0;
>>>
>>>  public static void main(String[] args) {
>>>    HSSFWorkbook book = new HSSFWorkbook();
>>>    HSSFSheet sheet = book.createSheet();
>>>    for (int i=0; i<100; i++)
>>>      sheet.createRow(i);
>>>    for (int i=10; i<20; i++)
>>>      sheet.getRow(i).setHeight(SUPRESS_HEIGHT);
>>>    try {
>>>      FileOutputStream fos = new FileOutputStream("c:\\test.xls");
>>>      book.write(fos);
>>>      fos.close();
>>>    }
>>>    catch (Exception e) { e.printStackTrace(); }
>>>  }
>>>
>>>The generated XLS file does indeed contain 10 rows which are hidden.
>>>However, if I "unhide" those ten rows, they suddenly grow huge.
>>>According to Excel, the row height for each of the ten is then 409. 
>>>I use a special version of POI 2.5 but I can verify it with the normal
>>>2.5 and 2.0 as well.
>>>
>>>Maybe I overlooked something, but I don't see what I did wrong. The real
>>>world example I use is more complex, but this sample shows the problem.
>>>
>>>Regards,
>>>Rog
>>>
>>>/*
>>> * Roger Misteli - ABACUS Research AG
>>> * email: roger.misteli@abacus.ch (PGP key available)
>>> * "If you think the problem is bad now, just wait until we've solved it."
>>> */
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: poi-user-help@jakarta.apache.org
> 
> 
> 
> //-----------------------------------
> // Roger Misteli - ABACUS Research AG
> // email: roger.misteli@abacus.ch
> // To boldly stay where everyone went before
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: poi-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org