on 05-06-2010 6:27 AM
Hi Friends,
I have one doubt on Checkbox Conditions. I had download data into Excel Format. My requirement is suppose I have select 4 checkbox into table click on Download I want to download 4 records into Excel Format.
Now I have Select 4 Checkbox click on download button total records is downloaded
My Req:: I have select 4 checkbox into table click on Download I want to download 4 records into Excel Format.
So I had done Coding also. What I am doing that coding is
1. I have to create one Value Node(IPoDetails_ExcelData)
2. Now Data is available in this Value Node (PoDetails_OutTab)
3. what I am doing here Get the data from this value node (PoDetails_OutTab) and set that data to this Value Node (IPoDetails_ExcelData). Finally add the data to this Value Node (IPoDetails_ExcelData).
Could you check my code. If any problem in that code pls help me.
public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiondownloadToExcel(ServerEvent)
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataNode ExcelNode = wdContext.nodePoDetails_ExcelData();
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle;
wdComponentAPI.getMessageManager().reportSuccess("ExcelNode:"+ExcelNode);
IPrivatePO_Details_ResultView.IPoDetails_OutTabNode StockNode = wdContext.nodePoDetails_OutTab();
wdComponentAPI.getMessageManager().reportSuccess("StockNode:"+StockNode);
IPrivatePO_Details_ResultView.IPoDetails_OutTabElement StockEle ;
//wdComponentAPI.getMessageManager().reportMessage(IMessageCO_EnterStockDetails.SF_UPLOAD, null ,false);
for(int i = 0 ;i<StockNode.size();i++)
{ //wdComponentAPI.getMessageManager().reportSuccess("StockNode.size:"+StockNode.size());
StockEle = StockNode.getPoDetails_OutTabElementAt(i);
//wdComponentAPI.getMessageManager().reportSuccess("StockEle:"+StockEle);
if(StockEle.getCheckBox()== true)
{ wdComponentAPI.getMessageManager().reportSuccess("StockNodeCheck:"+StockEle.getCheckBox());
ExcelEle = ExcelNode.createPoDetails_ExcelDataElement();// Create Element
wdComponentAPI.getMessageManager().reportSuccess("ExcelEle:"+ExcelEle);
ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date()); wdComponentAPI.getMessageManager().reportSuccess("Conf_Shp_Date:"StockEle.getConf_Shp_Date()); wdComponentAPI.getMessageManager().reportSuccess("ExcelEleConf_Shp_Date:"ExcelEle.getConf_Shp_Date());
ExcelEle.setMaterial(StockEle.getMaterial());
ExcelEle.setMatl_Desc(StockEle.getMatl_Desc());
ExcelEle.setOa_Quantity(StockEle.getOa_Quantity());
ExcelEle.setOpn_Quantity(StockEle.getOpn_Quantity());
ExcelEle.setPo_Item(StockEle.getPo_Item());
ExcelEle.setPo_Number(StockEle.getPo_Number()); wdComponentAPI.getMessageManager().reportSuccess("Po_Number:"StockEle.getPo_Number()); wdComponentAPI.getMessageManager().reportSuccess("ExcelElePo_Number:"ExcelEle.getPo_Number());
ExcelEle.setPo_Status(StockEle.getPo_Status());
ExcelEle.setUom(StockEle.getUom());
ExcelEle.setStat_Date(StockEle.getStat_Date());
ExcelEle.setQuantity(StockEle.getQuantity());
ExcelEle.setDeliv_Date(StockEle.getDeliv_Date());
ExcelEle.setExpt_Shp_Date(StockEle.getExpt_Shp_Date());
ExcelEle.setVendor_Material(StockEle.getVendor_Material());
ExcelNode.addElement(ExcelEle); wdComponentAPI.getMessageManager().reportSuccess("H:::ExcelData::::"+ExcelNode.currentPoDetails_ExcelDataElement());
wdComponentAPI.getMessageManager().reportSuccess("H:::ExcelData::::"+ExcelEle.getPo_Item());
// wdThis.wdGetCO_POPendingController().downloadToExcelFile();
// wdThis.wdGetCO_POPendingController().DownLoadToExcel();// Popup Window
}
}
//wdThis.wdGetCO_POPendingController().downloadToExcelFile();
//wdComponentAPI.getMessageManager().reportSuccess("Giiiiii");
///wdThis.wdGetCO_POPendingController().DownLoadToExcel();
if(ExcelNode.size()>0)
{
//wdThis.wdGetCO_POPendingController().downloadToExcelFile(wdContext.nodePoDetails_ExcelData(),getReportingDelays());
//wdThis.wdGetCO_POPendingController().Downlaod();
//wdThis.wdGetCO_POPendingController().downloadToExcelFile();// This is Download Excel Data
IThis is method in CC-downloadToExcelFile and This is Open Popup window DownLoadToExcel(). This method also in CC
wdThis.wdGetCO_POPendingController().DownLoadToExcel();
wdContext.nodePoDetails_ExcelData().invalidate();
}
else {
wdComponentAPI.getMessageManager().reportException("Please select any one po item from the table",true);
}
//@@end
}
Regards
Vijay Kalluri
Hi Vijay,
Please try to use this to implement your scenario:
public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiondownloadToExcel(ServerEvent)
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle = null;
for(int i = 0; i< wdContext.nodePoDetails_OutTab().size(); i++)
{
ExcelEle = wdContext.createDetails_ExcelDataElement();
//Here check condition for selected table checkbox column in nodePoDetails_OutTab()
if (wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).get<Table Column Attribute>.getMdoNo()
.equalsIgnoreCase("TRUE")
{
// Here you need to code for setting table row value in the node Details_ExcelData. Like same as below
ExcelEle.set<Table column Name>(wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).get<Table Column Attribute>.getMdoNo())
-
-
-
wdContext.nodeDetails_ExcelData().addElement(ExcelEle);
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
Please try to use this to implement your scenario:
public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActiondownloadToExcel(ServerEvent)
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle = null;
for(int i = 0; i< wdContext.nodePoDetails_OutTab().size(); i++)
{
ExcelEle = wdContext.createDetails_ExcelDataElement();
Here check condition for selected table checkbox column in nodePoDetails_OutTab()
if (wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).get<Table Column Attribute>.getMdoNo
().equalsIgnoreCase("TRUE")
{
// Here you need to code for setting table row value in the node Details_ExcelData. Like same as below
ExcelEle.set<Table column Name>(wdContext.nodePoDetails_OutTab().getPoDetails_OutTabElementAt(i).get<Table
Column Attribute>.getMdoNo())
-
-
-
wdContext.nodeDetails_ExcelData().addElement(ExcelEle);
}
}
}
Hope it helps
Regards
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.