iTextSharp pdf to print from datatable

iTextSharp pdf to print from datatable

wijwijwijwij Posts: 52Questions: 11Answers: 0

Hi,

I have data brought from different tables and I want to use iTextSharp pdf to generate a custom report
I have finished writing the c# methods in the code behind but not sure how to send the generated report from code-behind to the print button inside the datatable

any help is appreciated

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I suspect you'll need a custom button, which then triggers your code to generate the PDF. You could use the DataTables API, calls like rows().data() which you then feed into your iTextSharp code.

    Colin

  • wijwijwijwij Posts: 52Questions: 11Answers: 0

    Thank you, Colin

    Yes, indeed, I have my custom button built and when testing it is activated and shows a sample message.
    But what I want is when clicking this button to open the pdf file that I built using ITextSharp in the code behind.
    How to call this method?
    I tried ajax but it does not work

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    I don't know anything about ITextSharp so I can't comment there. The buttons action function just gives you a hook to place your code to do custom operations. It would be worth searching the web for how to do the opening of a file, as it's not specific to DataTables. Pages like this may help,

    Colin

  • wijwijwijwij Posts: 52Questions: 11Answers: 0

    Thanks colin

This discussion has been closed.