简体   繁体   中英

how to export datagrid to .xls AND/OR .pdf?

i need to export a datagrid to excel and pdf however i can't do that through a reportviewer because i don't have a database, i set manually the values of my datagrid. Is there a way to do that, preferably without a third party library. thanks in advance!

if you can't use reportviewer, maybe you can try for:

  1. XLS: NPOI http://code.google.com/p/npoi/

  2. PDF: PDFSharp or MigraDoc http://www.pdfsharp.net/

ReportViewer doesn't need a database. It can be run in Local Processing mode. If you care about formatting, this is absolutely the best way. For excel with no formatting you could output a CSV file, but writing a PDF without a third party library is going to be a challenge.

You can have a look at this article .

It's about export to pdf, word, excel...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM