Solved

Need advise to Print a Report

Posted on 2001-06-14
4
148 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
[X]
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
  • 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Title # Comments Views Activity
Html fieldset fix its height and width 4 44
CSS DIV Height in Percent 1 27
Timer on div 5 24
CSS question 3 22
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Find out what you should include to make the best professional email signature for your organization.
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

749 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