Skip to Content
author's profile photo Former Member
Former Member

Wrap column in Excel

does anyone know how to wrap column in excel?

i'm trying to export data from dynpro to excel, but i can't find appropriate method to wrap text in a column.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Jul 13, 2007 at 04:47 AM

    Hi Oscar Wijaya ,

    <i>Try this coding itis working warp text ,</i>

    <b>try

    {

    WritableWorkbook wr=Workbook.createWorkbook(new File("c:
    wbook.xls"));

    WritableSheet ws=wr.createSheet("First sheet",0);

    WritableCellFormat integerFormat = new WritableCellFormat();

    integerFormat.setWrap(true);

    Label l1=new Label(0,0,"Hai");

    Label l2=new Label(0,1,"Hai wgfjahkdfba");

    l2.setCellFormat(integerFormat);

    ws.addCell(l1);

    ws.addCell(l2);

    wr.write();

    wr.close();

    }

    catch(Exception e)

    {

    System.out.println("ERROR");

    }</b>

    Regards,

    Boopathi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 04:39 AM

    In the code

    after getting the data ..say

    data = wdContext.currentListaElement().getfirstcolumn().....

    place this as the argument for the cell...as shown

    sheet.addCell(new Label(0,0,"data"));

    Label(row,column,data)....is the format.

    and finally

    workbook.write();

    If this does not work out check these links...

    http://www.andykhan.com/jexcelapi/tutorial.html#writing

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 03:21 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 13, 2007 at 03:54 AM
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      thanks again for your reply. but i need method that can be used in java NWDS.

      i have try this :

      WritableSheet sheet = workbook.createSheet("test",0);

      WritableCellFormat c = new WritableCellFormat();

      c.setWrap(true);

      sheet.setColumnView(1,10,c);

      it won't wrap the text. any idea?

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.