This is a migrated thread and some comments may be shown as answers.

Export to Excel related errors

1 Answer 59 Views
Menu
This is a migrated thread and some comments may be shown as answers.
om
Top achievements
Rank 1
om asked on 05 Feb 2010, 08:08 PM
I am exporting content in Telerik Grid using ToExcelIML(), which works all fine, then, the output from ToExcelIML(), I send that data to server and the from server I change the response as:

Response.ContentType = "application/vnd.ms-excel";  
Response.AddHeader("Content-Disposition", "filename=Report.xls;attachment"); 

This gives user an option to either open excel file or save it. If user opens it directly, without saving the file first. Excel opens up with a message:
"The file you are trying to open, 'Report[1].xls', is in 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?"
options provided by message box: [Yes] | [No] | [Help].

  • Why does excel think that format is not right, is there something wrong with the xml generated by ToExcelIML() function?

After I click on [Yes] button in message box, file opens up fine, headers with filter options.
Now, if I try to insert "Pivot" on this spread sheet. By selecting few cells and rows with/without headers and then selecting "Insert"->"Pivot" as soon I press [Ok] on Dialogbox to confrim my Pivoting, I see this error:
"Datasource reference is not valid", but If I save this file on desktop and reopen it then pivoting works all fine:

  • Any clue what would cause this error?

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 08 Feb 2010, 06:58 AM
Hi,

You get this warning since the default MS Excel format is XLSX (Open XML). I'm not sure however about the pivot - maybe the issue again is the file format (Excel will reformat the document once you save it).

All the best,
Vlad
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Menu
Asked by
om
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or