-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to 7.1 ExcelRange.LoadFromCollection error: The Order property has not been set. Use the GetOrder method to get the value. #1395
Comments
@TheQuake - thanks for reporting. EPPlus does not throw an Exception with this message from what I can see. It seems to come from the Can you provide some more information that might help us to replicate this issue? The code for the |
@swmal - Thanks! It's a POCO that had an attribute over a single read-only (get only) property, specifically: ( [Display(Name = "Product")] ). Since the exception was related to annotations, I removed it & voila, it works now. I don't need that decoration, but if you wish to pursue this further, let me know. |
I encountered the same issue and was able to work around it with the following code: MemberInfo[] listeMembers = (from MemberInfo x in typeof(T).GetProperties() select x).ToArray();
ws.Cells["A1"].LoadFromCollection<T>(list, true, null, BindingFlags.Default, listeMembers); It seems that the problem occurs with the [Display(Name = "No.", Order = 1)]
public string No { get; set; } Otherwise, an exception is thrown. I think the exception is throw here :
when i refer to DataAnnotations doc : https://github.com/dotnet/runtime/blob/5535e31a712343a63f5d7d796cd874e563e5ac14/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/DisplayAttribute.cs#L254 |
EPPlus usage
Noncommercial use
Environment
Windows IIS
Epplus version
7.1.0
Spreadsheet application
Excel
Description
Update to 7.1 ExcelRangeBase.LoadFromCollection error: The Order property has not been set. Use the GetOrder method to get the value. The changelog specifically mentions an ExcelRangeBase.LoadFromCollection improvment. What needs to be changed?
The text was updated successfully, but these errors were encountered: