Comments (3)
Hi,
you need to define a POCO first, such as :
public class Order
{
public string OrderNumber { get; set; }
public DateTime CreationTime { get; set; }
public State State { get; set; }
// ...
}
In your case, since you already have a datatable, you may go with NPOI API directly without the mapper.
Just get value from datatable and set value with "Cell.SetValue()" in loops.
This mapper is about to do the mapping between strong-typed objects and the data source(Excel file), but datatable here is kind of data source, so just go directly with NPOI api between these two types data srouces.
from npoi.mapper.
Due to my business requirements, the exported data is user configurable export fields, so model cannot be used.
But I need a mapper, so that it is more convenient to handle the conversion of values, etc.
When using npoi API directly, there is no mapper, which is very inconvenient.
from npoi.mapper.
So mapper is not going to save you here. Either define a DTO type to do the mapping or export the data in the database as Excel directly.
from npoi.mapper.
Related Issues (20)
- Header name containing underscore HOT 1
- Is there a way to auto detect header row and data rows? HOT 1
- Method not found: 'Void NPOI.SS.UserModel.IWorkbook.Write(System.IO.Stream)'. HOT 6
- FR: Better error handling: "Returned failure by custom cell resolver"
- Npoi.Mapper - excel file mapping hanged. HOT 1
- Put method with overwrite 'True' clears cell styling.
- 如何向读到的dynamic里添加列 HOT 1
- 连续读取的问题 HOT 1
- target net6 and upgrade to NPOI 2.6.0
- 如何在用Npoi.Mapper导出数据的时候,设置表格自定义样式呢? HOT 2
- 表头不固定的时候如何处理导入和导出 HOT 1
- Create a new release based on NPOI 2.6.1 HOT 1
- Reintroduce support for .NET Framework (with at least .NET 4.7.2) HOT 1
- Why is there always one line missing?
- Blank cells return empty string after changes in commit 684dbc9af67eecd0ffd291556709f6bf57a86665 HOT 1
- 怎么读取图片 HOT 2
- Export Boolean properties to excel is not posible
- System.OutOfMemoryException in Azure HOT 1
- DataFormatter.FormatCellValue does not support CONCAT function HOT 5
- Unable to map date to DateOnly datatype HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from npoi.mapper.