Export to Excel related errors

2 posts, 0 answers
  1. om
    om avatar
    1 posts
    Member since:
    Jul 2009

    Posted 05 Feb 2010 Link to this post

    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?
  2. Vlad
    Vlad avatar
    11100 posts

    Posted 08 Feb 2010 Link to this post


    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,
    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.
Back to Top