poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karim Ratib" <kra...@open-craft.com>
Subject Re: XSSF: calling XSSFWorkbook.createName() corrupts output
Date Sat, 13 Dec 2008 17:29:50 GMT
Thanks for your reply. Indeed, the name and reference need to be set.
In addition, it seems the sheet name must be set in the reference
because

name.setRefersToFormula("$E$11");

will create a file that Excel Viewer (with which I am testing my
output) won't open.

On Sat, Dec 13, 2008 at 4:30 AM, Yegor Kozlov <yegor@dinom.ru> wrote:
>> If I take the "New, generic SS Usermodel Code" at
>> http://poi.apache.org/spreadsheet/converting.html and add to it the
>> following section:
>>
>> wb.createName();
>>
>> right after
>>
>> Workbook wb = wbs[i];
>>
>> then the output workbook.xlsx cannot be opened by Excel.
>>
>> Am I doing something wrong with the name?
>
> When creating names, you are supposed to set the name name and the
> reference:
> Name name = wb.createName();
> //the following two lines are required:
> name.setNameName("unique_id");
> name.setRefersToFormula("'Sheet1'!$E$11");
>
> Yegor
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
>

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


Mime
View raw message