mattgcon
mattgcon

Reputation: 4848

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, with formatting. What is the most efficient means of doing this?

Upvotes: 4

Views: 2080

Answers (2)

mattgcon
mattgcon

Reputation: 4848

used a simple web page and print web page function

Upvotes: -2

Steve Morgan
Steve Morgan

Reputation: 13091

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.

Upvotes: 4

Related Questions