Invoice with PDF

Invoice with PDF

Omar TweetOmar Tweet Posts: 22Questions: 0Answers: 0
edited April 19 in Free community support

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

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    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.

    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.

    Also, "No data available in table" is displaying that should also not come

    On line 131 you have this:

     <table class="panel panel-default invoice" id="invoice">
    

    I suspect this should be a div not a table. Move the id="invoice" to the table defined on line 173:

    <table class="table table-striped">
    

    In this page, I don't want "Search" Button. Also, I don't want Pagination Button.

    See the layout docs for how to remove the default elements.

    The table id=invoice, Is it mandatory the tag should be Table and NOT the div?

    The selector used to initialize Datatables doesn't need to be an ID but it needs to find a table element not a div. See the initializing Datatables doc for more details.

    Kevin

  • Omar TweetOmar Tweet Posts: 22Questions: 0Answers: 0

    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"

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    I have used TopStart only.

    Take a look at the default settings link I provided. If you want to remove the default search for example then add topEnd: null.

    the html page is a template and entire content should come in the PDF

    Datatables supports exporting the table data only. You can use the customize 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

  • Omar TweetOmar Tweet Posts: 22Questions: 0Answers: 0

    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?

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951
    edited April 19

    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 the customize function.

    Kevin

Sign In or Register to comment.