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
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|