Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2118 connectés 

  FORUM HardWare.fr
  Programmation
  Delphi/Pascal

  compréhension d'impression....

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

compréhension d'impression....

n°166353
os2
Posté le 26-06-2002 à 14:18:58  profilanswer
 


 
je voudrait imprimer sous delphi 6
: Date     Enseignant              Duree   Suppleant
                NAS
 
mais j'obtien seulement à l'impression:
Date     Enseignant              Duree   Supp
voici mon code
 
 Printer.BeginDoc;
 XCols[1]:=0;
 yCurr:=255;
 Printer.Canvas.Font.Size:=12;
 yCurr:=yCurr+Printer.Canvas.TextHeight('M';);
 dimPage := Rect(295,yCurr,1276,2000);
 tmp:= 'Date     Enseignant              Duree   Suppleant
 NAS        ';
 drawtext(Printer.Canvas.Handle,pchar(tmp), length(tmp),dimPage,DT_LEFT);
 Printer.Enddoc;
 
 Comment parvenir au résultat escompté?


---------------
Borland rulez: http://pages.infinit.net/borland
mood
Publicité
Posté le 26-06-2002 à 14:18:58  profilanswer
 

n°166399
zion
Plop
Posté le 26-06-2002 à 14:50:05  profilanswer
 

Tiré de la JVCL
 

Code :
  1. procedure TJvPrint.Print(Value: TStringList);
  2. var
  3.   I, Line, Pagenum: Integer;
  4. begin
  5.   //let's print
  6.   if Assigned(FOnBegin) then
  7.     FOnBegin(Self);
  8.   line := 0;
  9.   Printer.BeginDoc;
  10.   Pagenum := 1;
  11.   for i := 0 to Value.Count - 1 do
  12.   begin
  13.     if Assigned(FOnProgress) then
  14.       FOnProgress(Self, i + 1, Value.Count);
  15.     Line := Line + Printer.Canvas.TextHeight(Value[i]);
  16.     if Line + Printer.Canvas.TextHeight(Value[i]) > Printer.PageHeight then
  17.     begin
  18.       Line := Printer.Canvas.TextHeight(Value[i]);
  19.       Printer.NewPage;
  20.       Inc(PageNum);
  21.       if Assigned(FonNextP) then
  22.         FonNextP(Self, PageNum);
  23.     end;
  24.     Printer.Canvas.TextOut(0, Line, Value[I]);
  25.   end;
  26.   Printer.EndDoc;
  27.   if Assigned(FOnEnded) then
  28.     FOnEnded(Self);
  29. end;


 
En enlevant les events ca devrait aller pour toi  ;)


---------------
Informaticien.be - Lancez des défis à vos amis
n°166784
os2
Posté le 26-06-2002 à 23:26:40  profilanswer
 

j'ai eu problème de largeur on dirait car ça n'imprime pas tout ce qui devait imprimer
et je me demande pourquoi

n°166825
zion
Plop
Posté le 27-06-2002 à 00:09:57  profilanswer
 

benh fais un retour à la ligne tiens
 
TextWidth ca pue des pieds?  :sarcastic:


Message édité par zion le 27-06-2002 à 00:10:10

---------------
Informaticien.be - Lancez des défis à vos amis
n°167527
os2
Posté le 27-06-2002 à 17:32:11  profilanswer
 

ok c'est correct maintenant
 
j'essaie d'imprimer le contenu d'un dataset en collone....
ça imprime mais rien n'est aligné
 
j'aimerais avoir un effet comme
 
jean     Thibeau  14 am
mathieu   Raymond 45 journée
julie    smith    12 pm
......
 
la ça ressemble plutôt à
 
jean Thibeau 14 am
mathieu Raymond 45 journée
julie smith 12 pm  
 
j'ai pas vraiment trouvé d'information pour le résultat que je veux
 
mon code

Code :
  1. XCols[1]:=0;
  2. Curr:=255;
  3. Printer.Canvas.Font.Size:=12;
  4. Printer.Canvas.Font.Name := 'Times New Roman';
  5. with cdsBesoin do
  6. begin
  7.   tmp := format(FieldByName('Nom').AsString +  ' ' +
  8.                 FieldByName('Nom').AsString +  ' ' +
  9.                 FieldByName('Age').AsInteger+  ' ' +
  10.                 FieldByName('Duree').AsString ,[i,i,i,i]);
  11.   TabbedTextOut(Printer.Canvas.Handle, 295, yCurr, PChar(tmp), length(tmp), 4, XCols[1], 0);
  12.   yCurr:=yCurr+Printer.Canvas.TextHeight('M');
  13.   Next;
  14. end;


---------------
Borland rulez: http://pages.infinit.net/borland

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Delphi/Pascal

  compréhension d'impression....

 

Sujets relatifs
mes images de fond de <span> n'apparaissent pas à l'impression!!pb de comprehension de position de calque (relative/absolute)
[HTML, PHP, JS] Impression d'une page webImpression, Comment retrouver le nombre de bacs d'une imprimante?
Delphi ou C++Builder, impression et paramètres de l'imprimante.. HELP![Avis] Faire un soft d'impression
[VC++] pb de comprehensionImpression d'un etat en C++ Builder ou Delphi HELP!
version de style pour l'impression media="print" ???[VB] Impression
Plus de sujets relatifs à : compréhension d'impression....


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR