You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Hans Maulwurf <ha...@gmail.com> on 2012/10/02 20:13:37 UTC

Writing xls under Ubuntu, problem opening under Windows

Hey,

I moved from Windows to Ubuntu and I've a problem with apache poi hssf. I'm
creating an (empty or filled, doesn't matter) workbook and save it as .xls.
ThenI try to open it under a Windows machine and Microsoft Office 2003
says, that there may be some parts damaged. This popup is shown 3 times
(with ok-button) and then it's showing the sheets. I tried Eclipse and
NetBeans, nothing changed. Under Windows I used Eclipse and had no
problems. OpenOffice and LibreOffice don't complain, only Microsoft Office
:(

I don't know why this happenes, while compiling and running the project,
there is no error.

Is this a common problem or what did I wrong?


I hope you can help me,

greetings,

Hans

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
what the hell ... you're right. The empty xls is working fine now ... then
there is only my big project (filled with much data) that shows the error.
I think this means much new typing ;)


2012/10/5 Yegor Kozlov <ye...@dinom.ru>

> Your code is not quite correct, you have to create at least one sheet.
>
> A workbook without sheets is in invalid state. You have to add a sheet
> in order to open it in Excel.
> This rule is true for all versions of Excel .
>
> Yegor
>
> On Thu, Oct 4, 2012 at 12:13 PM, Hans Maulwurf
> <ha...@gmail.com> wrote:
> > I don't understand it ... changing to java6 didn't solve it. I set up a
> new
> > virtual machine Xubuntu and installed openjdk6 and netbeans from
> > repository. I changed nothing, I'm only running these lines
> >
> >     public static void main(String[] args) throws IOException {
> >
> >         HSSFWorkbook wb = new HSSFWorkbook();
> >         FileOutputStream fileOut = new
> > FileOutputStream("/home/muench/workbook_test.xls");
> >         wb.write(fileOut);
> >         fileOut.close();
> >     }
> >
> > But opening the xls under Windows with Microsoft Office it shows the same
> > behaviour ... I don't know how to continue :/
> >
> >
> > 2012/10/4 Hans Maulwurf <ha...@gmail.com>
> >
> >> Maybe the java6 and java7 lead to this behaviour? Under Windows I used
> >> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I
> will
> >> try to switch to java6 and report here.
> >>
> >>
> >> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
> >>
> >>> No, I used the same version of poi on windows, saved the files and used
> >>> it on linux again. Replacing them with fresh downloaded doesn't change
> the
> >>> situation. When compiling/debugging/creating there is no error, only
> >>> opening with Microsoft Office shows this error (about 3 times) and
> then the
> >>> sheets are shown correctly.
> >>>
> >>>
> >>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
> >>>
> >>>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
> >>>>
> >>>>> I'm using poi-3.8-20120326.jar and that's the same I used on
> Windows. I
> >>>>> don't use a '/' in sheetnames, the same error comes when I only
> create a
> >>>>> workbook and save it as xls, without cells or sheets, only the
> default
> >>>>> sheets.
> >>>>>
> >>>>
> >>>> Are you sure that there are no differences in POI versions? Could
> there
> >>>> perhaps be an older version of POI lurking somewhere on your
> classpath?
> >>>> (Check the FAQ for how to find them).
> >>>>
> >>>> I've had no ubuntu-specific POI problems that I can think of lately,
> and
> >>>> I've been using POI on ubuntu for a very long time now!
> >>>>
> >>>> Nick
> >>>>
> >>>>
> >>>> ------------------------------**------------------------------**
> >>>> ---------
> >>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<
> 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
>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Yegor Kozlov <ye...@dinom.ru>.
Your code is not quite correct, you have to create at least one sheet.

A workbook without sheets is in invalid state. You have to add a sheet
in order to open it in Excel.
This rule is true for all versions of Excel .

Yegor

On Thu, Oct 4, 2012 at 12:13 PM, Hans Maulwurf
<ha...@gmail.com> wrote:
> I don't understand it ... changing to java6 didn't solve it. I set up a new
> virtual machine Xubuntu and installed openjdk6 and netbeans from
> repository. I changed nothing, I'm only running these lines
>
>     public static void main(String[] args) throws IOException {
>
>         HSSFWorkbook wb = new HSSFWorkbook();
>         FileOutputStream fileOut = new
> FileOutputStream("/home/muench/workbook_test.xls");
>         wb.write(fileOut);
>         fileOut.close();
>     }
>
> But opening the xls under Windows with Microsoft Office it shows the same
> behaviour ... I don't know how to continue :/
>
>
> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>
>> Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
>> try to switch to java6 and report here.
>>
>>
>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>
>>> No, I used the same version of poi on windows, saved the files and used
>>> it on linux again. Replacing them with fresh downloaded doesn't change the
>>> situation. When compiling/debugging/creating there is no error, only
>>> opening with Microsoft Office shows this error (about 3 times) and then the
>>> sheets are shown correctly.
>>>
>>>
>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>
>>>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>
>>>>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>>>>> don't use a '/' in sheetnames, the same error comes when I only create a
>>>>> workbook and save it as xls, without cells or sheets, only the default
>>>>> sheets.
>>>>>
>>>>
>>>> Are you sure that there are no differences in POI versions? Could there
>>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>>> (Check the FAQ for how to find them).
>>>>
>>>> I've had no ubuntu-specific POI problems that I can think of lately, and
>>>> I've been using POI on ubuntu for a very long time now!
>>>>
>>>> Nick
>>>>
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Nick Burch <ap...@gagravarr.org>.
On Fri, 5 Oct 2012, Hans Maulwurf wrote:
> that's exactly the problem I've. Maybe the POI has some bugs?

If it works on almost all machines, but not a few, then I'd be more 
inclined to blame a JVM bug...

Might it be something like Oracle/Sun JVM vs OpenJDK, or a specific 
version of the JDK?

Nick

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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by allan <al...@swcp.com>.
OK, I've been able to duplicate this problem on my development machine.
But, when I add a sheet to the book, excel has no problem opening the file.
An empty wb as that would be produced by your supplied code snippit does cause excel to emit the File error, but when we 
add in the creation of a sheet (empty sheet, with only name) excel does not complain. This was duplicated on my laptop 
Ubuntu 10LTS - AMD, an HP intel running Ubuntu 10LTS as well as a CentOS 5.8 Zeon,
The added line is:
	Sheet sh = wb.createSheet("one");
I hope this helps.
Peace,
Allan

On 10/04/2012 11:51 PM, Hans Maulwurf wrote:
> Hey Allan,
>
> that's exactly the problem I've. Maybe the POI has some bugs?
>
>
>
> 2012/10/5 allan <al...@swcp.com>
>
>> Hi Hans,
>> I took your block of code and created same worksheet under Ubuntu 10x,
>> opened it with Excel 2010 and got an error: "File error: data may have been
>> lost."
>> I have, at this location, several product Excel files which were created
>> on a similar machine, Ubuntu 10.x, that open fine on same windoz machine.
>> There seems to be a difference between these two laptops which I will
>> investigate. The only problem: one of them is many miles from my current
>> location so this may take some time. In the meantime, maybe someone has
>> input to this problem.
>> Peace,
>>
>>
>>
>>
>> On 10/04/2012 11:40 AM, Hans Maulwurf wrote:
>>
>>> Well yes, I used different Excel versions (2003 & 2010) and even different
>>> Windowz (XP & 7), always the same :/
>>> I don't think it's an encoding problem, because I create an empty file
>>> (same if I fill some cells) so there are no special characters. Would it
>>> help if I send you the xls?
>>>
>>>
>>>
>>> 2012/10/4 allan <al...@swcp.com>
>>>
>>>   Would I be correct in assuming that in all cases, one version of MS Excel
>>>> has been used to elicit the problem?
>>>> Have you, by chance, used another windoz machine and/or another version
>>>> of
>>>> Excel for opening the "suspect" file?
>>>> Just a hunch, here...
>>>> BTW, what version of Excel are you using?
>>>> Peace,
>>>>
>>>>
>>>> On 10/04/2012 02:13 AM, Hans Maulwurf wrote:
>>>>
>>>>   I don't understand it ... changing to java6 didn't solve it. I set up a
>>>>> new
>>>>> virtual machine Xubuntu and installed openjdk6 and netbeans from
>>>>> repository. I changed nothing, I'm only running these lines
>>>>>
>>>>>        public static void main(String[] args) throws IOException {
>>>>>
>>>>>            HSSFWorkbook wb = new HSSFWorkbook();
>>>>>            FileOutputStream fileOut = new
>>>>> FileOutputStream("/home/****muench/workbook_test.xls");
>>>>>
>>>>>            wb.write(fileOut);
>>>>>            fileOut.close();
>>>>>        }
>>>>>
>>>>> But opening the xls under Windows with Microsoft Office it shows the
>>>>> same
>>>>> behaviour ... I don't know how to continue :/
>>>>>
>>>>>
>>>>> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>>>>>
>>>>>    Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>>>>>
>>>>>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I
>>>>>> will
>>>>>> try to switch to java6 and report here.
>>>>>>
>>>>>>
>>>>>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>>>>>
>>>>>>    No, I used the same version of poi on windows, saved the files and
>>>>>> used
>>>>>>
>>>>>>> it on linux again. Replacing them with fresh downloaded doesn't change
>>>>>>> the
>>>>>>> situation. When compiling/debugging/creating there is no error, only
>>>>>>> opening with Microsoft Office shows this error (about 3 times) and
>>>>>>> then
>>>>>>> the
>>>>>>> sheets are shown correctly.
>>>>>>>
>>>>>>>
>>>>>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>>>>>
>>>>>>>    On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>    I'm using poi-3.8-20120326.jar and that's the same I used on
>>>>>>>> Windows.
>>>>>>>>
>>>>>>>>> I
>>>>>>>>> don't use a '/' in sheetnames, the same error comes when I only
>>>>>>>>> create a
>>>>>>>>> workbook and save it as xls, without cells or sheets, only the
>>>>>>>>> default
>>>>>>>>> sheets.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>   Are you sure that there are no differences in POI versions? Could
>>>>>>>> there
>>>>>>>> perhaps be an older version of POI lurking somewhere on your
>>>>>>>> classpath?
>>>>>>>> (Check the FAQ for how to find them).
>>>>>>>>
>>>>>>>> I've had no ubuntu-specific POI problems that I can think of lately,
>>>>>>>> and
>>>>>>>> I've been using POI on ubuntu for a very long time now!
>>>>>>>>
>>>>>>>> Nick
>>>>>>>>
>>>>>>>>
>>>>>>>> ------------------------------******--------------------------**
>>>>>>>> --**--**
>>>>>>>> ---------
>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.******org<
>>>>>>>> user-unsubscribe@poi.**apache.**org <http://apache.org> <
>>>>>>>> user-unsubscribe@poi.apache.**org <us...@poi.apache.org>
>>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>   ------------------------------****----------------------------**
>>>> --**---------
>>>>
>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.****org<
>>>> user-unsubscribe@poi.**apache.org <us...@poi.apache.org>>
>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>
>>>>
>>>>
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
Hey Allan,

that's exactly the problem I've. Maybe the POI has some bugs?



2012/10/5 allan <al...@swcp.com>

> Hi Hans,
> I took your block of code and created same worksheet under Ubuntu 10x,
> opened it with Excel 2010 and got an error: "File error: data may have been
> lost."
> I have, at this location, several product Excel files which were created
> on a similar machine, Ubuntu 10.x, that open fine on same windoz machine.
> There seems to be a difference between these two laptops which I will
> investigate. The only problem: one of them is many miles from my current
> location so this may take some time. In the meantime, maybe someone has
> input to this problem.
> Peace,
>
>
>
>
> On 10/04/2012 11:40 AM, Hans Maulwurf wrote:
>
>> Well yes, I used different Excel versions (2003 & 2010) and even different
>> Windowz (XP & 7), always the same :/
>> I don't think it's an encoding problem, because I create an empty file
>> (same if I fill some cells) so there are no special characters. Would it
>> help if I send you the xls?
>>
>>
>>
>> 2012/10/4 allan <al...@swcp.com>
>>
>>  Would I be correct in assuming that in all cases, one version of MS Excel
>>> has been used to elicit the problem?
>>> Have you, by chance, used another windoz machine and/or another version
>>> of
>>> Excel for opening the "suspect" file?
>>> Just a hunch, here...
>>> BTW, what version of Excel are you using?
>>> Peace,
>>>
>>>
>>> On 10/04/2012 02:13 AM, Hans Maulwurf wrote:
>>>
>>>  I don't understand it ... changing to java6 didn't solve it. I set up a
>>>> new
>>>> virtual machine Xubuntu and installed openjdk6 and netbeans from
>>>> repository. I changed nothing, I'm only running these lines
>>>>
>>>>       public static void main(String[] args) throws IOException {
>>>>
>>>>           HSSFWorkbook wb = new HSSFWorkbook();
>>>>           FileOutputStream fileOut = new
>>>> FileOutputStream("/home/****muench/workbook_test.xls");
>>>>
>>>>           wb.write(fileOut);
>>>>           fileOut.close();
>>>>       }
>>>>
>>>> But opening the xls under Windows with Microsoft Office it shows the
>>>> same
>>>> behaviour ... I don't know how to continue :/
>>>>
>>>>
>>>> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>>>>
>>>>   Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>>>>
>>>>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I
>>>>> will
>>>>> try to switch to java6 and report here.
>>>>>
>>>>>
>>>>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>>>>
>>>>>   No, I used the same version of poi on windows, saved the files and
>>>>> used
>>>>>
>>>>>> it on linux again. Replacing them with fresh downloaded doesn't change
>>>>>> the
>>>>>> situation. When compiling/debugging/creating there is no error, only
>>>>>> opening with Microsoft Office shows this error (about 3 times) and
>>>>>> then
>>>>>> the
>>>>>> sheets are shown correctly.
>>>>>>
>>>>>>
>>>>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>>>>
>>>>>>   On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>>>
>>>>>>>
>>>>>>>   I'm using poi-3.8-20120326.jar and that's the same I used on
>>>>>>> Windows.
>>>>>>>
>>>>>>>> I
>>>>>>>> don't use a '/' in sheetnames, the same error comes when I only
>>>>>>>> create a
>>>>>>>> workbook and save it as xls, without cells or sheets, only the
>>>>>>>> default
>>>>>>>> sheets.
>>>>>>>>
>>>>>>>>
>>>>>>>>  Are you sure that there are no differences in POI versions? Could
>>>>>>> there
>>>>>>> perhaps be an older version of POI lurking somewhere on your
>>>>>>> classpath?
>>>>>>> (Check the FAQ for how to find them).
>>>>>>>
>>>>>>> I've had no ubuntu-specific POI problems that I can think of lately,
>>>>>>> and
>>>>>>> I've been using POI on ubuntu for a very long time now!
>>>>>>>
>>>>>>> Nick
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------******--------------------------**
>>>>>>> --**--**
>>>>>>> ---------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.******org<
>>>>>>> user-unsubscribe@poi.**apache.**org <http://apache.org> <
>>>>>>> user-unsubscribe@poi.apache.**org <us...@poi.apache.org>
>>>>>>> >>
>>>>>>>
>>>>>>>
>>>>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>  ------------------------------****----------------------------**
>>> --**---------
>>>
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.****org<
>>> user-unsubscribe@poi.**apache.org <us...@poi.apache.org>>
>>> For additional commands, e-mail: user-help@poi.apache.org
>>>
>>>
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by allan <al...@swcp.com>.
Hi Hans,
I took your block of code and created same worksheet under Ubuntu 10x, opened it with Excel 2010 and got an error: "File 
error: data may have been lost."
I have, at this location, several product Excel files which were created on a similar machine, Ubuntu 10.x, that open 
fine on same windoz machine. There seems to be a difference between these two laptops which I will investigate. The only 
problem: one of them is many miles from my current location so this may take some time. In the meantime, maybe someone 
has input to this problem.
Peace,



On 10/04/2012 11:40 AM, Hans Maulwurf wrote:
> Well yes, I used different Excel versions (2003 & 2010) and even different
> Windowz (XP & 7), always the same :/
> I don't think it's an encoding problem, because I create an empty file
> (same if I fill some cells) so there are no special characters. Would it
> help if I send you the xls?
>
>
>
> 2012/10/4 allan <al...@swcp.com>
>
>> Would I be correct in assuming that in all cases, one version of MS Excel
>> has been used to elicit the problem?
>> Have you, by chance, used another windoz machine and/or another version of
>> Excel for opening the "suspect" file?
>> Just a hunch, here...
>> BTW, what version of Excel are you using?
>> Peace,
>>
>>
>> On 10/04/2012 02:13 AM, Hans Maulwurf wrote:
>>
>>> I don't understand it ... changing to java6 didn't solve it. I set up a
>>> new
>>> virtual machine Xubuntu and installed openjdk6 and netbeans from
>>> repository. I changed nothing, I'm only running these lines
>>>
>>>       public static void main(String[] args) throws IOException {
>>>
>>>           HSSFWorkbook wb = new HSSFWorkbook();
>>>           FileOutputStream fileOut = new
>>> FileOutputStream("/home/**muench/workbook_test.xls");
>>>           wb.write(fileOut);
>>>           fileOut.close();
>>>       }
>>>
>>> But opening the xls under Windows with Microsoft Office it shows the same
>>> behaviour ... I don't know how to continue :/
>>>
>>>
>>> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>>>
>>>   Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>>>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
>>>> try to switch to java6 and report here.
>>>>
>>>>
>>>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>>>
>>>>   No, I used the same version of poi on windows, saved the files and used
>>>>> it on linux again. Replacing them with fresh downloaded doesn't change
>>>>> the
>>>>> situation. When compiling/debugging/creating there is no error, only
>>>>> opening with Microsoft Office shows this error (about 3 times) and then
>>>>> the
>>>>> sheets are shown correctly.
>>>>>
>>>>>
>>>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>>>
>>>>>   On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>>>
>>>>>>   I'm using poi-3.8-20120326.jar and that's the same I used on Windows.
>>>>>>> I
>>>>>>> don't use a '/' in sheetnames, the same error comes when I only
>>>>>>> create a
>>>>>>> workbook and save it as xls, without cells or sheets, only the default
>>>>>>> sheets.
>>>>>>>
>>>>>>>
>>>>>> Are you sure that there are no differences in POI versions? Could there
>>>>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>>>>> (Check the FAQ for how to find them).
>>>>>>
>>>>>> I've had no ubuntu-specific POI problems that I can think of lately,
>>>>>> and
>>>>>> I've been using POI on ubuntu for a very long time now!
>>>>>>
>>>>>> Nick
>>>>>>
>>>>>>
>>>>>> ------------------------------****----------------------------**--**
>>>>>> ---------
>>>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.****org<
>>>>>> user-unsubscribe@poi.**apache.org <us...@poi.apache.org>>
>>>>>>
>>>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
Well yes, I used different Excel versions (2003 & 2010) and even different
Windowz (XP & 7), always the same :/
I don't think it's an encoding problem, because I create an empty file
(same if I fill some cells) so there are no special characters. Would it
help if I send you the xls?



2012/10/4 allan <al...@swcp.com>

> Would I be correct in assuming that in all cases, one version of MS Excel
> has been used to elicit the problem?
> Have you, by chance, used another windoz machine and/or another version of
> Excel for opening the "suspect" file?
> Just a hunch, here...
> BTW, what version of Excel are you using?
> Peace,
>
>
> On 10/04/2012 02:13 AM, Hans Maulwurf wrote:
>
>> I don't understand it ... changing to java6 didn't solve it. I set up a
>> new
>> virtual machine Xubuntu and installed openjdk6 and netbeans from
>> repository. I changed nothing, I'm only running these lines
>>
>>      public static void main(String[] args) throws IOException {
>>
>>          HSSFWorkbook wb = new HSSFWorkbook();
>>          FileOutputStream fileOut = new
>> FileOutputStream("/home/**muench/workbook_test.xls");
>>          wb.write(fileOut);
>>          fileOut.close();
>>      }
>>
>> But opening the xls under Windows with Microsoft Office it shows the same
>> behaviour ... I don't know how to continue :/
>>
>>
>> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>>
>>  Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
>>> try to switch to java6 and report here.
>>>
>>>
>>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>>
>>>  No, I used the same version of poi on windows, saved the files and used
>>>> it on linux again. Replacing them with fresh downloaded doesn't change
>>>> the
>>>> situation. When compiling/debugging/creating there is no error, only
>>>> opening with Microsoft Office shows this error (about 3 times) and then
>>>> the
>>>> sheets are shown correctly.
>>>>
>>>>
>>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>>
>>>>  On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>>
>>>>>  I'm using poi-3.8-20120326.jar and that's the same I used on Windows.
>>>>>> I
>>>>>> don't use a '/' in sheetnames, the same error comes when I only
>>>>>> create a
>>>>>> workbook and save it as xls, without cells or sheets, only the default
>>>>>> sheets.
>>>>>>
>>>>>>
>>>>> Are you sure that there are no differences in POI versions? Could there
>>>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>>>> (Check the FAQ for how to find them).
>>>>>
>>>>> I've had no ubuntu-specific POI problems that I can think of lately,
>>>>> and
>>>>> I've been using POI on ubuntu for a very long time now!
>>>>>
>>>>> Nick
>>>>>
>>>>>
>>>>> ------------------------------****----------------------------**--**
>>>>> ---------
>>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.****org<
>>>>> user-unsubscribe@poi.**apache.org <us...@poi.apache.org>>
>>>>>
>>>>> For additional commands, e-mail: user-help@poi.apache.org
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by allan <al...@swcp.com>.
Would I be correct in assuming that in all cases, one version of MS Excel has been used to elicit the problem?
Have you, by chance, used another windoz machine and/or another version of Excel for opening the "suspect" file?
Just a hunch, here...
BTW, what version of Excel are you using?
Peace,

On 10/04/2012 02:13 AM, Hans Maulwurf wrote:
> I don't understand it ... changing to java6 didn't solve it. I set up a new
> virtual machine Xubuntu and installed openjdk6 and netbeans from
> repository. I changed nothing, I'm only running these lines
>
>      public static void main(String[] args) throws IOException {
>
>          HSSFWorkbook wb = new HSSFWorkbook();
>          FileOutputStream fileOut = new
> FileOutputStream("/home/muench/workbook_test.xls");
>          wb.write(fileOut);
>          fileOut.close();
>      }
>
> But opening the xls under Windows with Microsoft Office it shows the same
> behaviour ... I don't know how to continue :/
>
>
> 2012/10/4 Hans Maulwurf <ha...@gmail.com>
>
>> Maybe the java6 and java7 lead to this behaviour? Under Windows I used
>> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
>> try to switch to java6 and report here.
>>
>>
>> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>>
>>> No, I used the same version of poi on windows, saved the files and used
>>> it on linux again. Replacing them with fresh downloaded doesn't change the
>>> situation. When compiling/debugging/creating there is no error, only
>>> opening with Microsoft Office shows this error (about 3 times) and then the
>>> sheets are shown correctly.
>>>
>>>
>>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>>
>>>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>>
>>>>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>>>>> don't use a '/' in sheetnames, the same error comes when I only create a
>>>>> workbook and save it as xls, without cells or sheets, only the default
>>>>> sheets.
>>>>>
>>>>
>>>> Are you sure that there are no differences in POI versions? Could there
>>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>>> (Check the FAQ for how to find them).
>>>>
>>>> I've had no ubuntu-specific POI problems that I can think of lately, and
>>>> I've been using POI on ubuntu for a very long time now!
>>>>
>>>> Nick
>>>>
>>>>
>>>> ------------------------------**------------------------------**
>>>> ---------
>>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
I don't understand it ... changing to java6 didn't solve it. I set up a new
virtual machine Xubuntu and installed openjdk6 and netbeans from
repository. I changed nothing, I'm only running these lines

    public static void main(String[] args) throws IOException {

        HSSFWorkbook wb = new HSSFWorkbook();
        FileOutputStream fileOut = new
FileOutputStream("/home/muench/workbook_test.xls");
        wb.write(fileOut);
        fileOut.close();
    }

But opening the xls under Windows with Microsoft Office it shows the same
behaviour ... I don't know how to continue :/


2012/10/4 Hans Maulwurf <ha...@gmail.com>

> Maybe the java6 and java7 lead to this behaviour? Under Windows I used
> java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
> try to switch to java6 and report here.
>
>
> 2012/10/3 Hans Maulwurf <ha...@gmail.com>
>
>> No, I used the same version of poi on windows, saved the files and used
>> it on linux again. Replacing them with fresh downloaded doesn't change the
>> situation. When compiling/debugging/creating there is no error, only
>> opening with Microsoft Office shows this error (about 3 times) and then the
>> sheets are shown correctly.
>>
>>
>> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>>
>>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>>
>>>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>>>> don't use a '/' in sheetnames, the same error comes when I only create a
>>>> workbook and save it as xls, without cells or sheets, only the default
>>>> sheets.
>>>>
>>>
>>> Are you sure that there are no differences in POI versions? Could there
>>> perhaps be an older version of POI lurking somewhere on your classpath?
>>> (Check the FAQ for how to find them).
>>>
>>> I've had no ubuntu-specific POI problems that I can think of lately, and
>>> I've been using POI on ubuntu for a very long time now!
>>>
>>> Nick
>>>
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
>>> For additional commands, e-mail: user-help@poi.apache.org
>>>
>>>
>>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
Maybe the java6 and java7 lead to this behaviour? Under Windows I used
java6, I wanted to have an up-to-date-Ubuntu so I installed java7. I will
try to switch to java6 and report here.

2012/10/3 Hans Maulwurf <ha...@gmail.com>

> No, I used the same version of poi on windows, saved the files and used it
> on linux again. Replacing them with fresh downloaded doesn't change the
> situation. When compiling/debugging/creating there is no error, only
> opening with Microsoft Office shows this error (about 3 times) and then the
> sheets are shown correctly.
>
>
> 2012/10/3 Nick Burch <ap...@gagravarr.org>
>
>> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>>
>>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>>> don't use a '/' in sheetnames, the same error comes when I only create a
>>> workbook and save it as xls, without cells or sheets, only the default
>>> sheets.
>>>
>>
>> Are you sure that there are no differences in POI versions? Could there
>> perhaps be an older version of POI lurking somewhere on your classpath?
>> (Check the FAQ for how to find them).
>>
>> I've had no ubuntu-specific POI problems that I can think of lately, and
>> I've been using POI on ubuntu for a very long time now!
>>
>> Nick
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
No, I used the same version of poi on windows, saved the files and used it
on linux again. Replacing them with fresh downloaded doesn't change the
situation. When compiling/debugging/creating there is no error, only
opening with Microsoft Office shows this error (about 3 times) and then the
sheets are shown correctly.


2012/10/3 Nick Burch <ap...@gagravarr.org>

> On Wed, 3 Oct 2012, Hans Maulwurf wrote:
>
>> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
>> don't use a '/' in sheetnames, the same error comes when I only create a
>> workbook and save it as xls, without cells or sheets, only the default
>> sheets.
>>
>
> Are you sure that there are no differences in POI versions? Could there
> perhaps be an older version of POI lurking somewhere on your classpath?
> (Check the FAQ for how to find them).
>
> I've had no ubuntu-specific POI problems that I can think of lately, and
> I've been using POI on ubuntu for a very long time now!
>
> Nick
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 3 Oct 2012, Hans Maulwurf wrote:
> I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
> don't use a '/' in sheetnames, the same error comes when I only create a
> workbook and save it as xls, without cells or sheets, only the default
> sheets.

Are you sure that there are no differences in POI versions? Could there 
perhaps be an older version of POI lurking somewhere on your classpath? 
(Check the FAQ for how to find them).

I've had no ubuntu-specific POI problems that I can think of lately, and 
I've been using POI on ubuntu for a very long time now!

Nick

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


Re: Writing xls under Ubuntu, problem opening under Windows

Posted by Hans Maulwurf <ha...@gmail.com>.
I'm using poi-3.8-20120326.jar and that's the same I used on Windows. I
don't use a '/' in sheetnames, the same error comes when I only create a
workbook and save it as xls, without cells or sheets, only the default
sheets.
I thought of an encoding-problem because of utf8/cp1252 but I'm not writing
a string into the workbook :/

-Hans

2012/10/3 allan <al...@swcp.com>

> Hi Hans,
> I write many XL output reports fromUbuntu (laptop) and CentOS (server) and
> have not had any problems you are experiencing.
> What version poi are you using? any difference between Windoz and Linux?
> I have seen a similar problem when a slash '/' is used in the sheet name -
> an illegal character in XL.
> -Allan
>
>
> On 10/02/2012 12:13 PM, Hans Maulwurf wrote:
>
>> Hey,
>>
>> I moved from Windows to Ubuntu and I've a problem with apache poi hssf.
>> I'm
>> creating an (empty or filled, doesn't matter) workbook and save it as
>> .xls.
>> ThenI try to open it under a Windows machine and Microsoft Office 2003
>> says, that there may be some parts damaged. This popup is shown 3 times
>> (with ok-button) and then it's showing the sheets. I tried Eclipse and
>> NetBeans, nothing changed. Under Windows I used Eclipse and had no
>> problems. OpenOffice and LibreOffice don't complain, only Microsoft Office
>> :(
>>
>> I don't know why this happenes, while compiling and running the project,
>> there is no error.
>>
>> Is this a common problem or what did I wrong?
>>
>>
>> I hope you can help me,
>>
>> greetings,
>>
>> Hans
>>
>>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.**org<us...@poi.apache.org>
> For additional commands, e-mail: user-help@poi.apache.org
>
>

Re: Writing xls under Ubuntu, problem opening under Windows

Posted by allan <al...@swcp.com>.
Hi Hans,
I write many XL output reports fromUbuntu (laptop) and CentOS (server) and have not had any problems you are experiencing.
What version poi are you using? any difference between Windoz and Linux?
I have seen a similar problem when a slash '/' is used in the sheet name - an illegal character in XL.
-Allan

On 10/02/2012 12:13 PM, Hans Maulwurf wrote:
> Hey,
>
> I moved from Windows to Ubuntu and I've a problem with apache poi hssf. I'm
> creating an (empty or filled, doesn't matter) workbook and save it as .xls.
> ThenI try to open it under a Windows machine and Microsoft Office 2003
> says, that there may be some parts damaged. This popup is shown 3 times
> (with ok-button) and then it's showing the sheets. I tried Eclipse and
> NetBeans, nothing changed. Under Windows I used Eclipse and had no
> problems. OpenOffice and LibreOffice don't complain, only Microsoft Office
> :(
>
> I don't know why this happenes, while compiling and running the project,
> there is no error.
>
> Is this a common problem or what did I wrong?
>
>
> I hope you can help me,
>
> greetings,
>
> Hans
>

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