Display data in a pop-up and print the page

By clicking on a button named " generate report" or "summarize" some sort of pop-up would show summarizing the collected data showing value like average, total, etc... it also comes with a graph. On the corner of the page displaying summarized results there would be a print button to print the summary page

How would I open a new window/tab or some sort of section to display the report? And how would i be able to print it in the same format as it is?

Answers


You can use jQuery UI dialog to create modal popup. Inside of this dialog you can put everithing you need. But if need to pring it - better create in js new window and put information there:

window.open();

To print browser window content just call in onClick for your button:

<input type="button" value="Print" onClick="window.print();" />

For graphical information I prefer jqPlot. Try it - that is nice tool. See demo here.

If you need high quality printing than generate pdf or xlsx. If you use java and tomcat you can easilly integrate JasperServer to your application.


Need Your Help

AngularJS: "TypeError: Cannot call method '$broadcast' of null"

angularjs broadcast

I'm new to AngularJS and am working on my first mobile application starting with the Ionic Framework. I have a section where I have the user click on a "write review" button. This in turn opens an ...

Google drive getMimeType returning only null values

java null google-drive-api mime-types

I am trying to download files from drive using version 3 of Google Drive api in java. I now need the MimeType of files to identify their content type.