Probleme d'impression

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Probleme d'impression

Re: Probleme d'impression

par Sabrina » 04 mai 2012, 14:00

alors Personne ne peux m'aider ???

Re: Probleme d'impression

par Sabrina » 04 mai 2012, 10:47

Bonjour,
dzl mais j'ai pas compris ce que tu veux dire,
voici mon code dont je veux imprimer :

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Bon Reception a exporter</title>
<style type="text/css">
<!--
.Style2 {font-size: x-large}
.Style3 {font-weight: bold}
-->
</style>
</head>

<body>

 <?php 

  include 'connexion.php';
   $id = $_GET['id'];
  $requet=" SELECT * FROM receptions where id_reception = $id"  ;
  $resultt = mysql_query($requet) or exit(mysql_error().'Echec');
 

	 while( $data = mysql_fetch_assoc($resultt)) 
  { 
 ?> 
 
		   <marquee behavior="alternate" bgcolor="#5d9822" direction="left" height="60" scrollamount="10" scrolldelay="60" onMouseOver="this.stop()" onMouseOut="this.start()">
 <p align="center" class="Style2 Style3"><strong>Bon de reception N°  </strong><?php echo $data['id_reception']; ?> </p>      
		   </marquee>
		   
 <table width="320" height="36" align="right">
   <tr>
  <td width="66" align="right">  <a href="Admin.php">  <strong>Profil</strong></a></td>
 <td width="178" align="right"> <a href="BonsdeReceptions.php"><strong>Bons de Receptions </strong></a>  </td>
 <td width="60" align="right"> <img src="images/imprimante.jpeg" width="38" height="29" onclick="window.print()" /> </td>
 </tr>
</table>		   

<p>&nbsp;</p>
<table width="1077" height="1106" border="0" align="center" cellspacing="1">
    
	<tr>
      <td>
	  	  	  <form  method="post" id="form1" action="">
         <p>&nbsp;</p>
         <table width="95%" height="969" border="1" align="center">
    
	       <tr>
               <td height="" colspan="7" align="left"><p class="Style12"><strong>N&deg; Bon de commande</strong> : &nbsp;&nbsp;&nbsp;&nbsp;<?php echo $data['bcn']; ?>
                 
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   <strong>du</strong>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                 <?php echo $data['date']; ?>
                </p>                </td>
				 <td height="" colspan="7" align="left"><p class="Style12"><strong>Demandeur</strong> : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				   <?php echo $data['demandeur']; ?> 
				 </p>                </td>
		   </tr>
		   <tr>
               <td height="" colspan="7" align="left"><p class="Style12"><strong>Fournisseur</strong> : &nbsp;&nbsp;&nbsp;&nbsp;
                <?php echo $data['fournisseur']; ?>
             </p>             </td>
			    <td height="" colspan="7" align="left"><p class="Style12"><strong>Date</strong> : &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			      <label><?php echo $data['dateR']; ?></label>
			    </p>                </td>
		   </tr>
		    <tr>
               <td height="51" colspan="5" align="center"><p class="Style12"><strong>Designation</strong></p>             </td>
			    <td width="10%" height="51" align="center"><strong>Quantit&eacute; command&eacute;e </strong></td>
			    <td width="10%" height="51" align="center"><strong>Quantit&eacute; re&ccedil;ue</strong></td>
			    <td width="30%" colspan="7" rowspan="9" align="center"><p class="Style12"><strong>Observation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</strong></p>                
			      <p class="Style12">
			        <label><?php echo $data['observation']; ?></label>
			      </p>		        </td>
		   </tr>
		    <tr>
               <td height="46" colspan="5" align="left">  <?php  $article = explode("  &  ", $data['besoins']); echo $article[0]; ?>&nbsp;</td>
	           <td height="46" align="center"><?php  $qte = explode("  &  ", $data['quantites']); echo $qte[0];  ?></td>
	           <td height="46" align="center"><?php  $qter = explode("  &  ", $data['quantitesR']); echo $qter[0];  ?></td>
	       </tr>
		    <tr>
		      <td height="52" colspan="5" align="left"><?php echo $article[1]; ?>&nbsp; </td>
	          <td height="52" align="center"><?php echo $qte[1]; ?></td>
	          <td height="52" align="center"><?php echo $qter[1]; ?></td>
	       </tr>
		    <tr>
		      <td weidth="40%" colspan="5" align="left"><?php echo $article[2]; ?>&nbsp;</td>
	          <td height="51" align="center"><?php echo $qte[2]; ?></td>
	          <td height="51" align="center"><?php echo $qter[2]; ?></td>
	       </tr>
		    <tr>
		      <td height="50" colspan="5" align="left"><?php echo $article[3]; ?> &nbsp;</td>
	          <td height="50" align="center"><?php echo $qte[3]; ?></td>
	          <td height="50" align="center"><?php echo $qter[3]; ?></td>
	       </tr>
		    <tr>
		      <td height="45" colspan="5" align="left"><?php echo $article[4]; ?> &nbsp;</td>
	          <td height="45" align="center"><?php echo $qte[4]; ?></td>
	          <td height="45" align="center"><?php echo $qter[4]; ?></td>
	       </tr>
		    <tr>
		      <td height="45" colspan="5" align="left">  <?php echo $article[5]; ?>&nbsp; </td>
	          <td height="45" align="center"><?php echo $qte[5]; ?></td>
	          <td height="45" align="center"><?php echo $qter[5]; ?></td>
	       </tr>
		    <tr>
		      <td height="47" colspan="5" align="left"><?php echo $article[6]; ?>&nbsp; </td>
	          <td height="47" align="center"><?php echo $qte[6]; ?></td>
	          <td height="47" align="center"><?php echo $qter[6]; ?></td>
	       </tr>
		    <tr>
		      <td height="47" colspan="5" align="left"><?php echo $article[7]; ?>&nbsp;</td>
	          <td height="47" align="center"><?php echo $qte[7]; ?></td>
	          <td height="47" align="center"><?php echo $qter[7]; ?></td>
	       </tr>
		      <tr>
               <td height="40" colspan="5" align="left"><?php echo $article[8]; ?>&nbsp; </td>
			    <td height="40" align="center"><?php echo $qte[8]; ?></td>
			    <td height="40" align="center"><?php echo $qter[8]; ?></td>
			    <td height="40" colspan="7" align="center"><p class="Style12"><strong>Emargements</strong></p>                </td>
		   </tr>
		      <tr>
               <td height="49" colspan="5" align="left"><?php echo $article[9]; ?> &nbsp;</td>
			    <td height="49" align="center"><?php echo $qte[9]; ?></td>
			    <td height="49" align="center"><?php echo $qter[9]; ?></td>
			    <td weidht="" colspan="6" align="center"><p class="Style12"><strong>Demandeur</strong></p>                </td>
		        <td width="" height="49" align="center"><strong>Magasinier</strong></td>
	       </tr>
		      <tr>
               <td height="42" colspan="5" align="left"><?php echo $article[10]; ?> &nbsp; </td>
			    <td height="42" align="center"><?php echo $qte[10]; ?></td>
			    <td height="42" align="center"><?php echo $qter[10]; ?></td>
			    <td height="" colspan="7" rowspan="5" align="left">        </td>
		   </tr>
		      <tr>
		        <td height="40" colspan="5" align="left"><?php echo $article[11]; ?>&nbsp; </td>
                <td height="40" align="center"><?php echo $qte[11]; ?></td>
                <td height="40" align="center"><?php echo $qter[11]; ?></td>
	       </tr>
		      <tr>
		        <td height="43" colspan="5" align="left"> <?php echo $article[12]; ?> </td>
                <td height="43" align="center"><?php echo $qte[12]; ?></td>
                <td height="43" align="center"><?php echo $qter[12]; ?></td>
	       </tr>
		      <tr>
		        <td height="40" colspan="5" align="left"><?php echo $article[13]; ?> &nbsp;</td>
                <td height="40" align="center"><?php echo $qte[13]; ?></td>
                <td height="40" align="center"><?php echo $qter[13]; ?></td>
	       </tr>
		    
		      <tr>
		        <td height="109" colspan="7" align="left">&nbsp;</td>
           </tr>
		</table>
	   <?php 

 }//Submit

?>
	  
	  </form>
	  
</td> </tr> </table>


</body>
</html>

et voici mon code CSS que je sais pas cmment l'utiliser :
html
{ height: 100%;}

*
{ margin: 0;
  padding: 0;}

body
{ font: normal 14px sans-serif;
  background: #AFE068 url(../images/background.png) repeat-x;
  color: #5D5D5D;}

p
{ padding: 0 0 20px 0;
  line-height: 1.7em;}
  
img
{ border: 0;}

h1, h2, h3, h4, h5, h6 
{ font: bold 175% 'liberation sans', arial, sans-serif;
  color: #43423F;
  margin: 0 0 15px 0;
  padding: 15px 0 5px 0;}

h2
{ font: bold 165% 'liberation sans', arial, sans-serif;}

h3
{ font: bold 125% 'liberation sans', arial, sans-serif;
  padding: 0 0 5px 0;
  color: #488000;}

h4, h5, h6
{ margin: 0;
  padding: 0 0 5px 0;
  font: bold 110% 'liberation sans', arial, sans-serif;
  color: #5ABD21;
  line-height: 1.5em;}

h5, h6
{ font: italic 95% arial, sans-serif;
  color: #888;
  padding-bottom: 15px;}

h6
{ color: #362C20;}

a, a:hover
{ background: transparent;
  outline: none;
  text-decoration: underline;
  color: #2091FF;}

a:hover
{ text-decoration: underline;
  color: #5D5D5D;}

ul
{ margin: 2px 0 22px 17px;}

ul li
{ margin: 2px 0 15px 17px;}

ol
{ margin: 8px 0 22px 20px;}

ol li
{ margin: 0 0 11px 0;}

#main, #header, #banner, #menubar, #site_content, #footer, #container_footer, #container_header
{ margin-left: auto; 
  margin-right: auto;}

#main
{ width: 920px;
  background: #FFF;
  padding-bottom: 20px;
}

#header
{ background: transparent;
  width: 880px;
  padding: 8px 0 0 0;}

#banner
{ width: 880px;
  position: relative;
  height: 250px;
  background: #FFF url(../images/banner.jpg) no-repeat;}

#menubar
{ width: 880px;
  height: 35px;
  margin: 0 auto;
  background: #FFF;
  color: #000;} 

#site_content
{ width: 880px;
  overflow: hidden;
  margin: 0 auto;
  padding: 0;
  background: #FFF;} 

.sidebar_container
{ float: right;
  width: 224px;
  margin-top: 18px;
  padding: 0;}

.sidebar_top
{ float: left;
  width: 224px;
  height: 15px;
  background: url(../images/side_top.png) no-repeat;}

.sidebar_base
{ float: left;
  width: 224px;
  height: 15px;
  background: url(../images/side_base.png) no-repeat;}

.sidebar
{ float: right;
  width: 400px;
  padding: 0;
  background: url(../images/side_back.png) repeat-y;
  margin-bottom: 20px;}

.sidebar p
{ font-size: 95%;}

.sidebar li.selected, .sidebar li:hover
{ color: #5D5D5D;
  text-decoration: none;} 

.sidebar_item
{ padding: 0 0 0 15px;
  width: 201px;}

.sidebar_item h1
{ padding: 20px 0 10px 0;
  margin: 0;}

.content_item
{ width: 880px;
  margin-bottom: 20px;}

#content
{ text-align: left;
  width: 900px;
  padding: 0;
  margin: 0 20px 0 0;
  float: left;}

#container_header
{ margin-top: 20px;
  height: 15px;
  width: 920px;
  background: transparent url(../images/container_header.png) repeat-x top;}  
  
#container_footer
{ height: 20px;
  width: 920px;
  background: transparent url(../images/container_footer.png) repeat-x top;}
  
#footer
{ width: 880px;
  font: normal 115% "liberation sans", arial, sans-serif;
  height: 50px;
  padding: 20px 0 5px 0;
  margin-bottom: -15px;
  text-align: center; 
  background: #488000 url(../images/footer.png) no-repeat bottom;
  color: #FFF;}

#footer a, #footer a:hover
{ color: #FFF;
  background: #488000;
  text-decoration: underline;}

#footer a:hover
{ text-decoration: none;}

ul.links
{ margin: 0;}

ul.links li
{ list-style: none;
  padding: 8px 0;}

ul.links li a, ul.links li a:hover
{ padding: 0 0 0 28px;
  background: transparent url(../images/page.png) no-repeat left center;
  color: #06C4E6;
  text-decoration: underline;} 

ul.links li a:hover
{ color: #5D5D5D;
  text-decoration: none;} 

#nav, #nav ul
{ float: left;
  list-style: none;
  padding: 0;
  margin: 0;
  line-height: 35px;
  font: 115% helvetica;}
 
#nav a 
{ color: #43423F;
  display: block; 
  text-decoration: none;
  list-style-type: none;}
  
#nav li, #nav li.last  
{ float: left;
  border-right: 1px solid #FFF;
  display: block;
  padding: 0px 10px 0px 10px;
  margin: 0;
  height: 35px;}

#nav li.last
{ border-right: 0px;}
  
#nav li a, #nav li.last a {
  padding: 9px 0;
  text-align: center;  
  height: 15px;}

#nav li ul 
{ position: absolute;
  background: #7B7B7B;
  font: 100% arial;
  width: 100%;
  left: -999em;}
 
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul 
{ left: auto;}

#nav a:hover 
{ color: #FFF;}
 
#nav li:hover, #nav li.sfhover
{ background: #488000;}

#nav li li:hover
{ background: #488000;}

#nav li li 
{ border-bottom: 1px solid #FFF;
  width: 100%;
  padding: 0;
  display: block;
  float: left;
  height: auto;}

#nav li li a 
{ padding: 10px 43px 10px 43px;
  width: auto;
  height: auto;}

#nav li:hover, #nav li.hover 
{ position: static;}


Mon but est d'imprimer juste le tableau sur la page A4
que ce que je dois faire????

Re: Probleme d'impression

par Mazarini » 03 mai 2012, 14:00

Si tu as un truc comme ca :
<link href="fichier.css" rel="stylesheet" type="text/css"  />
tu le remplaces par :
<link href="fichier.css" rel="stylesheet" type="text/css" media="screen" />
<link href="fichier2.css" rel="stylesheet" type="text/css" media="print" />
Et tu adaptes fichier2.css (copie de fichier.css au départ) pour que le tableau soit plus grand et les caractères plus grand lors de l'impression.
fichiers2.css ne sera appliqué que pour l'impression.

Re: Probleme d'impression

par Sabrina » 03 mai 2012, 13:53

Ok, merci pour ta reponse mais comment je pe faire ca
J'utilise une templates et il existe un fichier CSS dans le dossier mais j'ai pas d'ider comment je peux faire ca

Re: Probleme d'impression

par Mazarini » 03 mai 2012, 13:39

Bonjour,

Si tu utilise des fichiers css, tu peux ajouter l'attribut media (media="screen" et media="print") dans leur déclaration et définir 2 présentations suivant le support écran ou papier.
Ca peut même être utilisé pour rendre invisible une barre de menu ou une entete de page lors de l'impression.

Probleme d'impression

par Sabrina » 03 mai 2012, 13:11

Bonjour,

J'ai fais une interface de bon de reception en PHP, j'ai fais un bouton imprimer quand je clique dessus ma page s'imprime et Ça marche bien mais mon problème consiste à :
-J'ai un tableau dans la page quand j'imprime il apparait dans une partie de la feuille et non pas sur toute la feuille :non: , je veux que l'interface et le tableau qui existe dans ma page s'imprime sur toute la page A4,
j'attends votre aide mercii :)