How do i download pdf as same as it is displaying the application?

How do i download pdf as same as it is displaying the application?

MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

Hi all,
I am a newbie to this forum and am working on data tables export. I want to make PDF and print task for my project. For my task, I need to show the same count as in the application to the print paper and as well as pdf.


I have shared a screenshot. In the first screenshot, am showing only 10 persons so I want to show only that 10 persons in the print and PDF. How can I make it? Can anyone help me on this?

Thanks in advance.

This question has accepted answers - jump to:

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @MuraliVenkat ,

    Take a look at this thread, it's discussed and resolved there.

    Cheers,

    Colin

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin
    Answer ✓

    Use the modifier option of the exportOptions option in the pdfHtml5 button type to control the records being exported:

    {
      extend: 'pdfHtml5',
      exportOptions: {
        modifier: {
          page: 'current'
        }
      }
    }
    

    Allan

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0
    edited June 2018

    Hi @colin and @allan
    Thanks for your reply. It worked for the current page that is visible but I have some 10 pages means what should I do? In print section it is showing only the current page.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    I'm confused now - weren't you asking for only the current page to be printed? Isn't that what you wanted?

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

    @colin
    In the first screenshot, it has 6 pages and I have to display all six pages record exactly, in the same manner, it is displaying in the application. Forex: Every page contains 10 records so i have to show 10 records on every page for print as well as pdf.

  • allanallan Posts: 61,439Questions: 1Answers: 10,053 Site admin

    Thanks for the clarification. I'm afraid that is not something that the PDF export is currently capable of doing. You'd probably need to send the data to a server which can generate the PDF output you want.

    Allan

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

    @allan
    Thanks for the quick reply. I will find the solution.

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

    @allan
    What about print? Can we have any options to do it for the print page?

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

    Hi @allan and @colin
    I have a problem like I am calculating total amount for every page and Grand total and displaying it. It is showing correctly on the web page but if I give a print, Every page is displaying the same total. I have added a screenshot for your reference. Can you please help me with this? Thanks in advance.



  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • MuraliVenkatMuraliVenkat Posts: 14Questions: 5Answers: 0

    Hi @colin
    Thank you for the reply. I have already attached 4 screenshots for your reference, First two screenshots are after we give the print option and they are displaying the same total in all pages(Check the below total) and last two screenshots are from the browser. If you check the totals it is displaying correctly in the page-wise.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    edited June 2018

    Hi @MuraliVenkat ,

    Yep, thank you for those screenshots, but it's impossible to diagnose what's wrong with code by looking at a screenshot of the results. As I said, we're happy to help, but we need to see a running test case that shows the problem so we can offer a solution,

    Cheers,

    Colin

This discussion has been closed.