Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Printed a formatted page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Printed a formatted page

 Post Reply Post Reply
Author
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Topic: Printed a formatted page
    Posted: 27 August 2004 at 11:30am

Dear experts,
I am trying to format a page so that when a user prints a document, the layout will be exactly as the one shown on the link below:

http://www.websamba.com/afparishioners/certific.pdf

It is formatted on an 8/11 paper.

The text may change but the length of each text is generally the same.

Any help would be greatly, greatly appreciated.

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 12:30pm
Use CSS or tables. Shouldn't be a problem. What problems are you having formating it as an html page?

Lead me not into temptation... I know the short cut, follow me.
Back to Top
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 1:36pm

Thanks DP for the response.

 

It is not getting aligned correctly when using tables:

Here is what I tried to do and as you can see from this code,

It isn't lining up correctly compared with what I have on the net.

 

<HTML>
<HEAD>
<TITLE>Beanie</TITLE>
<link href="styles.css" rel="stylesheet" type="text/css">
</HEAD>
<BODY>
<LEFT>
  <TABLE BORDER='0' BGCOLOR='white' WIDTH='36%'>
    <TR>
     <TD ALIGN='LEFT' WIDTH="27%">
      <TABLE>
        <TR>
         <TD ALIGN='LEFT'><B>6/15/2004</B></TD>
        </TR> </TABLE></TD><TD WIDTH="68%">
      <TABLE ALIGN="CENTER">
        <TR>
         <TD ALIGN='R'><B>051704</B></TD>
        </TR> </TABLE></TD></TR>
    <TR>
     <TD ALIGN='CENTER' COLSPAN='2'>
      <TABLE border="0">
       <TR>
        <TD COLSPAN='2' ALIGN='CENTER'>&nbsp;</TD>
       </TR>
       <TR>
        <TD COLSPAN='2 ALIGN='LEFT''></TD>
       </TR>
     </TABLE>
    </TD>
   </TR>
   <TR>
    <TD ALIGN='CENTER' COLSPAN='2'>
     <TABLE border="0">
      <TR>
       <TD COLSPAN='2' ALIGN='CENTER'>&nbsp;</TD>
      </TR>
      <TR>
       <TD COLSPAN='2 ALIGN='LEFT''></TD>
      </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='CENTER'><B>Joseph Peace</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
    <TD ALIGN='LEFT' WIDTH="27%">
     <TABLE >
      <TR>
       <TD ALIGN='LEFT'><B>5th</B></TD>
      </TR>
     </TABLE>
    </TD>
    <TD WIDTH="68%">
    <TABLE ALIGN="LEFT" WIDTH="144">
     <TR>
      <TD ALIGN='LEFT' HEIGHT="20"><B>#4053</B></TD>
      <TD ALIGN='RIGHT' HEIGHT="20"><B>6th/Can</B></TD>
     </TR>
    </TABLE>
   </TD>
   <TD WIDTH="5%"></TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='CENTER'><B>MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR>
    </TABLE>
   </TD>
  </TR>
  <TR>
   <TD ALIGN='CENTER' COLSPAN='2'>
    <TABLE>
     <TR>
      <TD COLSPAN='2' ALIGN='LEFT'><B>051704</B></TD>
     </TR>
     <TR>
      <TD COLSPAN='2 ALIGN='LEFT''></TD>
     </TR> </TABLE>
    </TD>
   </TR>
  </TABLE>
 </LEFT>
</BODY>
</HTML>

 

 

 

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 2:44pm

<LEFT> and </LEFT> are not valid tags. Try relacing those tags and everything between them with

<div align="left" style="margin-left: 5%;">
 <table style="font-weight: bold;" border="0" cellpadding="0" style="border-collapse: collapse" width="33%" id="table1">
  <tr>
   <td align="left" colspan="2">6/15/2004</td>
   <td align="right" colspan="2">051704</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" align="center">Joseph Peace</td>
  </tr>
  <tr>
   <td colspan="4" align="center">&nbsp;</td>
  </tr>
  <tr>
   <td align="left" width="33">5th</td>
   <td align="center" width="34%" colspan="2">#4053</td>
   <td align="right" width="33%">6th/Can</td>
  </tr>
  <tr>
   <td colspan="4" align="center">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" align="center">MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</td>
  </tr>
  <tr>
   <td colspan="4">&nbsp;</td>
  </tr>
  <tr>
   <td colspan="4" style="font-family: 'Courier New', 'Courier',  'serif'; font-size:200%; font-weight: normal;">051704</td>
  </tr>
 </table>
</div>

EDIT: - post updated for closing DIV tag and to add a couple of blamk rows...



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 3:04pm

This is perfect!

Thanks a million!!!

Back to Top
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 4:10pm

This looks really great, thank you again.


Can ask you just one more question about this, please?

 

All the info on this form are getting picked up from the database.

I have modified what you gave me to accommodate that.

So, so far, so good except one thing.

There is one problem, however.

The information on this tag:

 <tr>
   <td colspan="4" align="center">MWMT-Musuem Quality!<br>Beautiful Beanie! Pretty Colors!</td>
  </tr>

as you can see is broken up into two separate lines but there is just one field for it.

Is there a way to break them in such that a portion of the code like

MWMT-Musuem Quality! will be on one line and
Beautiful Beanie! Pretty Colors will be on another line just like we have them now?

 

Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 5:02pm

The only reliable way to have them split where you want them to would be to store the <br> characters as part of the db field.

If the data is inputted via a form, you'd replace all occurrences of the constant vbCRLF with "<br>" within your form handler script - e.g.

strDataField = replace(strDataField,vbCRLF, "<br>")

If you don't want to do that and don't care precisely where the line breaks, you can use the Split command to split the string at evey space. This will create an array of words. You'd response.write the first half of the array with a space between each word. Response.write the <br>. Then do the second half of the array.

Another way would be to calculate the midpoint of the string and then look for the first space after that and replace it with a <br>. e.g.

intMidPoint = Round(Len(strDataField) / 2)
strDataField = Replace(strDataField, " ", "<br>", intMidPoint, 1)

NOTE: - the ,1 in the replace statement specifies the number of times to do the replace.

 



Edited by dpyers

Lead me not into temptation... I know the short cut, follow me.
Back to Top
simflex View Drop Down
Groupie
Groupie
Avatar

Joined: 10 November 2002
Location: United States
Status: Offline
Points: 63
Post Options Post Options   Thanks (0) Thanks(0)   Quote simflex Quote  Post ReplyReply Direct Link To This Post Posted: 27 August 2004 at 10:58pm

This is great, really great stuff.

Thanks one million and one times

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.