Hi~I used a Microsoft Office Open XML SDK 2.0 to make a Excel File.And I tried to export a Grid to the Excel file.But ArgumentOutOfRangeException was occurred.The exception message is "Index was out of range. It must be non-negative and less than the size of the collection".It may be Target of Relationship.The Target' value is "/xl/worksheets/sheet.xml".Is it right?please help me. What should I do?thanks~~
p.s : I was called UltraGridExcelExporter.Export() method to export a grid data.
There's not much information here to go on. The sample you attached here appears to be an ASP.Net application. So are you exported a WebGrid to the xlsx file?
Also, I don't see any xlsx files in your sample. Are you trying to export the grid into an XML file? I don't believe that will work.
I am sorry for my delayed answer.
I use a WinGrid. And I exported a WinGrid to a Excel.
You can find a excel file, if you remove a Zip extension from the attached file(sample.xlsx.zip).
"Sample.xlsx" is a excel file. It's a Office 2007 format.
thank you~
Hi,
Okay, so I see that the file you attached appears to be an empty xlsx file. But I'm still not clear on what's going on or what the problem is. Are you trying to open this file and then export a grid into it? What does the code look like?
It would be very helpful if you provided a sample project demonstrating the exception you are getting.
Hi
I attached a sample project.
This project is made by VS 2008 and use Open XML SDK 2.0 to make a excel file.
Thank you for your help~
http://msdn.microsoft.com/en-us/library/bb456488.aspx
http://www.microsoft.com/downloads/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en
I really don't want to install the Microsoft Office Open XML SDK 2.0 on my machine. So I took your original xlsx file and tried to use your sample to export the grid into it, and I do seem to be getting the same Exception you are getting.
The error I get appears to indicate a problem with the packaging of the xlsx file. Our Excel assembly is using Microsoft's Packaging to unpack the file and it's hitting an exception in the PackageConformanceManager, which seems to indicate a problem with the xlsx file itself.
I'm going to forward this over to Infragistics Developer Support so they can write this up and have the developers take a look at this just to be sure. But it seems to me that this is probably an issue with the Open XML SDK not properly packaging the file.