<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export To Excel - Null Reference Error in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411688#M10687</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that did the trick&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It allowed me to download the file, but when I open the csv file it displays the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;File is in a different file format than specified by the extension&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16756[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Excel has detected that the file is a SYLK file, but cannot load it, either the file has errors or is not in SYLK format&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16757[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the above messages, the file opens and looks fine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would the errors be caused by the REST service data not being in correct format? The script trying to conform to the csv format? or something else that you may have run into.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Aug 2012 20:11:28 GMT</pubDate>
    <dc:creator>GreggBreton</dc:creator>
    <dc:date>2012-08-07T20:11:28Z</dc:date>
    <item>
      <title>Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411682#M10681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I downloaded the following solution file &lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://forums.arcgis.com/threads/45538-How-to-make-Export()-is-work-with-ArcGIS-API-for-Silverlight" rel="nofollow" target="_blank"&gt;http://forums.arcgis.com/threads/45538-How-to-make-Export()-is-work-with-ArcGIS-API-for-Silverlight&lt;/A&gt;&lt;SPAN&gt;!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Export.zip&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;QueryWithoutMap.zip&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executed and&amp;nbsp; queried the default "New" clicked the export button and works fine&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then tried "S", returned records and tried to export and received "Null Reference Exception"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use the new keyword to create an object instance&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check to determine if the object is null before calling the method&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; private static string GetValue(FrameworkElement frameworkElement)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If someone could illustrate how the above would be written to avoid the null exception error&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2012 20:30:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411682#M10681</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-03T20:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411683#M10682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Gregg- &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

private static string GetValue(FrameworkElement frameworkElement){ return frameworkElement is TextBlock &amp;amp; (frameworkElement != null) ? (frameworkElement as TextBlock).Text : frameworkElement.ToString();}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This should trap if your frameworkElement is NOT null&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411683#M10682</guid>
      <dc:creator>deleted-user-ATjHIWsdQYmT</dc:creator>
      <dc:date>2021-12-11T18:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411684#M10683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrew -&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I still receive the same Null Exception?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2012 00:06:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411684#M10683</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-04T00:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411685#M10684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private static string GetValue(FrameworkElement frameworkElement) { &amp;nbsp;&amp;nbsp;&amp;nbsp; return frameworkElement == null ? null &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; :( frameworkElement is TextBlock ? (frameworkElement as TextBlock).Text : frameworkElement.ToString()); }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 07:54:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411685#M10684</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2012-08-07T07:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411686#M10685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nothing incorrect about the above code but I think this is a bit easier to read and I think should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static string GetValue(FrameworkElement frameworkElement)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var textBlock = frameworkElement as TextBlock;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( textBlock == null ) return null;


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return textBlock.Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:41:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411686#M10685</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T18:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411687#M10686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that did the trick&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It allowed me to download the file, but when I open the csv file it displays the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;File is in a different file format than specified by the extension&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16753[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Excel has detected that the file is a SYLK file, but cannot load it, either the file has errors or is not in SYLK format&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16755[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the above messages, the file opens and looks fine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would the errors be caused by the REST service data not being in correct format? The script trying to conform to the csv format? or something else that you may have run into.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 19:50:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411687#M10686</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-07T19:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411688#M10687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, that did the trick&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It allowed me to download the file, but when I open the csv file it displays the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;File is in a different file format than specified by the extension&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16756[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Excel has detected that the file is a SYLK file, but cannot load it, either the file has errors or is not in SYLK format&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]16757[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After the above messages, the file opens and looks fine. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would the errors be caused by the REST service data not being in correct format? The script trying to conform to the csv format? or something else that you may have run into.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Dominique&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 20:11:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411688#M10687</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-07T20:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411689#M10688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Yes, that did the trick&lt;BR /&gt;&lt;BR /&gt;It allowed me to download the file, but when I open the csv file it displays the following:&lt;BR /&gt;&lt;BR /&gt;File is in a different file format than specified by the extension&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]16756[/ATTACH]&lt;BR /&gt;&lt;BR /&gt;Excel has detected that the file is a SYLK file, but cannot load it, either the file has errors or is not in SYLK format&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]16757[/ATTACH]&lt;BR /&gt;&lt;BR /&gt;After the above messages, the file opens and looks fine. &lt;BR /&gt;&lt;BR /&gt;Would the errors be caused by the REST service data not being in correct format? The script trying to conform to the csv format? or something else that you may have run into.. &lt;BR /&gt;&lt;BR /&gt;Thank you Dominique&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gregg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Check out this link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.microsoft.com/kb/323626"&gt;http://support.microsoft.com/kb/323626&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your first&amp;nbsp; field name is "ID", try trapping it in your export code by changing it to "id" or adding an apostraphe like the article says.&amp;nbsp; Another workaround would be to hide the "ID" field from your map service unless it's necessary.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 21:56:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411689#M10688</guid>
      <dc:creator>deleted-user-ATjHIWsdQYmT</dc:creator>
      <dc:date>2012-08-07T21:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411690#M10689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I will follow up on thread and give it a try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Aug 2012 22:38:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411690#M10689</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-07T22:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411691#M10690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I will follow up on thread and give it a try&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gregg, Quick solution - change the Header text of the first column from "ID" to something else.&amp;nbsp; It'll solve the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 13:46:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411691#M10690</guid>
      <dc:creator>deleted-user-ATjHIWsdQYmT</dc:creator>
      <dc:date>2012-08-08T13:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Export To Excel - Null Reference Error</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411692#M10691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just changed ID to id and it worked fine&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That will do it....Thank you&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 19:27:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/export-to-excel-null-reference-error/m-p/411692#M10691</guid>
      <dc:creator>GreggBreton</dc:creator>
      <dc:date>2012-08-08T19:27:21Z</dc:date>
    </item>
  </channel>
</rss>

