on 10-03-2006 2:38 PM
Hi all,
I would to know how it's possible to export in Excel a dynamic Node, created in the wdDoModify() method.
I'd seen the tutorial TutWD_ExcelExport in wich the public method for exportation into Excel 2003 accepts in input a IWDNode attribute, but I can't pass him a dynamic node that I'd created and manipulated in the wdDoModify() method.
How can I do???
Thanks to all.
Gianluca Barile
Hi Gianluca,
Did you see the code from tutorial?
private Map getProductColumnInfos() {
Map columnInfosMap = new HashMap();
columnInfosMap.put(IPrivateTableCompBasketView.IProductsElement.QUANTITY, "Quantity");
columnInfosMap.put(IPrivateTableCompBasketView.IProductsElement.ARTICLE, "Article");
columnInfosMap.put(IPrivateTableCompBasketView.IProductsElement.COLOR, "Color");
columnInfosMap.put(IPrivateTableCompBasketView.IProductsElement.PRICE, "Price in EURO");
columnInfosMap.put(
IPrivateTableCompBasketView.IProductsElement.TOTAL__PER__ARTICLE,
"Total Per Article In Euro");
return columnInfosMap;
}
So, columnInfosMap should contain string pairs with attribute name as key and header title as value.
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, I've seen the code.
The problem is that my Node has a non specified number of attributes and It lives only at runtime.
my Node has 3 + N attributes at runtime where N is specified from the user.
Of course how can I have a pairs Name Attribute, Key from the IWDNode and IWDNodeElement intefaces????
I hope that you had undestand me.
What can I do??
Message was edited by: Gianluca Barile
final IWDNode dynTabNode = (IWDNode)wdContext.getChildNode("GrigliaComparativa", 0);
final Map columnInfosMap = new HashMap();
final IWDNodeInfo nodeInfo = dynTabNode.getNodeInfo();
for (Iterator iter = nodeInfo.iterateAttributes(); iter.hasNext();) {
final IWDAttributeInfo attributeInfo = (IWDAttributeInfo) iter.next();
columnInfosMap.put(attributeInfo.getName(), attributeInfo.getName());
}
Answered.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've implemented the following code (but it doesn't work)
in wdDoModify() method:
....
IWDNodeInfo nodeinfo = wdContext.getNodeInfo();
IWDNodeInfo grigliaComparativaNode = nodeinfo.addChild("GrigliaComparativa",null,true,true,true,false,false,true,null,null,null);
IWDAttributeInfo nominativo = grigliaComparativaNode.addAttribute("Nominativo","com.sap.dictionary.string");
IWDAttributeInfo periodoDa = grigliaComparativaNode.addAttribute("Da","com.sap.dictionary.string");
IWDAttributeInfo periodoA = grigliaComparativaNode.addAttribute("A","com.sap.dictionary.string");
IWDAttributeInfo[] v = new IWDAttributeInfo[50];
for (int i = 0; i < wdContext.nodeT_Body_Elements().size(); i++)
v<i> = grigliaComparativaNode.addAttribute("V"+i,"com.sap.dictionary.string");
....
IWDNode dynTabNode = (IWDNode)wdContext.getChildNode("GrigliaComparativa",0);
Map columnInfosMap = new HashMap();
dynTabNode.moveFirst();
do{
IWDNodeElement dynTabElem = (IWDNodeElement)dynTabNode.getCurrentElement();
columnInfosMap.put(dynTabElem.getClass().getName(),dynTabElem.getClass().getName().toString());
}while(dynTabNode.moveNext()!=null);
wdThis.wdGetExcelExportCompInterface().exportToExcel2003(dynTabNode , columnInfosMap);
Message was edited by: Gianluca Barile
Message was edited by: Gianluca Barile
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.