iTextSharp pdf to print from datatable
iTextSharp pdf to print from datatable
wijwij
Posts: 54Questions: 12Answers: 0
in DataTables
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
This discussion has been closed.
Answers
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
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
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
Thanks colin