I have a rad grid, which is bound with a collection of object. When I use e.g. string output = radgrid.ToHtml(); it works all fine but when I try to use
string output = radgrid.ToExcelML() it throws a Null Reference Exception and doesn not generate any result at all.
Is there any special way to use radgrid.ToExcelIML() ?
9 Answers, 1 is accepted
Can you send us a bit more info about this exception? You can check this demo where ExcelML export works fine:
http://demos.telerik.com/silverlight/#GridView/Exporting
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I infact followed the steps mentioned in Demo. What I am thinking is or suspicious about is the version of my grid, which is:
Version 2009.2.710.1020
RuntimeVersion: V2.0.50727
Can you please confirm it for me please.
Thanks.
In my previous post, I mentioned the version of grid I am using. If that was not enough then following is the code which I am using:
| //Code in xaml |
| <RadGrid:RadGridView x:Name="radResult" Grid.Row="1" Grid.Column="0" ShowGroupPanel="False" CanUserResizeColumns="True" CanUserReorderColumns="True" AutoGenerateColumns="False" ItemsSource="{Binding Path=Result.Items, Mode=TwoWay}"></RadGrid:RadGridView> |
| //Code in .cs |
| string content = string.Empty; |
| content = radResult.ToExcelML(); <- This method call throws null reference error |
By the way, export to excel doesn't work on your demo site anymore, or didn't work for me atleast. the popup came with error "Un-authorized access". I remember it used to work, but that was before SL3 was released.
I have two suspisions now,
1) This bug is happening may be because, it was developed on SL2 platform, because I am using SL3.
2) The version of the grid I have is not correct.
I will, highly appriciate your attention towards this issue, its been few days now that i am trying to sortout this problem.
We tried to reproduce both issues however without success. The only issue we can confirm for now with ToExcelML() indeed Null Reference exception however with GridViewDropDownColumn with IValueConverter - this issue was fixed and the fix will be available latest today with our latest internal build.
The only option I can suggest you is to send us small project where we can reproduce the exception at your end.
All the best,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
I finally found out where that error was comming from. It was happening when; let say. If were to bind a column with wrong binding name, this would lead the grid to show nothing in that perticular column where binding property for column was wrong.
I caught this issue, when I observed that I had binding error being thrown in output window through Grid. It was almost two weeks ago.
Now, out of no where, I am getting the similar error:
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Application_UnhandledException:
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Windows.Data.TypeExtensions.IsNullableType(Type type)
at Telerik.Windows.Data.TypeExtensions.GetNonNullableType(Type type)
at Telerik.Windows.Data.TypeExtensions.GetNumericTypeKind(Type type)
at Telerik.Windows.Data.TypeExtensions.IsNumericType(Type type)
at Telerik.Windows.Controls.ExportExtensions.GetExcelMLType(Type type)
at Telerik.Windows.Controls.ExportExtensions.GetRowValues(GridViewDataControl source, IList`1 records, StringBuilder& builder, ExportFormat format)
at Telerik.Windows.Controls.ExportExtensions.ToExcelML(GridViewDataControl source, IList`1 records, Boolean includeHeader)
at SolutionQ.Eclipse.Silverlight.Content.Search.ReportResult.Tabs.tabResult.ExportToExcel()
at SolutionQ.Eclipse.Silverlight.Content.Search.ReportResult.Tabs.tabResult.<RadMenuItem_Click>b__2()
This time, I don't see any binding errors being thrown by Telerik Grid. the only error is being thrown is mentioned above at the time of ExporToIML.
There is no trace at all except this, no trace in event viewer. Nothing!!! So, I don't really know, how to drill down into this error any further.
Do you have any recomendation or Idea that how I can get to the source of this error? I have a feeling that this must be because of some property having invalid value or null value, but which one would it be.. its ofcourse not from those properties which are bound to columns. because all of them have values.
I am sorry, that I can't really send you the copy of my project because, its too big and the objects I am using are are extreemly complicated with 5 level of inheritence. So, would take really long only to create a dummny project and try to reproduce this problem over there, which could be then sent to you.
Thanks
OM
Thanks
Can you please check what will be the situation with our latest build? I've checked this method (GetExcelMLType) and I've noticed that now there is a != null check.
Let me know how it goes.
Sincerely yours,
Vlad
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Check out this thread - do you have a uniquename with no data binding? Does it work with toCsv or ToHtml?
Ryan Morgan
www.ArrowDesigns.com
