Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about to add print option, and also set header text and footer text options? #145

Open
arivera12 opened this issue Feb 11, 2017 · 6 comments

Comments

@arivera12
Copy link

Something like $('#tableID').tableExport({type:'print'}); would be nice to add. I think you should consider printing also an export option.

Consider this plugin to achieve this easily:
jQuery.print;

Also when we are working with some type of document lets say like DOC, PNG or PDF. If the table don't have any title on it, or the document name doesnt match the exported data, the table could become a little meaningless I think. I think it would be nice to add an option to add html on the header and footer of the table with something like this only just for DOC, PNG or PDF and Print (if u add it).

image

$('#tableID').tableExport({
type:'print', 
header: '<div class="text-center">Title Here<div>',
footer, '<small>Special Footer Here</small>'
});
@hhurz
Copy link
Owner

hhurz commented Feb 12, 2017

Thanks for your suggestion, its quite interesting. But I'm not sure if a export plugin should realy print its output. Aren't export and print concurrent functionallities? Especially considering that both plugins (tableexport and print) can be included and called without a big effort. Regarding jQuery.print: this plugin prints any dom element conatined in a browser window or frame. As I understand it, you can't feet it with text or string content that you want to print, Everything must exist inside dom. On the other hand the tableexport plugin itself parses the dom (html table element) and produces format dependent output. Considering how both plugins work, I can't see how you can bring them together.

I'll take your other suggestion, to add an optional header/footer to a html table before it will be exported, into consideration and put your suggestion on to my (growing) list of feature requests. Thanks.

@arivera12
Copy link
Author

I have made a bootstrap base toolbar that works very well with your plugin take a look of it.
image
Your plugin its a must fo any system's core. Helps to take off a lot of effort for exporting options. You can find table export on any system or software where data management is everywhere. The header and footer options I think could fit only DOC, PNG or PDF. The other exports options I don't really think we need this options.

@schutze
Copy link

schutze commented Sep 27, 2017

I like the option of optional header and footer text but I think it should also apply to Excel. Some old, defunct code I used in the past had this feature and I miss it because, as @arivera12 describes, it helps provide context to the output file.

@arivera12
Copy link
Author

If anyone is interest on this option using jQuery.print goes like this:
jQuery("table").print({ stylesheet: "css/my-stylesheet" });

@maikosantos
Copy link

maikosantos commented Mar 22, 2018

Hello,

I am with a problem! When I use the checks to export the datatable, the last row not is print. The footer is work perfect, but last row is not work. How I can resolv this problem?

This problem occur always that not check all options in datatable.

table

@davidbarman
Copy link

Has a Title feature been added since this post was created?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants