Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Need advise to Print a Report

Posted on 2001-06-14
4
Medium Priority
?
153 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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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 …
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).

618 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