there is a error in export(workbook)

5 posts, 0 answers
  1. jafar
    jafar avatar
    9 posts
    Member since:
    Feb 2013

    Posted 07 Apr 2013 Link to this post

    Hello
    I have a error in export:
    my code :
                var formatProvider = new XlsxFormatProvider();
                return formatProvider.Export(workbook);

    and error:

    {"The given key was not present in the dictionary."}

       at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
       at Telerik.Windows.Documents.Spreadsheet.Core.DataStructures.QueueDictionary`2.get_Item(TKey key) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Documents\Spreadsheet\Core\Core\DataStructures\QueueDictionary.cs:line 64

    thanks

  2. Kammen
    Admin
    Kammen avatar
    312 posts

    Posted 08 Apr 2013 Link to this post

    Hello Jafar,

    Is it possible to provide more information how to reproduce this issue. We need information about your setup and the steps you've executed in order to investigate the problem and fix it as soon as possible.

    All the best,
    Kammen
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. sai
    sai avatar
    10 posts
    Member since:
    Apr 2014

    Posted 24 Mar 2015 in reply to Kammen Link to this post

    Even I'm getting the same exception... I'm using latest dlls
    Please find the attachment to reproduce the issue
    Rename the extension from png to Xlsx
  5. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 27 Mar 2015 Link to this post

    Hi Sai,

    We tested the file you sent us and noticed that some of the number formats which it contains are not from the built-in ones and are not declared (its formatCode is not specified), which is the cause of the behavior. If you unzip the file and open the styles.xml part, you will find there is a list of elements similar to this one:
    <xf numFmtId="44" fontId="1" fillId="0" borderId="0" applyFont="0" applyFill="0" applyBorder="0" applyAlignment="0" applyProtection="0" />

    Some of these elements refer to definitions of formats which are not in-built, but are not defined in the file either. The missing definitions are for the following number formats' IDs: 41, 42, 43 and 44. You can either remove those elements or you can add definitions for them. You can refer to the snippet below which shows how to add the format code for a number format:
    <numFmts count="1">
      <numFmt numFmtId="44" formatCode="[here goes the format code for this number format]"/>
    </numFmts>

    Unfortunately, since we are not sure how the file was generated, we don't know what the missing format strings are.
     
    For reference, you could check this MSDN thread where the built-in format codes are discussed.

    However, this file is quite strange and it will be great if you share how it was produced.

    Regards,
    Tanya
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  6. sai
    sai avatar
    10 posts
    Member since:
    Apr 2014

    Posted 30 Mar 2015 in reply to Tanya Link to this post

    Thanks a lot Tanya for your Reply.
    We use Aspose Cells(Third party Tool for Exporting and updating Excel content) from which we generated this Excel.

    Thanks,
    sai
Back to Top
DevCraft banner