Hello all,

I know this has already been talked about on this forum, so dont get angry!

I cant seem to get my webpage to print off correctly. Basically i have a main page with an iframe within it. within said iframe there is a few tables and some graphics that make up the results page of a questionnaire. I have specifically designed the page to fit on an 800x600 screen already, so there shouldnt really be any problems with the printing? well becuase the work printer doesnt seem to do borderless printing, part of the text/graphics on the page get cut off all the time. which is really annoying.

I have tried various bits of CSS to force a landscape print on the areas of the page where the printing clipping occurs, but it just doesnt seem to have done anything.

I have also tried adding an "img" class to each of the <img> html tags which scales the images to 70% so they will fit correctly. I notice the changed image size in the design view in dreamweaver, but when i actually view the page in IE/Firefox, there is no changes to the image sizes!

Also i want the page to print as it is seen on screen i.e. with the bg images etc. becuase they add meaning to the page.

Any ideas would be greatly appreciated!

here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Calculate Score</title>
<link href="essex.css" rel="stylesheet" type="text/css" media="all" />

<script language="JavaScript" type="text/javascript">
var newValArr = new Array();
var resultArr = new Array();
var miniGrid;



function showLayer(id) {
document.getElementById(id).style.visibility = "visible";
}
function returnImage(){
        
        readVars();
        var totalKnowItScore=0;
        var totalDoItScore=0;
        for(i=0;i<14;i++)
        {
            totalKnowItScore = totalKnowItScore+newValArr[i];
        }
        
        for(i=14;i<27;i++)
        {
            totalDoItScore = totalDoItScore+newValArr[i];
            
        }

        if(totalDoItScore<=325 && totalKnowItScore<=350){
            document.grid.src="img/grid/BLBL.gif";
        }
        
        else if(totalDoItScore>325 && totalDoItScore<=650 && totalKnowItScore<=350){
            document.grid.src="img/grid/BLTL.gif";
        }
        
        if(totalDoItScore<=325 && totalKnowItScore>350 && totalKnowItScore<=700){
            document.grid.src="img/grid/BLBR.gif";
        }
        
        else if(totalDoItScore>325 && totalDoItScore<=650 && totalKnowItScore>350 && totalKnowItScore<=700){
            document.grid.src="img/grid/BLTR.gif";
        }
        else if(totalKnowItScore<=350 && totalDoItScore>650 && totalDoItScore<=975){
            document.grid.src="img/grid/TLBL.gif";
        }
        else if(totalKnowItScore>350 && totalKnowItScore<=700 && totalDoItScore>650 && totalDoItScore<=975){
            document.grid.src="img/grid/TLBR.gif";
        }
        else if(totalDoItScore>975 && totalDoItScore<=1300 && totalKnowItScore<=350){
            document.grid.src="img/grid/TLTL.gif";
        }
        
        else if(totalKnowItScore>350 && totalKnowItScore<=700 && totalDoItScore>975 && totalDoItScore<=1300){
            document.grid.src="img/grid/TLBR.gif";
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>975 && totalDoItScore<=1300){
            document.grid.src="img/grid/TRTL.gif";
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore>975 && totalDoItScore<=1300){
            document.grid.src="img/grid/TRTR.gif";
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>650 && totalDoItScore<=975){
            document.grid.src="img/grid/TRBL.gif";
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore>650 && totalDoItScore<=975){
            document.grid.src="img/grid/TRBR.gif";
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>325 && totalDoItScore<=650){
            document.grid.src="img/grid/BRTL.gif";
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore<=350){
            document.grid.src="img/grid/BRBL.gif";
        }
        else if(totalKnowItScore>1050 && totalDoItScore<=1400 && totalDoItScore>325 && totalDoItScore<=650){
            document.grid.src="img/grid/BRTR.gif";
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore<=350){
            document.grid.src="img/grid/BRBR.gif";
        }    
        return miniGrid;        

}
function readVars(){

    var sGet = window.location.search;
    if (sGet)
    {

        sGet = sGet.substr(1);
        
        var sNVPairs = sGet.split("&");
        var count =0;    
        
        for (i = 0; i<27; i++)
        {

            var sNV = sNVPairs[i].split("=");
            
            var sName = sNV[0];
            var sValue = sNV[1];
            
            
                if(sValue=="100"){
                    newValArr[i]=100;
                    //alert("value is 100");
                }
                else if(sValue=="75"){
                    newValArr[i]=75;
                    //alert("value is 75");
                }
                else if(sValue=="50"){
                    newValArr[i]=50;
                    //alert("value is 50");
                }
                else if(sValue=="25"){
                    newValArr[i]=25;
                    //alert("value is 25");
                }
                else if(sValue=="0"){
                    newValArr[i]=0;
                    //alert("value is 0");
                }
    
                else if(sValue==null){
                    alert('there was an error '+ newValArr[q] + q);
                }


        }
    }
    return newValArr;
}

function showInfo(){
    readVars();
        var totalKnowItScore=0;
        var totalDoItScore=0;
        for(i=0;i<14;i++)
        {
            totalKnowItScore = totalKnowItScore+newValArr[i];
        }
        
        for(i=14;i<27;i++)
        {
            totalDoItScore = totalDoItScore+newValArr[i];
            
        }

        if(totalDoItScore<=325 && totalKnowItScore<=350){
            showLayer("BLBL");
        }
        
        else if(totalDoItScore>325 && totalDoItScore<=650 && totalKnowItScore<=350){
            showLayer("BLTL");
        }
        
        if(totalDoItScore<=325 && totalKnowItScore>350 && totalKnowItScore<=700){
            showLayer("BLBR");
        }
        
        else if(totalDoItScore>325 && totalDoItScore<=650 && totalKnowItScore>350 && totalKnowItScore<=700){
            showLayer("BLTR");
        }
        else if(totalKnowItScore<=350 && totalDoItScore>650 && totalDoItScore<=975){
            showLayer("TLBL");
        }
        else if(totalKnowItScore>350 && totalKnowItScore<=700 && totalDoItScore>650 && totalDoItScore<=975){
            showLayer("TLBR");
        }
        else if(totalDoItScore>975 && totalDoItScore<=1300 && totalKnowItScore<=350){
            showLayer("TLTL");
        }
        
        else if(totalKnowItScore>350 && totalKnowItScore<=700 && totalDoItScore>975 && totalDoItScore<=1300){
            showLayer("TLTR");
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>975 && totalDoItScore<=1300){
            showLayer("TRTL");
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore>975 && totalDoItScore<=1300){
            showLayer("TRTR");
            document.getElementById('topmarks').style.visibility = "hidden";
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>650 && totalDoItScore<=975){
            showLayer("TRBL");
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore>650 && totalDoItScore<=975){
            showLayer("TRBR");
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore>325 && totalDoItScore<=650){
            showLayer("BRTL");
        }
        else if(totalKnowItScore>700 && totalKnowItScore<=1050 && totalDoItScore<=350){
            showLayer("BRBL");
        }
        else if(totalKnowItScore>1050 && totalDoItScore<=1400 && totalDoItScore>325 && totalDoItScore<=650){
            showLayer("BRTR");
        }
        else if(totalKnowItScore>1050 && totalKnowItScore<=1400 && totalDoItScore<=350){
            showLayer("BRBR");
        }
        //alert("new val arr showInfo()"+newValArr[1]);                

}
</script>

<link href="essex.css" rel="stylesheet" type="text/css" />
</head>

<body class="landscape" onLoad="summary(); returnImage();">
<table class="landscape" width="90%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top" name="maintable">
        <tr>
            <td width="776" colspan="1" align="center">
                <h2>Thank you for completing the questionnaire, please see the diagram below to view your results</h2>
          </td>
        </tr>
        
        <tr>
            <td>
            <table width="100%" border="0">
            <tr>
            <td><img name="grid" border="0" src="/img/grid/BLBL.gif"></td><td><p>The grid to the right is a smaller version of the grid below. The red spot represents where you currently are on the scoring grid. Please see the larger grid below for more detailed information.</p></td>
            </tr>
            </table>
            </td>
        </tr>
            <DIV style="page-break-after:always"></DIV>
<tr><td>
            <table width="90%" border="0" cellpadding="0" cellspacing="0">
            <tr><td width="80%">
            </td>
            <td align="center" bgcolor="#CCCCCC">
            <a href="javascript:window.print();">Print this page</a>
            </td></tr>
            </table>
            </td></tr>
<tr><td align="center" valign="middle">
                <img src="img/KNOWtext.gif">
            </td>
            
  </tr>
            
            <tr><td>
                <table width="90%" border="0" cellspacing="0" cellpadding="0">
                    
                    <tr>
                        <td width="160" align="center" valign="middle" class="E">
                            <div class="resultCell" id="TLTL"><p>You know what the role of Watch Manager is. Your responses to the questionnaire indicate that you are not meeting the expectations and outcomes of the role and this is where you must now focus. The Management Development Programme will help you achieve this.</p></div>
                      </td>
                        <td width="158" align="center" valign="middle" class="E">
                            <div class="resultCell" id="TLTR"><p>You know what the role of Watch Manager is. Your responses to the questionnaire indicate that you are not meeting the expectations and outcomes of the role fully and should focus on the aspects listed on the summary below. It is equally important to do the role and achieve the expected outcomes. The Management Development Programme will help you achieve this.</p></div>
                      </td>
                        <td width="38" rowspan="2" valign="bottom">
                            <img  src="img/newarrow-up.gif">                        </td>
                        <td width="194" align="center" valign="middle" class="E">
                            <div class="resultCell" id="TRTL"><p>You know what the role of Watch Manager is. The Management Development Programme will help you to enhance your skills further and give you the opportunity to share your experience and expertise in order to help others develop their skills in this job.</p></div>
                      </td>
                        <td width="165" align="center" valign="middle">
                            <div class="topmarks" id="topmarks" style="visibility:visible">
                                <p>Managers who understand, and do the role fully will sit in this area of the chart.</p>
                            </div>
                            <div class="resultCell" id="TRTR"><p>You know what the role of Watch Manager is. The Management Development Programme will help you to enhance your skills further and give you the opportunity to share your experience and expertise in order to help others develop their skills in this job.</p></div>
                          
                      </td>
                        <td width="21" rowspan="5" valign="middle"><img src="img/DOtext.gif"></td>
                    </tr>
                    
                    <tr>
                        
                        <td align="center" valign="middle">
                            <div class="resultCell" id="TLBL"><p>With more focus on the aspects listed on the summary below your knowledge of the Watch Manager role will be complete. Your responses to the questionnaire indicate that you are not meeting the expectations and outcomes of the role and this is where you must now focus. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td align="center" valign="middle">
                            <div class="resultCell" id="TLBR"><p>With more focus on the aspects listed on the summary below your knowledge of the Watch Manager role will be complete. Your responses to the questionnaire also indicate that you are not meeting the expectations and outcomes of the role and should focus on the aspects listed on the summary below.  It is equally important to do the role and achieve the expected outcomes. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td class="NE" align="center" valign="middle">
                            <div class="resultCell" id="TRBL"><p>With more focus on the aspects listed on the summary below your knowledge of the Watch Manager role will be complete. With more focus on the aspects listed on the summary below your knowledge, performance and achievements will be fully in line with what is expected of you. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td class="N" align="center" valign="middle">
                            <div class="resultCell" id="TRBR"><p>With more focus on the aspects listed on the summary below your knowledge of the Watch Manager role will be complete. Your responses to the questionnaire indicate, however, that you are doing the role and getting the required outcomes. The Management Development Programme will help you understand the role more fully in order to enhance your skills further and share your experience and expertise with others.</p></div>
                        </td>
                        
                    </tr>
                    
                    <tr>
                        <td colspan="2" align="right" valign="bottom">
                            <img src="img/newarrow-left.gif">
                        </td>
                        <td></td>
                        <td colspan="2" align="left" valign="bottom" height="10px">
                            <img src="img/newarrow-right.gif"></td>
                        
                    </tr>
                    
                    
                    <tr>
                        <td align="center" valign="middle">
                            <div class="resultCell" id="BLTL"><p>You have a partial understanding of the role of Watch Manager and must focus on developing your knowledge more fully. Your responses to the questionnaire also indicate that you are not meeting the expectations and outcomes of the role and you must start to put your knowledge of the role into action. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td class="NE" align="center" valign="middle">
                            <div class="resultCell" id="BLTR"><p>You have a partial understanding of the role of Watch Manager and must focus on developing your knowledge more fully. Your responses to the questionnaire also indicate that you are not meeting the expectations and outcomes of the role and should focus on the aspects listed on the summary below. It is equally important to do the role and achieve the expected outcomes. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td rowspan="2" valign="top">
                            <img  src="img/newarrow-down.gif">
                        </td>
                        <td align="center" valign="middle">
                            <div class="resultCell" id="BRTL"><p>You have a partial understanding of the role of Watch Manager and must focus on developing your knowledge more fully.  Your responses to the questionnaire also indicate that you are not meeting the expectations and outcomes of the role fully and should focus on the aspects listed on the summary below. It is equally important to do the role and achieve the expected outcomes. The Management Development Programme will help you achieve this.</p></div>
                        </td>
                        <td class="N" align="center" valign="middle">
                            <div class="resultCell" id="BRTR"><p>You are doing the role and getting the required outcomes. Your responses to the questionnaire indicate, however, that you are doing the role and getting the required outcomes. The Management Development Programme will help you understand the role more fully in order to enhance your skills further and share your experience and expertise with others.</p></div>
                        </td>
                    </tr>
                    
                    <tr>
                        
                        <td class="NE" align="center" valign="middle">
                            <div class="resultCell" id="BLBL"><p>You currently neither understand or do the role. The Management Development Programme will help you to improve your understanding and to focus on putting this understanding into action.</p></div>
                        </td>
                        <td align="center" valign="middle">
                            <div class="resultCell" id="BLBR"><p>You do not understand the role of Watch Manager. Your responses to the questionnaire indicate that you are doing some of requirements and achieving some or the expected outcomes. You must understand the role and what is expected of you before you can do it fully. Focus on the aspects listed on the summary below to help you do the role more fully.</p></div>
                        </td>
                        <td align="center" valign="middle">
                            <div class="resultCell" id="BRBL"><p>You do not understand the role of Watch Manager. Your responses to the questionnaire indicate that you are doing some of requirements and achieving some or the expected outcomes. You must understand the role and what is expected of you before you can do it fully. Focus on the aspects listed on the summary below to help you do the role more fully.</p></div>
                        </td>
                        <td class="N" align="center" valign="middle">
                            <div class="resultCell" id="BRBR"><p>You do not understand the role of Watch Manager. Your responses to the questionnaire indicate, however, that you are doing the role and getting the required outcomes. The Management Development Programme will help you understand the role more fully in order to enhance your skills further and share your experience and expertise with others.</p></div>
                        </td>
                        
                    </tr>
                    
              </table>
              
            </td></tr>
            <DIV style="page-break-after:always"></DIV>
            
<tr><td>
            <h1>Your Questionnaire results breakdown:</h1>
            <br><h3>All the answers in the questionnaire required a "Strongly Agree" or "Always" answer to gain top marks, the questions you didn't answer "Strongly Agree" or "Always" to are listed below. These are the areas in which you much improve to better fulfill your position:</h3>
            <h3>Question: </h3>
</td></tr>
<tr><td id="summary1"></td></tr>
<tr><td id="summary2"></td></tr>
<tr><td id="summary3"></td></tr>
<tr><td id="summary4"></td></tr>
<tr><td id="summary5"></td></tr>
<tr><td id="summary6"></td></tr>
<tr><td id="summary7"></td></tr>
<tr><td id="summary8"></td></tr>
<tr><td id="summary9"></td></tr>
<tr><td id="summary10"></td></tr>
<tr><td id="summary11"></td></tr>
<tr><td id="summary12"></td></tr>
<tr><td id="summary13"></td></tr>
<tr><td id="summary14"></td></tr>
<tr><td id="summary15"></td></tr>
<tr><td id="summary16"></td></tr>
<tr><td id="summary17"></td></tr>
<tr><td id="summary18"></td></tr>
<tr><td id="summary19"></td></tr>
<tr><td id="summary20"></td></tr>
<tr><td id="summary21"></td></tr>
<tr><td id="summary22"></td></tr>
<tr><td id="summary23"></td></tr>
<tr><td id="summary24"></td></tr>
<tr><td id="summary25"></td></tr>
<tr><td id="summary26"></td></tr>
<tr><td id="summary27"></td></tr>
</td></tr>

        
</tr>
</table>

</body>
<script>

function writeHTML(id, S){

    var element = document.getElementById(id);
    element.innerHTML=S;
    //alert("writeHTML called");

}
function summary(){
showInfo();
readVars();
var count=0;
var qArr= new Array('Lead a team of people', 'Define who is responsible for doing the work in my team', 'Define the standards of behaviour for my team', 'Maintain discipline within the team', 'Create a positive atmosphere within the workplace', 'Help others to succeed in their work and their careers', 'Share information with my team', 'Set clear objectives for my team', 'Help others improve their performance', 'Risk assess and risk manage', 'Plan and take action for performance improvement', 'Project manage', 'Promote the safety services we can offer to people', 'Work with partner organisations to deliver safety services', 'My team turns me to lead them through situations arising (by situations we means incidents, workplace issues, challenging scenarios)', 'Every member of my team does the work they are responsible for', 'I meet the standards of behaviour I ask of others', 'My team accept my decision in disciplinary matters', 'Working in my station/watch is a positive experience', 'I understand what members of my team perceives success to be', 'I run briefing meetings at regular times', 'My team listens to, and understands what I tell them', 'My team knows they are performing against objectives', 'I review performance against objectives at appropriate frequency', 'I get involved in projects (by projects we mean a temporary activity undertaken to create a unique product or service)', 'I look for opportunities to promote the safety services we can offer to people', 'I attend partner meetings I am invited to');
        for(i=0;i<14;i++){
                if(newValArr[i]==100){
                    resultArr[i] = "Strongly Agree";
                    
                }
                if(newValArr[i]==75){
                    resultArr[i] = "Agree";
                }
                else if(newValArr[i]==50){
                    resultArr[i] = "Disagree";
                }
                else if(newValArr[i]==25){
                    resultArr[i] = "Strongly Disagree";
                }
                else if(newValArr[i]==0){
                    resultArr[i] = "Not my job";
                }
                //alert(newValArr[i]);
            
        }
        for(i=14;i<27;i++){
                if(newValArr[i]==100){
                    resultArr[i] = "Always";
                }
                if(newValArr[i]==75){
                    resultArr[i] = "Usually";
                }
                else if(newValArr[i]==50){
                    resultArr[i] = "Occasionally";
                }
                else if(newValArr[i]==25){
                    resultArr[i] = "Never";
                }
                else if(newValArr[i]==0){
                    resultArr[i] = "Not my job";
                }
        }


    for(p=0;p<14;p++){
                //alert("inside for " +i);
                if(resultArr[p]=="Agree"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                
                if(resultArr[p]=="Disagree"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                if(resultArr[p]=="Strongly Disagree"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                if(resultArr[p]=="Not my job"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                
                
    }
    
            for(p=14;p<27;p++){
            
                if(resultArr[p]=="Usually"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                if(resultArr[p]=="Occasionally"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                if(resultArr[p]=="Never"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                if(resultArr[p]=="Not my job"){
                    writeHTML('summary'+(count+1),'<p>'+(p+1)+'. '+qArr[p]+'<br> You answered: '+resultArr[p]+'</p>');
                    count++;
                }
                
            }
}
</script>
</html>

Recommended Answers

All 3 Replies

Member Avatar for GreenDay2001

Well, if you use a priting software embeded with your browser, you may get better results. I use Cannon Web Print which i got with my printer.

nope, im only using standard print dialogue box thing in IE or firefox. I just need to know how to amend my code to allow eithr landscape printing so the graphics wont mess up, or alternatively, how to scale everything down to about 80% so it will fit on the page margins.

The problem is not your code, but the printer settings on the browser. Mine has the following check boxes (under file/print setup):

shrink page to fit
print background
portrait/landscape

It also has settings for margins and titles.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.