Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Need advise to Print a Report

Posted on 2001-06-14
4
147 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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.…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

856 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