DO NOT REPLY [Bug 45430] New: XSSFName.getSheetName() returns the wrong value

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45430

   Summary: XSSFName.getSheetName() returns the wrong value
   Product: POI
   Version: unspecified
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: [EMAIL PROTECTED]


Created an attachment (id=22279)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=22279)
Test Data

I am using POI 3.5 Beta 1.
I write following code to list all the Named Range in the Excel Workbook.

Workbook wb = new XSSFWorkbook(xlsx_path);
for(int j=0; jwb.getNumberOfNames(); j++){
Name name = wb.getNameAt(j);
String reference = name.getReference();
String sheetName = name.getSheetName();
System.out.println(reference:  + reference);
System.out.println(sheetName:  + sheetName);
}

I found that the .getSheetName() method return the wrong value, it always
return sheet one name, which doesn't match with .getReference() (the sheet name
part).

I have uploaded a sample .xlsx file, which contains three worksheets, each
worksheet $A$1 has defined a named range. You can run above codes to check the
result.

Expected Result:
reference: SheetA!$A$1
sheetName: SheetA
reference: SheetB!$A$1
sheetName: SheetB
reference: SheetC!$A$1
sheetName: SheetC

Actual Result:
reference: SheetA!$A$1
sheetName: SheetA
reference: SheetB!$A$1
sheetName: SheetA
reference: SheetC!$A$1
sheetName: SheetA


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 45431] New: XSSFWorkbook cannot save a macro-enabled Excel (.xlsm)

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45431

   Summary: XSSFWorkbook cannot save a macro-enabled Excel (.xlsm)
   Product: POI
   Version: unspecified
  Platform: PC
OS/Version: Windows XP
Status: NEW
  Severity: normal
  Priority: P2
 Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: [EMAIL PROTECTED]


I am using POI 3.5 Beta 1.
When I open a macro-enabled Excel (.xlsm) and save it as .xslm again.
The result file cannot be opened by MS Excel 2007.

Following is my sample codes:

XSSFWorkbook wb = new XSSFWorkbook(input.xlsm);
FileOutputStream outStream = new FileOutputStream(output.xlsm);
wb.write(outStream);

Is that currently POI not support a macro-enabled Excel file? Thanks a lot.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 45431] XSSFWorkbook cannot save a macro-enabled Excel (. xlsm)

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45431





--- Comment #1 from Matthew [EMAIL PROTECTED]  2008-07-18 02:44:02 PST ---
Created an attachment (id=22280)
 -- (https://issues.apache.org/bugzilla/attachment.cgi?id=22280)
Input Excel File


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Generating ppt through java

2008-07-18 Thread dinshetty

Hi Yegor,

I tried to run the follwing code, But I am getting some null pointer
exception as below
_records in TextRun.java is null. Why is this _records is used for? What can
be done to resolve this ?

Exception:
Exception in thread main java.lang.NullPointerException
at org.apache.poi.hslf.model.TextRun.getTextRuler(TextRun.java:671)
at org.apache.poi.hslf.model.TextPainter.paint(TextPainter.java:128)
at org.apache.poi.hslf.model.TextShape.draw(TextShape.java:531)
at
org.apache.poi.hslf.examples.TextPainter_small.main(TextPainter_small.java:57)


Program
SlideShow ppt = new SlideShow();
ppt.setPageSize(new Dimension(720, 540));
   
Slide slide = ppt.createSlide();

ShapeGroup group = new ShapeGroup();
//define position of the drawing in the slide
Rectangle bounds = new java.awt.Rectangle(200, 100, 350, 300);
group.setAnchor(bounds);
slide.addShape(group);
TextBox box1 = new TextBox();
group.setCoordinates(new java.awt.Rectangle(0, 0, 100, 100));
group.addShape(box1);

Graphics2D graphics = new PPGraphics2D(group);


TextRun tr1 = box1.createTextRun(); 
tr1.getRichTextRuns()[0].setFontSize(12);
tr1.getRichTextRuns()[0].setFontName(Arial);
box1.setHorizontalAlignment(TextBox.AlignLeft);
tr1.setText(
Yegor Kozlov\r +
yegor - apache - org\r +
yegor - apache - org\r +  
yegor - apache - org);

/*TextPainter painter = new TextPainter(box1);
painter.paint(graphics);*/

box1.draw(graphics);
slide.addShape(box1);
-- 
View this message in context: 
http://www.nabble.com/Generating-ppt-through-java-tp18399673p18527013.html
Sent from the POI - Dev mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



changed API when introducing ss to hssf, add old as @deprecated?

2008-07-18 Thread Rainer Schwarze

Hi,

I'm trying to work with JasperReports 3.0.0 which is built against 
POI-3.0.1-FINAL. When I use a newer POI library, it complains, because 
interfaces changed such as HSSFCell.setCellStyle(HSSFCellStyle) being 
now HSSFCell.setCellStyle(CellStyle).


Would it be interesting/possible to include the old style API again as 
deprecated? (And throw it away with - say - 4.0?) Are there critical 
issues, which prevent the old API being there?
(in addition to setCellStyle(CellStyle) have the method 
setCellStyle(HSSFCellStyle) too)


Thanks and best wishes, Rainer
--

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[ANNOUNCE] Apache POI 3.5.1 Beta 1 Released

2008-07-18 Thread Nick Burch
The POI team is pleased to announce the availability of Apache POI 3.5.1 
beta 1, our first release including OOXML (Office Open XML) support.


Apache POI is well-known in the Java field as a library for reading and
writing OLE2 office file formats, such as Excel, PowerPoint, Visio and
Word. With POI 3.5, it also support the new OOXML formats introduced in 
Office 2007. See http://poi.apache.org/ for more details



Release Highlights:

  POI-SS - Java API To Access Microsoft Excel Format Files
  * This common interface allows access to HSSF (binary file format,
 .xls) and XSSF (ooxml file format, .xlsx) in the same way
  * Very similar to HSSF usermodel, allowing easy translation of old
 code support to the new format
  * All of HSSF should support this interface
  * Partial implementation of XSSF for this interface

  POI-XSSF - Java API To Access Microsoft Excel 2007 OOXML Format Files
  * partial implementation of high level interface
  * text extraction supported
  * low level, low memory parsing supported

  POI-XSLF - Java API To Access Microsoft PowerPoint 2007 OOXML Format Files
  * text extraction supported

  POI-XWPF - Java API To Access Microsoft Word 2007 OOXML File Formats
  * text extraction supported

In addition, all fixes from POI 3.1 FINAL, and from just after, are 
included. For full changelog details, and documentation, please see /docs/ 
in the distribution. The documentation on the website reflects the state 
of work on POI 3.1.1.



The source and binaries can be downloaded from your local mirror:
http://www.apache.org/dyn/closer.cgi/poi/dev/

The release is also available from the central Maven repository under
Group ID org.apache.poi and Version 3.5.1-beta1. Note that the ooxml 
support is not available via Maven, as the dependencies are not packaged.



For the Apache POI Team
Nick Burch

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [ANNOUNCE] Apache POI 3.5.1 Beta 1 Released

2008-07-18 Thread Nick Burch

On Fri, 18 Jul 2008, Nick Burch wrote:
The POI team is pleased to announce the availability of Apache POI 3.5.1 
beta 1, our first release including OOXML (Office Open XML) support.


Just to let everyone here know that I'm aiming to do beta releases around 
once a month, until we're ready for final (hopefully late summer, 
depending on resources to work on xssf)


Expect the next beta vote mid august, unless we spot any major bugs in 
beta 1, in which case sooner


Nick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



copy .doc text

2008-07-18 Thread Fabio Alves de Araujo Ebner - Dna
hi.. can i copy the all text from one .doc to another? with all formats??? i 
have one text in A.doc and i need to copy that text replace something and past 
inte B.doc

is possible?

DO NOT REPLY [Bug 45394] Remove unused examples properties from build.xml

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45394


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #1 from Nick Burch [EMAIL PROTECTED]  2008-07-18 10:16:42 PST ---
Thanks for this, applied to svn 


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 45398] [PATCH] Fix HSSFDateUtil to recognize formats with AM/PM

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45398


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #1 from Nick Burch [EMAIL PROTECTED]  2008-07-18 10:16:56 PST ---
Thanks, applied to svn, along with a unit test


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 45430] XSSFName.getSheetName() returns the wrong value

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45430


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Comment #1 from Nick Burch [EMAIL PROTECTED]  2008-07-18 10:37:49 PST ---
Fixed in svn - was an issue when no localSheetId was given


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 45431] XSSFWorkbook cannot save a macro-enabled Excel (. xlsm)

2008-07-18 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=45431


Nick Burch [EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |NEEDINFO




--- Comment #2 from Nick Burch [EMAIL PROTECTED]  2008-07-18 11:24:36 PST ---
We weren't copying the vba stream over into the new file, which wasn't helping

I've updated poi to copy over the vba stream if there is one. However, excel
still refuses to load the file, so I don't know what else we're supposed to do.
Clearly there is a secret hidden reference somewhere that we're not updating or
something

It may be worth closely comparing the un-zipped contents of the pre-poi and
post-poi files, to see if you can spot any important bits that differ


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



help with tables

2008-07-18 Thread Fabio Alves de Araujo Ebner - Dna
hi. i try do insert a new Row or Cell into a word file table.. but i can't do.. 
i can got the tabele, row, cel. replace de text inside. but can't insert a new 
Cell(column) or Row.. 


help please

Re: changed API when introducing ss to hssf, add old as @deprecated?

2008-07-18 Thread Rainer Schwarze

Nick Burch wrote:

On Fri, 18 Jul 2008, Rainer Schwarze wrote:
I'm trying to work with JasperReports 3.0.0 which is built against 
POI-3.0.1-FINAL. When I use a newer POI library, it complains, because 
interfaces changed such as HSSFCell.setCellStyle(HSSFCellStyle) being 
now HSSFCell.setCellStyle(CellStyle).


I'm guessing this is on the 3.5 / ooxml branch? 


I'm using an adjusted POI library, but the issue exists also with 
poi-3.5-beta1-20080718.jar .


 HSSFCellStyle extends
CellStyle, so you shouldn't see any difference - we've made the method 
call more accepting, not less.


I get this when I use the 3.5 beta with JasperReports:

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFCell.setCellStyle(Lorg/apache/poi/hssf/usermodel/HSSFCellStyle;)V  
   at net.sf.jasperreports.engine.export.JRXlsExporter.setCell(JRXlsExporter.java:208)

... (+ some more lines)


Since JasperReports is built against POI-3.0.1 and no rebuild of 
JasperReports should be necessary, binary compatibility is needed. 
Regarding such issues, I found this page quite handy in the past:


http://wiki.eclipse.org/Evolving_Java-based_APIs_2

There is a section Evolving API classes - API methods and constructors 
which has a row containing:


Change type of a formal parameter -   Breaks compatibility

I think this happens when the type of the cell style changes from 
HSSFCellStyle to CellStyle.


So to keep the binary compatibility the setCellStyle(HSSFCellStyle) 
should still be there, shouldn't it? Is binary compatibility


 It's possible to compile almost all of the unit tests from poi 3.1
 against the jar of poi 3.5, certainly all the cell style ones, so I'm
 not sure why you're hitting a problem. (It's only MissingCellPolicy
 and HSSFFormulaEvaluator.CellValue that need to change, see
 docs/spreadsheet/converting.html)

If the code which uses HSSF doesn't know about XSSF and only deals with 
HSSF, should it still work with the 3.5 branch without modification / 
rebuild?


Best wishes, Rainer
--

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]