Solved

Need advise to Print a Report

Posted on 2001-06-14
4
143 Views
Last Modified: 2012-05-04
I want to send a report to a user's printer when they click a PRINT button, but I don't know how.

The user will make selections on a Setup Page, then CONTINUE to a Preview page, where the recordset is displayed in columns in a TEXTAREA box.
Then the user will click PRINT, and that's when this theoretical report will pop out of their printer.  Only in a different format than they see on the screen (because the report may be several pages long, and the TEXTAREA scrolls)

Can anybody tell me how to get it to do that?

The data is in Access.

Should I design the report in HTML based on the values in Session variables returned using Java?

Then how will I send the report back?.

If this is not an appropriate question for the HTML venue, then I will ask it somewhere else.

Thanks,
David
0
Comment
Question by:DavidWare
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
webwoman earned 50 total points
Comment Utility
A few things...

You can't get columns in a textarea field.
Form fields don't print well. (I see you realize this)
You can't print what's not in the browser.

Do it this way...

Have them make their selections. DO NOT MAKE ANY 'PREVIEW' PAGE. You don't need it. Set the results up in a table so you can have your columns, keep it to appx 500 px wide, no form fields at all in this part. Then, put a button (a form button or a graphic) that allows them to print. You'd set it with a window.print() link/function. That will bring up the print dialog box. You could also have a button to take them back to the originating form/selection page if they don't like what they see in the results.

You're not going to get it to print correctly if the table is very wide. You can't FORCE them to print it landscape. If this is a complex, long table, your best bet is to make it a PDF, directly from the database (you can force it in asp/php, probably other ways too) and then have that open in the browser. You have much better control over font size, page breaks, etc. in a PDF.
0
 
LVL 1

Expert Comment

by:zeheb
Comment Utility
<SCRIPT LANGUAGE="JavaScript">
     window.print()  
</SCRIPT>
0
 

Author Comment

by:DavidWare
Comment Utility
webwoman,
I don't know why I didn't receive an email when you posted your comment. I thought no one had any ideas.  I'm glad zaheb commented also, or I might have not come back here to look.

I will try these suggestions!

Thanks, David
0
 

Author Comment

by:DavidWare
Comment Utility
Thanks for that reply.
I confess that I did not yet return to that project, so i will award the points and return here when I get reassigned to it.
Thanks again.
David
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

762 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

10 Experts available now in Live!

Get 1:1 Help Now