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
Exporting table to pdf with columnDefs styling applied #180
Comments
Hey @sandsmichael , sorry the buttons are not yet available. They require a very significant change in how we implement Can you tell us a bit more about the context in which you would like to use the pdf export? Thanks |
Thanks for the quick response. For starters, the package is amazing so thanks for all of your hard work. The use case is really for greater accessibility/sharing. itables provides excellent functionality for presenting one's work with in Jupyter. But this assumes only other developers will be interested in the resulting output. the interactive tables and customized styling makes for a better user experience when exploring data within the notebook, but it precludes the ability to be able to leverage that effort outside of the notebook. If a user want's to utilize python to conduct their analysis, for whatever reason, knowing that time spent on building out itables will always be self-contained within the notebook itself might discourage a user from working with the tool in the first place....and that's a shame. The same user may pivot to just writing and styling excel files directly to get to a pdf's, while either still maintaining code for the itables or forgoes using itables altogether. Either way, it's extra work for the same result and the developer is forced to take a suboptimal route. itables provides a better experience for users exploring data with in Jupyter, but in my opinion, would be missing out not to provide the same users the ability to leverage/share their work with a non-technical audience. I would point to functionality such as "ReportBuilder" within PowerBI as one example of this use case. That being said, I really enjoy using this tool and appreciate your consideration for this enhancement. |
Hey @sandsmichael , thank you for providing more information about how you use/ would like to use the package. Well personally I do care a lot about making sure that the notebook can be turned into a report. However You can currently convert your notebooks to HTML documents using either
Currently the conversion to PDF using Even with the default Pandas representation it does not seem that obvious to convert a dataframe to a PDF - see this SO question. Maybe we could try to combine that with the I have two additional questions for you:
|
Fair point, supporting html output is still helpful, as the file, or even a screenshot of it could ultimately be saved as a pdf. Enabling toolbar buttons to be able to both export the raw data to an excel file, as well as export the html styled tabled to an html file would both be big strides in the right direction. The issue with converting the entire notebook is that I may be only interested in a specific section at a time for a given report. Response to questions:
|
Hey @sandsmichael , sorry for the long delay in answering. So, if you are willing to export a table to an HTML document, you can use
For an example:
|
Hey @sandsmichael , the DataTables extensions are now supported in ITables v2! The PDF button is not included by default, because the required PDF library makes the bundle much larger, however I have documented at https://mwouts.github.io/itables/custom_extensions.html#creating-a-custom-datatables-bundle how to create a bundle with the PDF export. Do you want to give it a try? |
Are buttons supported to be able to export the table to a pdf? I see an open issue but no instructions on how to enable via the docs.
ITables 2.0 - update datatables.net to 1.13.1 and provide support for buttons #121
Would it be possible to include the custom styling applied to the table when exporting to a pdf?
The text was updated successfully, but these errors were encountered: