Solved

Printing a report

Posted on 2001-06-20
5
211 Views
Last Modified: 2010-04-09
I am creating a report using html.
I have a table with several columns. The first row is the title and each row presents values.
I deal with the fact that the rows are more than what the screen allows to show, by showing a number of rows, a Next and Previous button, and also numbers that allow the user to see each section of the report they wish.

I need to be able also to print the report.
I could create a "print version", of the report that is simplified, and use the print capabilities of the browser.
However the title won't show on each page, and that will make the report hard to read.
I could also create the print version in the same manner, with a title row, and 50 or how many rows can print on a page. But I don't see how can I print all pages with only one command.
Thanks.

0
Comment
Question by:simi
5 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 10 total points
ID: 6213649
When you want this to look right when printed...do not use HTML to print from there are better options to do that...and HTML simply wasn't created form printing documents...it was created for showing them on screen..

For example you could choose to use a PDF file instead...or maybe give the user the option to download a DOC file and print that...there are so many options but HTML really should be left out of that options list... :-)

Cheers,
Max.
0
 
LVL 17

Expert Comment

by:dorward
ID: 6213864
As DreamMaster said, use a PDF file. With a free plugin you can use PHP (also free) to create PDFs from a database (like MySQL which is free). The basic PHP software generates HTML so you can generate online and printable versions programatically. If you don't want to use a database PHP also supports the use of XML so you can write it in that and then convert to HTML or PDF as required.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6214168
HTML is not, and never has been, a print format. As everyone else has pointed out, you are NOT going to make this print well from HTML.

Somebody will probably come along and give some option that MAY work, for a particular browser, system, printer, etc. BIG PROBLEM -- you don't KNOW what printer the user has or how it's set up. Furthermore, you CANNOT know -- because the USER can change it and doesn't need to reload the page to do so. IMHO, this gets worse, not better, in a large corporate environment, because there most people will have a CHOICE of printers -- and you don't know which one they've chosen or how it's set up. (If you've only got one type of printer, you STILL have either portrait or landscape, and you don't know that, either.)

Think of web pages as VIDEO, not PRINT. You wouldn't expect to print a movie, would you? Just because you can force an HTML document to a printer doesn't mean you've got any control over what comes out.
0
 
LVL 1

Expert Comment

by:Ernest022699
ID: 6216769
webwoman is spot on (as usual!).  If you are creating documents to be shared internally (e.g., within a company), then use PDF, Word, Excel, or some other package everyone has on their desktop.  HTML will NOT give you the results you want.
0
 

Author Comment

by:simi
ID: 6217033
Thank you to you all.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now