开发者

ASP.Net creating a formatted printable report

开发者 https://www.devze.com 2023-03-20 15:32 出处:网络
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\'r

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

0

精彩评论

暂无评论...
验证码 换一张
取 消