on 02-03-2011 1:50 PM
Good morning.
I need to open an excel file for the customer to open or save, as it is with a IWDLinkToURL, but I can not do it with a IWDLinkToURL by specifications of the application that I'm doing.
Consider the following code:
IWDCachedWebResource cachedExcelResource = null;
wdThis.wdGetReportesComponentsController excelXMLFile = (). ToExcel (DataNode, columnInfos, selectionElement). getBytes ("UTF-8");
cachedExcelResource = getCachedWebResource (excelXMLFile, fileName, WDWebResourceType.XLS)
Taking the object cachedExcelResource, how could deploy automatically?
I thought of the possibility of placing the object invisible and shoot IWDLinkToURL some onClick event, but I do not know how to manipulate objects of sight from the controller's view.
The other option is to set the onClick of IWDLinkToURL but I found its implementation.
Thank you very much!
Hi,
You can achieve this by using iframe UI element of WD.
Bind the URL of iframe to a context value attribute.Initially keep the iframe invisible, On required action : Set the attribute value to the url of cachedExcelResource and make the iframe visible.
Regards
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The source property of the IFrame is the URL of the resource created. By making the setter, change its visibility to true. The effect is that asks me to download the file in a popup in the top of the window. When I say yes only refreshes the current window without letting the file download.
What do I do? Thank you very much for your help.
check if the file is generated correctly.
try below code :
File f = new File("abc.xls");
--logic to write data in file f----
FileInputStream excelCSVFile = new FileInputStream(f);
cachedExcelResource=getCachedWebResource(
excelCSVFile, fileName,
WDWebResourceType.getWebResourceType( "xls", "application/ms-excel"));
---- method---
private IWDCachedWebResource getCachedWebResource(
InputStream file,
String name,
WDWebResourceType type)
{
IWDCachedWebResource cachedWebResource = null;
if (file != null)
{
cachedWebResource = WDWebResource.getWebResource(file, type);
cachedWebResource.setResourceName(name);
}
return cachedWebResource;
}
Regards
Deepak
Also regarding IWDResource interface, I do not recognize it. It gives me syntax error. Where should I include to use it?
The package is com.sap.tc.webdynpro.services.sal.datatransport.api IWDResource and IWDResourceFactory, but in this I get only the interfaces IWDInputMassDatasource and IWDOutputMassDatasource
Edited by: Daynet1840 on Feb 3, 2011 3:21 PM
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.