You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2021/07/31 09:38:22 UTC

[Bug 65478] New: DeferredSXSSFWorkboot not working cellStyle

https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

            Bug ID: 65478
           Summary: DeferredSXSSFWorkboot not working cellStyle
           Product: POI
           Version: unspecified
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: major
          Priority: P2
         Component: SXSSF
          Assignee: dev@poi.apache.org
          Reporter: silver0r@naver.com
  Target Milestone: ---

Hello, PIO Team

I heared Apache POI 5.0.0 version upgrade and apply DeferredSXSSFWorkbook. I
really wanted this and it's powerful.

When I apply DeferredSXSSFWorkbook, I found some bug.

When applying a cellStyle based on DeferredSXSSFWorkbook, it's not working and
an error occurs when the excel file is opened.
(Also SXSSFWorkbook is working for me)


DeferredSXSSFWorkbook workbook = new DeferredSXSSFWorkbook(500);
DeferredSXSSFSheet deferredSXSSFSheet = workbook.createSheet();

deferredSXSSFSheet.setRowGenerator(sheet -> {
    Row row = sheet.createRow(0);
    Cell cell = row.createCell(0);
    CellStyle cellStyle = workbook.createCellStyle();
    cellStyle.setAlignment(HorizontalAlignment.RIGHT);

    cell.setCellStyle(cellStyle);
    cell.setCellValue("test");
});

workbook.write(response.getOutputStream());


Could you check it? TYSM.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65478] DeferredSXSSFWorkboot not working cellStyle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

--- Comment #4 from silver0r <si...@naver.com> ---
(In reply to PJ Fanning from comment #3)
> I have updated the example at
> https://github.com/apache/poi/blob/trunk/poi-examples/src/main/java/org/
> apache/poi/examples/xssf/streaming/DeferredGeneration.java to show the cell
> style creation. You can only add 1 row generator per sheet.

thanks for your kind
I'll try it :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65478] DeferredSXSSFWorkboot not working cellStyle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INFORMATIONPROVIDED

--- Comment #5 from Dominik Stadler <do...@gmx.at> ---
This is answered via an enhanced example as far as I see.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65478] DeferredSXSSFWorkboot not working cellStyle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
the row generator is designed for generating rows - can you create the style
outside the row generator function?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65478] DeferredSXSSFWorkboot not working cellStyle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

--- Comment #2 from silver0r <si...@naver.com> ---
(In reply to PJ Fanning from comment #1)
> the row generator is designed for generating rows - can you create the style
> outside the row generator function?

TYSM your comment

How can I create the cell style outside the row generator?
It would be of great help if you could provide a simple example.

and I have question. Can I make multiple row generator function in one xlsx
file?

TYSM

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 65478] DeferredSXSSFWorkboot not working cellStyle

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=65478

--- Comment #3 from PJ Fanning <fa...@yahoo.com> ---
I have updated the example at
https://github.com/apache/poi/blob/trunk/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java
to show the cell style creation. You can only add 1 row generator per sheet.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org