You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2008/10/14 14:08:49 UTC
DO NOT REPLY [Bug 46002] New: POI operate the excel OLEObjects
Forms.CommandButton.1
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
Summary: POI operate the excel OLEObjects Forms.CommandButton.1
Product: POI
Version: 3.1
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: jian_feng@ncsi.com.cn
Hi,
I have a problem in the POI for Excel. I add an OLEObjects
"Forms.CommandButton.1" in the excel file. Please refer to the Macro recorded.
“ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False,
DisplayAsIcon:=False, Left:=35.25, Top:=171, Width:=100.5, Height:=
28.5).Select”. Now I add some rows before the CommandButton, but it does not
move down. It still stay in Left:=35.25, Top:=171. When we manual insert a new
row in the excel file, the CommandButton will move to the next. Please tell to
me how to do use the POI. Please help me. Thanks!
Best Regards,
Jianfeng Jiang
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46002] POI operate the excel OLEObjects
Forms.CommandButton.1
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
--- Comment #2 from jianfeng <ji...@ncsi.com.cn> 2008-10-14 05:32:20 PST ---
Created an attachment (id=22724)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=22724)
the not correct result
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46002] POI operate the excel OLEObjects
Forms.CommandButton.1
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
--- Comment #5 from jianfeng <ji...@ncsi.com.cn> 2008-10-16 18:03:35 PST ---
In the POI how to getb the buttons handle. Can you give a sample? Thanks!
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46002] POI operate the excel OLEObjects
Forms.CommandButton.1
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
--- Comment #4 from Nick Burch <ni...@torchbox.com> 2008-10-16 06:45:50 PST ---
shiftRows won't update everything. You'll need to manually move your buttons
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46002] POI operate the excel OLEObjects
Forms.CommandButton.1
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
--- Comment #3 from jianfeng <ji...@ncsi.com.cn> 2008-10-14 05:45:43 PST ---
for(int recorderNo=1;recorderNo<=2;recorderNo++){
String fileName =
generateFileName(examYr,examLvlCd, examSeriesCd,
recordTo.getValue("SUBJ_CD").toString(),
recordTo.getValue("PAPER_NO").toString(),
recordTo.getValue("MOA_CD").toString(), formCd,
String.valueOf(markerNo), String.valueOf(recorderNo));
ExcelWriter ew = new
ExcelWriter(templateFile1,fileName);
if(qtnNoList != null &&
qtnNoList.size() > 0){
ew.setIntValue(0, 2, 4, examYr, ew.getStyle(0, 2, 4));
StringBuffer
subject = new StringBuffer();
subject.append(recordTo.getValue("SUBJ_CD")).append("
").append(recordTo.getValue("SUBJ_NM"));
ew.setStringValue(0, 4, 4, subject.toString(),ew.getStyle(0, 4, 4));
ew.setIntValue(0, 5, 4, recordTo.getValue("PAPER_NO").toString(),
ew.getStyle(0, 5, 4));
ew.setIntValue(0, 6, 4, String.valueOf(markerNo),ew.getStyle(0, 6, 4));
ew.setIntValue(0, 7, 4, String.valueOf(recorderNo),ew.getStyle(0, 7, 4));
HSSFCellStyle
s1 = ew.getStyle(0, 23, 3);
HSSFCellStyle
s2 = ew.getStyle(0, 23, 4);
HSSFCellStyle
s3 = ew.getStyle(0, 23, 5);
HSSFCellStyle
s4 = ew.getStyle(0, 23, 6);
for(int
i=23;i<23+qtnNoList.size();i++){
HSSFRow
row = ew.createRowWithShift(0, i);
row.createCell((short)3).setCellStyle(s1);
ew.setStringValue(0, i, 3,
qtnNoList.get(i-23).getValue("QTN_NO").toString(),s1);
row.createCell((short)4).setCellStyle(s2);
row.createCell((short)5).setCellStyle(s3);
row.createCell((short)6).setCellStyle(s4);
}
ew.deleteRow(0,
ew.getRow(0, 23+qtnNoList.size()));
}
ew.save();
}
The above is my code for createRowWithShift rows. but the button did not move
down. Please check with the attached files(the incorrect result)
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 46002] POI operate the excel OLEObjects
Forms.CommandButton.1
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46002
Nick Burch <ni...@torchbox.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #1 from Nick Burch <ni...@torchbox.com> 2008-10-14 05:13:08 PST ---
I'm not sure you're actually using poi...
Please re-open the bug if you can supply the code that's failing
--
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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org