cancel
Showing results for 
Search instead for 
Did you mean: 

Download functionality - XLS file is not in recognizable format.

Former Member
0 Kudos

Hi,

I wrote the following code for download functionality in webdynpro for Java.

IWDResource resource = wdResourceFactory.createResource(fileContent.getBytes("UTF-16","Test.xls";,WDWebResourceType.XLS)

I am using the format UTF-16 because I have some german text which is not getting recognized in UTF-8.

When I click on download button, I get a popup which asks whether the user wants to "Open", "Save" or "Cancel". On clicking "Open", I get a message -

The file is not in a recognizable format.

> If you know the file is from another program which is incompatible with Microsoft Office Excel, click Cancel, then open the file in its original application. If you want to open the file later in Microsoft Office Excel, save it in format that is compatible, such as text format.

> If you suspect the file is damaged , click Help for more information about solving the problem .

> If you still want to see what the text is contained in the file. click OK. Then click Finish in the Text Import Wizard.

If I click on OK the Excel opens and proper data is shown.

The highlighted message comes only when I use UTF-16, but does not come when I use UTF-8.

My question is how do I get rid of the above highlighted message?

Best regards,

Nakul

Edited by: Nakul Rajurkar on Mar 16, 2009 1:12 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi

You r trying to change the format of xls file thats why getting message like incompatible with Microsoft Office Excel.

It would be better first download xls functionality with its original source and then try to convert is for UTF-16.

Best Regards

Satish Kumar