poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From muhammad.soh...@ext.mpsa.com
Subject Problem Renaming Print Area in French Excel
Date Fri, 22 Feb 2008 17:02:22 GMT


Hi,

I am using POI version 3.0.1 Final and I am generating an Excel file.
During generation, I set Print Area using the function of HSSFWorkbook
which takes row & column numbers (pointers).
And then I try to open this file in MS Excel 2003 SP2 in French Locale
(i.e, After changing Regional Parameters (placement) to "French (France)"
and Menus & dialog boxes to "fran├žais" in Regional Settings of Windows 2000
Pro)

The following message appears (picture inline):

(Embedded image moved to file: pic06241.jpg)

Which means:
Name already in use
The name must not be same to a predefined name
Previous name: Zone_d_impression (Print_Area in english)
New name: <text_box>

After I give whatever name in the text box, I can open Excel, but looses
the print area settings that I have made (The range that I set earlier
remains with the new name that I have given, but I suppose since its not
same as should be the name for the range of print area, it is simply
considered as another named range and not taken into account in print
setup).

I have also tested the code with POI version 3.0.2 Final, but the problem
remains the same.

But the problem is not that simple.

   Firstly, as I am generating Excel which contains many sheets with
   different data, the problem occurs only with one particular sheet. All
   the rest of the sheets works fine and there is no problem with print
   area for them. If I generate Excel making sure that I don't set print
   area for that particular sheet, everything goes well. However, I am
   unable to verify what is difference between this sheet and the rest of
   the sheets. Even if I pass same parameters (i.e, same column and row
   numbers) to the HSSFWorkbook.setPrintArea() for all sheets, this problem
   remains.

   Secondly, I am also generating Repeating Headers in print setup, more
   precisely Row & Columns to be repeated for every page to be printed for
   a sheet. If I don't set print area for all sheets, the same problem
   (renaming problem) appears for repeating headers. This time name is:
   Impression_des_Titres (or in English: Print_Titles). Problems remains
   with the same sheet. Removing repeating headers does not solve print
   area problem.

   And last but not the least, when the same file is opened in English (US)
   Locale, there is no problem while opening and neither in print setup.

Few interesting remarks:

   When I try to set print area for less number of sheets, its not that
   previously mentioned particular sheet that poses problem anymore, this
   time the renamed area is found under some other sheet.

   If I set print area for only one sheet, it can be any sheet, without any
   problem. But when I try to apply print area setup on more than 1 sheet,
   then they should be only 1st till 13th sheets. Adding any sheet other
   than these will cause the problem.

If someone can help me out in this regard, it would be really appreciated.

Mime
View raw message