Accueil > > > TACHE D'IMPRESSION, CRÉATION D'UN CARTOUCHE
TACHE D'IMPRESSION, CRÉATION D'UN CARTOUCHE
Information sur la source
Description
Ce code utilise l'objet printer et permet de créer un cartouche avec des informations (variables globales) prisent dans un fichier.
Source
- Dim fichier As String
-
- '''''prereglage
- Printer.ScaleMode = vbMillimeters
- Printer.Orientation = 2
- Printer.PaperSize = 8 'A3
-
- fichier = "c:\app\u101\cfg\ReglageImpression.ini"
- 'on doit lire le fichier parametre impression
- If TestFichierExiste(fichier) = FIC_OK Then
- Call ReadParamImpression(fichier)
- Else
- MsgBox ("le fichier param impression n'existe pas!")
- Exit Sub
- End If
-
- fichier = "\\10.120.96.227\cfg\config.ini"
- If TestFichierExiste(fichier) = FIC_OK Then
- Call ReadFic_Param(fichier)
- Else
- MsgBox ("le fichier param n'existe pas !")
- End If
-
- G_OffsetX = 0
- G_OffsetY = 30
-
-
-
- 'on vient lire le fichier présence plateau
- fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_PresencePlateau
- Call ImpressionPlateau(fichier)
-
- 'on vient lire le fichier défaut
- fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_Defaut
- Call ImpressionDefaut(fichier)
-
- 'on vient lire le fichier marque!
- fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_Marque
- Call ImpressionMarque(fichier)
-
-
- 'on trace le contour du balayage
- Printer.DrawStyle = vbDashDot
- Printer.DrawWidth = 4
- Printer.Line (G_OffsetX, G_OffsetY)-(G_OffsetX + G_Longueur / G_Echelle, G_OffsetY + G_Largeur / G_Echelle), , B
-
- Printer.DrawStyle = vbSolid
- Printer.DrawWidth = 1
- 'on trace le cartouche
- '1ere ligne
- Printer.Line (0, 0)-(50, 10), , B
- Printer.Line (50, 0)-(100, 10), , B
- Printer.Line (100, 0)-(150, 10), , B
- Printer.Line (150, 0)-(200, 10), , B
- Printer.Line (200, 0)-(230, 10), , B
- Printer.Line (230, 0)-(240, 10), G_TabCouleurDefaut(1), BF
- Printer.Line (240, 0)-(270, 10), , B
- Printer.Line (270, 0)-(280, 10), G_TabCouleurDefaut(4), BF
-
- '2eme ligne
- Printer.Line (0, 10)-(50, 20), , B
- Printer.Line (50, 10)-(150, 20), , B
- Printer.Line (150, 10)-(200, 20), , B
- Printer.Line (200, 10)-(230, 20), , B
- Printer.Line (230, 10)-(240, 20), G_TabCouleurDefaut(2), BF
- Printer.Line (240, 10)-(270, 20), , B
- Printer.Line (270, 10)-(280, 20), G_TabCouleurDefaut(5), BF
-
- '3eme Ligne
- Printer.Line (0, 20)-(50, 30), , B
- Printer.Line (50, 20)-(100, 30), , B
- Printer.Line (100, 20)-(150, 30), , B
- Printer.Line (150, 20)-(200, 30), , B
- Printer.Line (200, 20)-(230, 30), , B
- Printer.Line (230, 20)-(240, 30), G_TabCouleurDefaut(3), BF
- Printer.Line (240, 20)-(270, 30), , B
- Printer.Line (270, 20)-(280, 30), , B
-
- 'on renseigne le text :
- With Printer
- ''''''''''''''''''''''''''''''''''''''''''1ere colonne'''''''''''''''''''''''''''''
- 'Nom Machine
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 2
- .CurrentY = 2
- Printer.Print "U101"
-
- 'Nom Operateur
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 2
- .CurrentY = 12
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Opérateur : "
- .CurrentX = 27
- .CurrentY = 12
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_NomOperateur
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
-
-
- 'Date
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 2
- .CurrentY = 22
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Date : "
- .CurrentX = 27
- .CurrentY = 22
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_Date
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
- ''''''''''''''''''''''''''''''''''''''''''2eme colonne'''''''''''''''''''''''''''''
- 'Plateau
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 52
- .CurrentY = 2
- Printer.Print "Plateau"
-
- 'FCI
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 52
- .CurrentY = 12
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Four / Coulée / Indice :"
- .CurrentX = 102
- .CurrentY = 12
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_NumFour & " / " & G_NumCoulee & " / " & G_Indice
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
-
- 'Alliage
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 52
- .CurrentY = 22
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Alliage : "
- .CurrentX = 77
- .CurrentY = 22
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_Alliage
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
-
-
- ''''''''''''''''''''''''''''''''''''''''''3eme colonne'''''''''''''''''''''''''''''
- 'Format
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 102
- .CurrentY = 2
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Format : "
- .CurrentX = 127
- .CurrentY = 2
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_Format
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
-
- 'Qualite
- .FontName = "Arial"
- .FontSize = 10
- .CurrentX = 102
- .CurrentY = 22
- Printer.FontItalic = False
- Printer.FontUnderline = True
- Printer.FontBold = True
- Printer.Print "Qualité : "
- .CurrentX = 127
- .CurrentY = 22
- Printer.FontItalic = True
- Printer.FontUnderline = False
- Printer.FontBold = False
- Printer.Print G_Qualite
- Printer.FontItalic = False
- Printer.FontUnderline = False
- Printer.FontBold = False
Dim fichier As String
'''''prereglage
Printer.ScaleMode = vbMillimeters
Printer.Orientation = 2
Printer.PaperSize = 8 'A3
fichier = "c:\app\u101\cfg\ReglageImpression.ini"
'on doit lire le fichier parametre impression
If TestFichierExiste(fichier) = FIC_OK Then
Call ReadParamImpression(fichier)
Else
MsgBox ("le fichier param impression n'existe pas!")
Exit Sub
End If
fichier = "\\10.120.96.227\cfg\config.ini"
If TestFichierExiste(fichier) = FIC_OK Then
Call ReadFic_Param(fichier)
Else
MsgBox ("le fichier param n'existe pas !")
End If
G_OffsetX = 0
G_OffsetY = 30
'on vient lire le fichier présence plateau
fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_PresencePlateau
Call ImpressionPlateau(fichier)
'on vient lire le fichier défaut
fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_Defaut
Call ImpressionDefaut(fichier)
'on vient lire le fichier marque!
fichier = "C:\Donnees\Plateau\" & G_NomBalayage & "\" & Fichier_Marque
Call ImpressionMarque(fichier)
'on trace le contour du balayage
Printer.DrawStyle = vbDashDot
Printer.DrawWidth = 4
Printer.Line (G_OffsetX, G_OffsetY)-(G_OffsetX + G_Longueur / G_Echelle, G_OffsetY + G_Largeur / G_Echelle), , B
Printer.DrawStyle = vbSolid
Printer.DrawWidth = 1
'on trace le cartouche
'1ere ligne
Printer.Line (0, 0)-(50, 10), , B
Printer.Line (50, 0)-(100, 10), , B
Printer.Line (100, 0)-(150, 10), , B
Printer.Line (150, 0)-(200, 10), , B
Printer.Line (200, 0)-(230, 10), , B
Printer.Line (230, 0)-(240, 10), G_TabCouleurDefaut(1), BF
Printer.Line (240, 0)-(270, 10), , B
Printer.Line (270, 0)-(280, 10), G_TabCouleurDefaut(4), BF
'2eme ligne
Printer.Line (0, 10)-(50, 20), , B
Printer.Line (50, 10)-(150, 20), , B
Printer.Line (150, 10)-(200, 20), , B
Printer.Line (200, 10)-(230, 20), , B
Printer.Line (230, 10)-(240, 20), G_TabCouleurDefaut(2), BF
Printer.Line (240, 10)-(270, 20), , B
Printer.Line (270, 10)-(280, 20), G_TabCouleurDefaut(5), BF
'3eme Ligne
Printer.Line (0, 20)-(50, 30), , B
Printer.Line (50, 20)-(100, 30), , B
Printer.Line (100, 20)-(150, 30), , B
Printer.Line (150, 20)-(200, 30), , B
Printer.Line (200, 20)-(230, 30), , B
Printer.Line (230, 20)-(240, 30), G_TabCouleurDefaut(3), BF
Printer.Line (240, 20)-(270, 30), , B
Printer.Line (270, 20)-(280, 30), , B
'on renseigne le text :
With Printer
''''''''''''''''''''''''''''''''''''''''''1ere colonne'''''''''''''''''''''''''''''
'Nom Machine
.FontName = "Arial"
.FontSize = 10
.CurrentX = 2
.CurrentY = 2
Printer.Print "U101"
'Nom Operateur
.FontName = "Arial"
.FontSize = 10
.CurrentX = 2
.CurrentY = 12
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Opérateur : "
.CurrentX = 27
.CurrentY = 12
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_NomOperateur
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
'Date
.FontName = "Arial"
.FontSize = 10
.CurrentX = 2
.CurrentY = 22
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Date : "
.CurrentX = 27
.CurrentY = 22
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_Date
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
''''''''''''''''''''''''''''''''''''''''''2eme colonne'''''''''''''''''''''''''''''
'Plateau
.FontName = "Arial"
.FontSize = 10
.CurrentX = 52
.CurrentY = 2
Printer.Print "Plateau"
'FCI
.FontName = "Arial"
.FontSize = 10
.CurrentX = 52
.CurrentY = 12
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Four / Coulée / Indice :"
.CurrentX = 102
.CurrentY = 12
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_NumFour & " / " & G_NumCoulee & " / " & G_Indice
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
'Alliage
.FontName = "Arial"
.FontSize = 10
.CurrentX = 52
.CurrentY = 22
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Alliage : "
.CurrentX = 77
.CurrentY = 22
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_Alliage
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
''''''''''''''''''''''''''''''''''''''''''3eme colonne'''''''''''''''''''''''''''''
'Format
.FontName = "Arial"
.FontSize = 10
.CurrentX = 102
.CurrentY = 2
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Format : "
.CurrentX = 127
.CurrentY = 2
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_Format
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
'Qualite
.FontName = "Arial"
.FontSize = 10
.CurrentX = 102
.CurrentY = 22
Printer.FontItalic = False
Printer.FontUnderline = True
Printer.FontBold = True
Printer.Print "Qualité : "
.CurrentX = 127
.CurrentY = 22
Printer.FontItalic = True
Printer.FontUnderline = False
Printer.FontBold = False
Printer.Print G_Qualite
Printer.FontItalic = False
Printer.FontUnderline = False
Printer.FontBold = False
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Impression de modèle [ par totof ]
Comment créer un modèle (une feuille) qui fait appelle à des données (textbox, combobox,...) et qui pourra être imprimée?
Au Secours - impression [ par bouli ]
Lorsque j'envoie le contenu d'un textbox multiligne vers un objet print et que j'imprime cet objet, la première ligne s'imprime au bon endroit (défin
Impression d'un richtextbox [ par momo ]
Je souhaite imprimer le contenu formaté d'un contrôle Richtextbox à partir d'un point quelconque de la feuille et sur la largeur voulue or la méthode
Qualité d'impression [ par Raynald ]
Bonjour, j'utilise VB6 avec une imprimante matricielle Epson LQ2550.Depuis que j'ai installé Windows 98, l'imprimante passe 2 fois sur la même ligne
Comment paramètrer l'impression d'un RichTextBox ? [ par Phèdre ]
J'arrive à imprimer, mais des lignes manques ou/et sont coupées sur la largeur des caractères.Cela ne s'améliore pas lorsque je change de police ou de
Imprime quand et fini quand??? [ par Le J ]
Salut,J'aimerais savoir quand mon impression part et quand elle fini....le tout dans le but de faire une animation pendant l'impression!!!!Si vous sav
Impression d'un Etat Access 97 depuis VB ? [ par joez ]
est ce possible ? Et si oui comment ?Merci ;))
Etat sous VB6 [ par GIGI ]
Comment définir un état en impression paysage sous VB6.J'ai essayé diverses méthodes dont celle de définir l'objet imprimante en paysage avant de lanc
Impression document Word par VB [ par merlin ]
Je cherche a imprimer un document word a partir de VB, suivant le meme principe qu'avec l'explorateur. J'y arrive avec des document Paint, Notepad, ma
Impression d'état en VB 6 [ par Aziz ]
Je suis nouveau en visual basic, je sais pas comment travailler avec le contrôle DataReport pour imprimmer des états (grouppement, expression, variabl
|
Derniers Blogs
[FRAMEWORK 4] LES TASKS ET LE THREAD UI[FRAMEWORK 4] LES TASKS ET LE THREAD UI par fathi
Je viens de passer quelques temps au TechDay's et j'ai pu voir pas mal de session intéressante. Par contre une chose m'a un peu étonné lors de certaines de ces sessions qui abordaient les améliorations du framework .NET (donc le 4.5) : en gros, bea...
Cliquez pour lire la suite de l'article par fathi WORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBEWORKFLOW FOUNDATION 3 A UN PIED DANS LA TOMBE par JeremyJeanson
Depuis déjà un an, je conseille vivement les utilisateurs de Workflow Foundation 3 à migrer vers la version 4. L'information qui va suivre ne devrait donc pas trop prendre au dépourvu les personnes qui m'ont suivi. Je profite de ce poste, pour faire le re...
Cliquez pour lire la suite de l'article par JeremyJeanson TECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PCTECHDAYS PARIS 2012 : NOUVELLES TENDANCES DU POSTE DE TRAVAIL - BRING YOUR OWN PC par ROMELARD Fabrice
Speakers: Thierry Rapatout, Antoine Petit et Xavier Trebbia Cette session entre dans le cadre des RDV Décideurs des TechDays 2012, elle est liée à la consumérisation de l'IT et la mise en place du "DeskTop as a Service" dans de plus en ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLETECHDAYS PARIS 2012 : SYSTEM CENTER SERVICE MANAGER 2012 VUE D'ENSEMBLE par ROMELARD Fabrice
Speakers: Julien Marechal, Gautier Confiant, Sébastien MEYER La session débute par le positionnement de la solution System Center par rapport aux concepts d'organisation ITIL. Le portail du catalogue de se...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2012 : PLEINIèRE SECOND JOURTECHDAYS PARIS 2012 : PLEINIèRE SECOND JOUR par ROMELARD Fabrice
Après une première journée dédiée aux développeurs, cette seconde journée est dédiée au monde des entreprises et de ses applications. Ainsi, cette pleinière est dédiée à faire un 360 de l'évolution des applications Business aux demandes ac...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
VB6 + GRAPHVIZVB6 + GRAPHVIZ par nouirayosra
Cliquez pour lire la suite par nouirayosra
Logiciels
Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|