Invoice with PDF
Invoice with PDF
The link is:
https://justjammu.com/invoice/invoice_dev.html
1) When I click on PDF it should generate all information including logo as well. All details that should include "From : Dynofy" "To: John Doe" .. From header to Bottom but it is generating blank PDF.
2) Also, "No data available in table" is displaying that should also not come. I have used:
ordering: false,
searching: false,
paging: false
But still "No data available in table" is displaying
3) The table id=invoice, Is it mandatory the tag should be Table and NOT the div?
Replies
See this example for adding messages to the export. For example use a function for
messageTop
to get the To and From, etc to populate the PDF.On line 131 you have this:
I suspect this should be a
div
not atable
. Move theid="invoice"
to thetable
defined on line 173:See the
layout
docs for how to remove the default elements.The selector used to initialize Datatables doesn't need to be an ID but it needs to find a
table
element not adiv
. See the initializing Datatables doc for more details.Kevin
I have used TopStart only. Also If I moved Id=invoice to table tag at line no. 173 then it is working fine that I have tested it already. But I want the entire Template should come in the PDF and not just the amount detail.
Entire page and not just one line message. For instance, the html page is a template and entire content should come in the PDF and not just one line with "messageTop"
Take a look at the default settings link I provided. If you want to remove the default search for example then add
topEnd: null
.Datatables supports exporting the
table
data only. You can use thecustomize
function, as described in the PDF docs, to customize the output.Maybe use the browser's Print option and save to PDF.
If you want a PDF button to export the whole page top PDF then you will need to find another client side solution to supports this. I don't know of any to suggest.
Kevin
Use Print button and then save as to PDF that doesn't look good. That is the last resort.
If I can use two table tags ? Then Is it possible? One table tag for Content and other table tag for Invoice detail?
Datatables supports exporting only the table button is associated with. You would need to use the PDF
customize
to combine a second table into the export. See this example of adding an image to the export using thecustomize
function.Kevin