score:0

Accepted answer

i am not sure how to export chart report to pdf and csv format with chartnew.js?

since you've put csv, i presume you mean the data and not the chart.

for csv, you can easily generate the file based on https://www.rfc-editor.org/rfc/rfc4180 with mostly string concatenation and wrapping. you could also do the same thing on the client side using data uris (see how to create a file in memory for user to download, but not through server?)

for pdf, it might be easier to use a library. for .net, best server-side .net pdf editing library should give you a good solution. there is also a java version of it.


if you are looking to export the chart as well, csv does not support this.

for pdf, you could export your canvas to a data uri (see https://developer.mozilla.org/en-us/docs/web/api/htmlcanvaselement/todataurl) and use a client side library like jspdf (see how to add image in jspdf? for an example) or do the same thing on the server using itext / itextsharp (see inputting image data to pdf with itext)


Related Query

More Query from same tag