ClosedXML.Report
ClosedXML.Report copied to clipboard
Data format questions.
The format for sending data to a closedXML template is a bit confusing to me.
In the Flat tables docs there's a sample for a template with header info and data from a list for the report, but I don't see where the list is connected to the template.
I'm trying to use data that I'm placing in a list - how should everything be formatted in an object?
I built an object like this
public class AllocationExportData { public List<AllocationExportItem> AllocationList { get; set; } public string Host_custname { get; set; } public string Host_custaddr { get; set; }
}
it finds the "host" values, but the ones in the list don't get find when I use item.(fieldname)
I'm either setting up something wrong, or caling the names wrong - which is it?
Attach your template please
Attached. SolAlloc_AOBC.zip
Details on list structure:
public List<AllocationExportItem> AllocationList { get; set; }
public class AllocationExportItem
{
public string KY_ENROLL { get; set; }
public string TX_CUSTOMER_NAME { get; set; }
public string TX_UTILITY_ACCOUNT { get; set; }
public string KY_UTILITY_NAME { get; set; }
public string TX_SERVICE_LINE_1 { get; set; }
public string TX_SERVICE_LINE_2 { get; set; }
public string TX_SERVICE_CITY { get; set; }
public string KY_SERVICE_STATE { get; set; }
public string TX_SERVICE_ZIP { get; set; }
public string ALLOCATION_PERCENT { get; set; }
public string ALLOCATIONKWH { get; set; }
public string ALLOCATION_SCALING_FACTOR { get; set; }
public string ALLOCATED_PERCENT_IN_FARM { get; set; }
}
Progress! I missed the bit about naming a range for the table. I did that and I got data. new file attached. SolAlloc_AOBC.zip
However, the data is loading to the sheet across, and not down. So there's still something off, not sure what.
I recommend you read the documentation Here describes how to properly build a template for flat tables.
Right now you need to expand the range of AllocationList to A17:J18
@VBartilucci do you need any more help or I can close the issue?