Web Connection
HtmlDataGrid Export to CSV and PDF
Gravatar is a globally recognized avatar based on your email address. HtmlDataGrid Export to CSV and PDF
  Kathy
  All
  Apr 7, 2021 @ 04:47pm

Hello,
I'm using HtmlDataGrid with pagination on a webpage and I need to add buttons for exporting and downloading the grid data to CSV and PDF files.

Before I go further, I would like to know if there's any built-in or recommended solution for adding these features.

Also, for the PDF format and printing, is there any way so I can have the HtmlDataGrid with the same look and formatting for the table, headers, colors, etc. in the result PDF file?

Thank you in advance,
Kathy

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Export to CSV and PDF
  Rick Strahl
  Kathy
  Apr 7, 2021 @ 05:03pm

There's nothing built in for that and HTML->PDF isn't really a good match.

You can use wkhtmltopdf which is an external EXE that can take a Web page and turn it into a PDF. I use this in Markdown Monster to generate PDF output from Markdown generated HTML.

It works but it's a large EXE that has to be externally executed and has to run against a file (or URL) to create the output.

CSV is probably easier - you can generate that directly from your data - you don't need the HTML for that.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: HtmlDataGrid Export to CSV and PDF
  Kathy
  Rick Strahl
  Apr 9, 2021 @ 08:54am

Thank you so much for the hints and tips.
Kathy

© 1996-2024