CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: POI and setting cells to VerticalAlignment.MIDDLE

  1. #1
    Join Date
    Aug 2008

    Question POI and setting cells to VerticalAlignment.MIDDLE

    Hey all I am trying to get my cell to vertical line instead of just being aligned by the left side using POI.

    This is my java code:
    static CellStyle headerCellStyle    = workbook.createCellStyle();
    headerCellStyle = workbook.createCellStyle();
    Row headerRow   = null;        
    sheet           = workbook.createSheet("String " + sheetname);
    // Create a Row
    headerRow   = sheet.createRow(0);
    However, the line headerCellStyle.setVerticalAlignment(VerticalAlignment.MIDDLE); has an error of:

    The method setVerticalAlignment( in the type CellStyle is not applicable for the arguments (

    How can i go about getting this to work if I have already defined it as an static CellStyle headerCellStyle = workbook.createCellStyle();?

  2. #2
    Join Date
    Oct 2019

    Re: POI and setting cells to VerticalAlignment.MIDDLE

    There's nothing wrong with your code. Strange.. maybe that's some other problem...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)