on 08-09-2010 8:55 AM
Hi All,
I used the below blog
/people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
to code the download to excel functionality. Download functionality is working fine but I got the exception as below everytime.
Error in getCachedWebResoucre method: you must flush before accessing the resource content.
I searched in SDN for this error and found the thread
which gave me a resolution to get rid of the deprecated method. However on using this I am unable to download the excel file and everytime on trying to open the file I get this error below
"The file you are trying to open, "abc.xls", is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
"
And when I open the file, I am not seeing any data. Any idea on how to get rid of this?
Thanks,
KN.
Code fix done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
Please check this link -- step by step procedure : Export to excel , verify if you code changes
you can also go through the below link , where you find the Export to Excel Project provided by SAP , you can use
import the project and use the Project component directly in your project and make the changes as per you requirement
instead of writing new piece of code .
http://wiki.sdn.sap.com/wiki/display/Snippets/WebDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
try using the IWDResource instead of CachedWebResoucre:
FileInputStream newFile = new FileInputStream();
IWDResource cachedExcelResource1 = WDResourceFactory.createCachedResource(newFile, "NewFile", WDWebResourceType.XLS, false);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.