Preformatted printing in asp

I have a preformatted receipt with fields Name, Age etc.,
The user enters the details in a web form and click on a print button , the details entered by the user would be filled in the appropriate spaces in the receipt(kept in the printer).
How to accomplish this task? Please help me.

Who is Participating?

Improve company productivity with a Business Account.Sign Up

TasneemConnect With a Mentor Commented:
Printing in preformatted form is possible. You have to create a report with fixed length. eg td width="100px" etc to place a particular field in the pricise calculated position.
More over you have to take care of the margin settings. Set the height and width in pixel measurement and that should sort out. More over you can use css and xsl for the same.
Can you provide more details? Is this a standard tape receipt? Is there a limitation to the number of characters that can be printed on a line? Are you storing this information in some sort of datastore/database? It's easy to simply blurt out an answer, but it's much better to have more details regarding the application.

Like GoofyDawg mentioned, we're not sure if this is a regular reciept-type paper or regular 8.5x11" paper. If it's the latter this might be of help to you:

Using CSS to control how the page will be printed out is a nice way to offer the user both a nice layout when viewing pages and a clean way of printing out the information they're viewing.
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Are you just asking how to do a print button?
<SCRIPT LANGUAGE=javascript>
function btnPrint_onclick() {
<INPUT type="button" value="Print" id=btnPrint name=btnPrint LANGUAGE=javascript onclick="return btnPrint_onclick()">
thirumaranAuthor Commented:
   i dont want to print the browser toolbar or locaton bar. Will your solution work for it?

  I will try your solution and inform you.
thanx for the help.
thirumaranAuthor Commented:
  what is this workarea??
Thirumaran, with my way it will NOT print out the browser bar or location bar. It will only print out the actual content of the page in the matter in which you tell it to.
Sorry, I cut and pasted that from a page that is in a frame called WORKAREA.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.