Solved

Need advise to Print a Report

Posted on 2001-06-14
4
144 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
ID: 6195242
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
ID: 6213557
<SCRIPT LANGUAGE="JavaScript">
     window.print()  
</SCRIPT>
0
 

Author Comment

by:DavidWare
ID: 6213834
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
ID: 6259474
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

914 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

17 Experts available now in Live!

Get 1:1 Help Now