ASP.Net creating a formatted printable report
I have a client that is requiring their claims (entered online) to be printed out through their web application, w开发者_如何学Cith formatting. What is the most efficient means of doing this?
If you're using good HTML markup and CSS to render the UI (which is more likely if you're using ASP.NET MVC than it is if you're using WebForms), you can exploit a useful feature that allows an additional CSS Stylesheet to be used specifically for printing, like this:
<link rel="stylesheet" href="print.css" type="text/css" media="print" />
In this stylesheet, you override the settings from the main CSS stylesheet to reformat the HTML as you need. That may include hiding unwanted text using
display:none;
in the applicable styles.
You'll need to be pretty competent with CSS, in my opinion, but it's highly efficient - there's no code to write. You display the data on-screen and when you print it, it comes out differently.
used a simple web page and print web page function
精彩评论