Jump to content
Software FX Community

Export to XML not working


Recommended Posts

Hi Guys,

I'm trying to export a chart to xml.  In 6.2, the export works fine, however when I use the same code to export my chart in 7 I get the following error:

"Index (zero based) must be greater than or equal to zero and less than the size of the argument list."

The code I'm using is the one based on the examples:

mChart.Export(FileFormat.Xml, @"C:\mychart.xml");

Not sure if there's anything else that needs to be set up in in 7 for the export to work.  Exporting the same chart as a binary works fine.

my chart version is 7.0.2893.24916

Part of the exported file is shown below:

      <STUDYUCL type="ChartFX.WebForms.Statistical.StudyConstant">         <TEXT>UCL</TEXT>         <ID>43782</ID>         <VISIBLE>True</VISIBLE>         <LINEWIDTH>1</LINEWIDTH>         <SHOWLABEL>True</SHOWLABEL>       </STUDYUCL>     </ITEM8>     <ITEM9 type="ChartFX.WebForms.Statistical.NPChart" assembly="ChartFX.WebForms.Statistical, Version=7.0.2893.25240, Culture=neutral, PublicKeyToken=a1878e2052c08dce">       <STUDYMEAN type="ChartFX.WebForms.Statistical.StudyConstant">         <ID>43780</ID>         <VISIBLE>True</VISIBLE>         <LINEWIDTH>1</LINEWIDTH>         <SHOWLABEL>True</SHOWLABEL>       </STUDYMEAN>       <STUDYLCL type="ChartFX.WebForms.Statistical.StudyConstant">         <TEXT>LCL</TEXT>         <ID>43781</ID>         <VISIBLE>True</VISIBLE>         <LINEWIDTH>1</LINEWIDTH>         <SHOWLABEL>True</SHOWLABEL>       </STUDYLCL>       <STUDYUCL type="ChartFX.WebForms.Statistical.StudyConstant">         <TEXT>UCL</TEXT>         <ID>43782</ID>         <VI

You can see where the export fails.  I do have the statistical extensions applied.  I have also tried using mChart.Extensions.Clear() as mentioned in the forum but still ended up with the same result.

Can someone point me in the correct direction?


Link to comment
Share on other sites

 Another question is that when exporting to binary, the titles aren't displayed when the binary file is imported back.

On save i used:

mChart.FileContents = mChart.FileContents | FileContents.TitlesText;  // defaults to all but not including titlestext so need to add

mChart.Export(FileFormat.Binary, filename);

 on import is used:

mChart.Import(FileFormat.Binary, filename);

Any ideas?


Thanks in advance


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...