Seite 1 von 3

Formularerstellung

Verfasst: 20.03.2015 07:50
von Fanpost
Hallo! Ich brauche da mal einen Denkanstoß im Bezug auf die Erstellung eines Formulares, hier Prüfprotokoll, mit grafischen Elementen, d.h. Rahmen, Textfenster, Logo usw.
Das Formular soll sich in einer externen Datei befinden.

Re: Formularerstellung

Verfasst: 20.03.2015 18:21
von Andesdaf

Re: Formularerstellung

Verfasst: 22.03.2015 16:33
von Fanpost
Super Antwort - als Anfänger bin ich nun total begeistert

Re: Formularerstellung

Verfasst: 22.03.2015 22:41
von Andesdaf
Was du genau meinst, kann ich leider nicht nachvollziehen. Deshalb gab es von mir einen Denkanstoß ins Blaue hinein.
Die verlinkte Hilfeseite bietet am Ende einige Beispiele, du könntest also zumindest ausschließen, dass es nicht das ist,
woran ich gedacht habe. Ich dachte daran, dass du ein Window aus einer externen Datei erzeugen möchtest.

Wenn du etwas zum Drucken brauchst, versuch es mal mit den Befehlen der 2DDrawing-Library in Verbindung mit der
Printer-Library. Beispiele finden sich in der Hilfe.

Falls es dir um das Erstellen von PDFs geht, hilft PurePDF vielleicht.

Re: Formularerstellung

Verfasst: 22.03.2015 23:00
von Sicro
Fanpost hat geschrieben:Super Antwort - als Anfänger bin ich nun total begeistert
Der genannte Befehl ( OpenXMLDialog() ) erstellt aus einer externen Datei Programmfenster mit den Elementen (Textboxes, Buttons usw.). Ein Programmfenster nennt man auch gerne mal Form (englisch) oder Formular. Deshalb ist dein Formular zweideutig zu verstehen. Also bleib mal locker, die Leute hier helfen dir kostenlos und auf Kosten ihrer Freizeit.

Du meinst also so ein Formular?
https://de.wikipedia.org/wiki/Formular

In dem Fall könnte man ebenfalls OpenXMLDialog() nehmen und das Formular in einem ScrollAreaGadget darstellen oder du generierst eine HTML-Seite, die das Formular darstellt, und zeigst sie im Programmfenster per WebGadget an.

Re: Formularerstellung

Verfasst: 23.03.2015 10:12
von Fanpost
Ich habe zur Zeit keine Ahnung, wie ich solch ein Formular in PB einbinden kann. Kann ein solches Formular direkt eingelesen und bearbeitet werden, muss es in PB "zusammengebaut" werden?

Das Formular besteht aus 2 Seiten und muss wie folgt aussehen:


http://www.bilder-upload.eu/show.php?fi ... 097272.jpg
http://www.bilder-upload.eu/show.php?fi ... 097346.jpg

Re: Formularerstellung

Verfasst: 23.03.2015 11:22
von NicTheQuick
Da bieten sich ja eigentlich bessere Lösungen an. Das könnte man mit LibreOffice Writer oder Word auch direkt machen. Notfalls mit Adobe Acrobat Pro, falls man den besitzt. Das wäre jedenfalls weniger umständlich als eine EXE-Datei, gegenüber der ich dann sowieso eher skeptisch wäre.
In PB ist das zwar auch machbar, aber es wird nicht so aussehen wie auf deinen Bildern, sondern man würde die normalen Texteingabefelder und Checkboxen des Betriebssystem sehen und nicht dieses schwarz auf weiß haben, wie in deinen Screenshots zu sehen ist.

Re: Formularerstellung

Verfasst: 23.03.2015 12:37
von Kiffi
eine weitere Möglichkeit wäre es, die Formulare in HTML-Form zu erstellen (externe Datei) und diese in ein WebGadget() zu laden und auszufüllen.
Auch der Ausdruck von diesen Formularen wäre in diesem Fall relativ einfach.

Grüße ... Peter

Re: Formularerstellung

Verfasst: 12.05.2015 18:07
von Fanpost
Hallo,

ich habe mit dem hcgenerator, hier aus dem Forum, ein Formular erstellt und möchte das Formular direkt drucken und nicht erst über einen Browser. Code-Schnipsel habe ich genug gefunden, bin aber (noch) nicht in der Lage eine Druckroutine einzubauen. Beim ersten Start wird das Formular nicht angezeigt. Das Prog muss 2x gestartet werden. Habe ich hier nur zu Demozwecken gemacht, da der Code hier dann zu lang wird. Wer kann helfen?

Gruss

Hartmut

Habe leider nicht an die Umlaute gedacht - Anfängerfehler

Code: Alles auswählen

 #DONTPROMPTUSER = 2
  #PREVIEW = 7
  #Gid = 1
  #Adresse = 0
  #OLECMDID_PRINT = 6
  #OLECMDEXECOPT_DONTPROMPTUSER = 2

OpenWindow(0, 0, 0, 960, 780, "Ausdruck", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)  

Procedure drucken(_GID, _PREVIEW)
  WebGadget(#Adresse, 0, 0, 960, 780, "file://"+ GetCurrentDirectory() + "Formular_ausgefüllt.html")
  WebObject.IWebBrowser2 = GetWindowLong_(GadgetID(#Adresse), #GWL_USERDATA)
  WebObject\ExecWB(#OLECMDID_PRINT, #OLECMDEXECOPT_DONTPROMPTUSER, 0, 0)
  
  EndProcedure


drucken(#GID, #PREVIEW) 


Code: Alles auswählen

;pb-File
EnableExplicit
 
IncludeFile "oberflaeche.pbf"
 
Define event, EventGadget, EventType, EventMenu, EventWindow, prglauf
  ; <<<<<<<<<<< hier die Variable definieren
Global SNummer$, SNRH$, SWV$, SDIV$, Dat$, Na$, Te1$,Te2$,Te3$,Te4$, Te5$, Te6$, HWV$



OpenWindow_1()
 

Repeat
  Event = WaitWindowEvent()
  EventGadget = EventGadget()
  EventType = EventType()
  EventMenu = EventMenu()
  EventWindow = EventWindow()
  prglauf=Window_1_Events(Event)
Until prglauf=#False
End

  
;-------- ab hier die Proceduren für Buttons, etc. -----------------


Procedure htmlanzeigen(EventType)
  #DATEI_REPORT = 1                       ; <<<<<<<<<<<< das muss noch von Hand eingesetzt werden !!!!

If CreateFile(#DATEI_REPORT,  "Formular_ausgefüllt.html")
WriteStringN(#DATEI_REPORT,"<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'>")
WriteStringN(#DATEI_REPORT,"<!<html><head><title>Formular-mit-HCGenerator-erzeugt</title>")
WriteStringN(#DATEI_REPORT,"<!</head><body>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm; top:40mm; color:#000000;font-weight:bold;font-family:arial; font-size:22px;'>Prüfprotokoll</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm; top:56mm; color:#000000;font-weight:bold;font-family:arial; font-size:19px;'>Komponente:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:60mm; top:55mm; color:#000000;font-weight:bold;font-family:arial; font-size:24px;'>Omasbett</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:60mm; top:65.5mm; color:#000000;font-family:arial; font-size:17px;'>Firmeninternes</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:60mm; top:72.5mm; color:#000000;font-family:arial; font-size:17px;'>Dokument</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm; top:65mm; color:#000000;font-weight:bold;font-family:arial; font-size:19px;'>Vertraulichkeit:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:112mm; top:48mm; color:#000000;font-family:arial; font-size:17px;'>SNR-Hauptplatine:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:140mm; color:#000000;font-family:arial; font-size:17px;'>Sichtprüfung:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:150mm; color:#000000;font-family:arial; font-size:17px;'>Manuelle Funktion:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:160mm; color:#000000;font-family:arial; font-size:17px;'>Funktion der Ein- und Ausgänge:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:180mm; color:#000000;font-weight:bold;font-family:arial; font-size:17px;'>Gesamtergebnis der Prüfung:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:202mm; color:#000000;font-family:arial; font-size:17px;'>"+Te1$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:209mm; color:#000000;font-family:arial; font-size:17px;'>"+Te2$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:216mm; color:#000000;font-family:arial; font-size:17px;'>"+Te3$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:223mm; color:#000000;font-family:arial; font-size:17px;'>"+Te4$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:230mm; color:#000000;font-family:arial; font-size:17px;'>"+Te5$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:237mm; color:#000000;font-family:arial; font-size:17px;'>"+Te6$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:196mm; color:#000000;font-family:arial; font-size:17px;'>Bemerkung:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:112mm; top:56mm; color:#000000;font-family:arial; font-size:17px;'>SW-Version:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:112mm; top:64mm; color:#000000;font-family:arial; font-size:17px;'>SD-Image-Version:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:12mm; top:120mm; color:#000000;font-weight:bold;font-family:arial; font-size:17px;'>Art der Prüfung</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm; top:120mm; color:#000000;font-weight:bold;font-family:arial; font-size:17px;'>OK</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:182mm;top:117.5mm; height: 70mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:149mm; width: 6.5mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:149mm; height: 6.5mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:155.5mm; width: 6.8mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:191.5mm;top:149mm; height: 6.8mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:179mm; width: 6.5mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:179mm; height: 6.5mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:185.5mm; width: 6.8mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:191.5mm;top:179mm; height: 6.8mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:159mm; width: 6.5mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:159mm; height: 6.5mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:165.5mm; width: 6.8mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:191.5mm;top:159mm; height: 6.8mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:139mm; width: 6.5mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:139mm; height: 6.5mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:185mm;top:145.5mm; width: 6.8mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:191.5mm;top:139mm; height: 6.8mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:167.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:167.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:177.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:167.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:157.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:157.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:167.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:157.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:147.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:147.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:157.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:147.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:127.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:127.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:137.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:127.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:117.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:117.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:127.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:117.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:137.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:137.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:147.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:137.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:186mm; top:140mm; color:#000000;font-weight:bold;font-family:Wingdings; font-size:22px;'>ü</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:186mm; top:150mm; color:#000000;font-weight:bold;font-family:Wingdings; font-size:22px;'>ü</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:186mm; top:160mm; color:#000000;font-weight:bold;font-family:Wingdings; font-size:22px;'>ü</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:186mm; top:180mm; color:#000000;font-weight:bold;font-family:Wingdings; font-size:22px;'>ü</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:23mm; top:92mm; color:#000000;font-weight:bold;font-family:arial; font-size:19px;'>Prüfung gemäß Prüfanweisung Omas-Bett in aktuellster Version</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm; top:272mm; color:#000000;font-family:arial; font-size:17px;'>Datum: </div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:27mm; top:272mm; color:#000000;font-family:arial; font-size:17px;'>"+dat$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:65mm; top:272mm; color:#000000;font-family:arial; font-size:17px;'>Prüfer:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:81mm; top:272mm; color:#000000;font-family:arial; font-size:17px;'>"+Na$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:124mm;top:273mm; width: 68mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:148mm; top:275mm; color:#000000;font-family:arial; font-size:17px;'>Unterschrift</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:112mm; top:40mm; color:#000000;font-family:arial; font-size:17px;'>Seriennummer:</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm; top:6.5mm; color:#000000;font-family:Broadway BT; font-size:31px;'>Heikotutnix GmbH</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:56mm; color:#000000;font-family:arial; font-size:17px;'>"+SWV$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:97mm; top:7.5mm; color:#0080FF;font-family:Wingdings; font-size:31px;'>l</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:64mm; color:#000000;font-family:arial; font-size:17px;'>"+SDIV$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:40mm; color:#000000;font-family:arial; font-size:17px;'>"+SNummer$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:194.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:194.5mm; height: 49.5mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:244.0mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:194.5mm; height: 49.8mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:84mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:3px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:84mm; height: 23mm; box-shadow:0px 0px 0px black; border-left:3px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:107.0mm; width: 184.8mm; box-shadow:0px 0px 0px black; border-top:3px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:84mm; height: 23.8mm; box-shadow:0px 0px 0px black; border-left:3px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:177.5mm; width: 184mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:177.5mm; height: 10mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:10mm;top:187.5mm; width: 184.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:177.5mm; height: 10.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:48mm; color:#000000;font-family:arial; font-size:17px;'>"+SNRH$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:160mm; top:8.5mm; color:#000000;font-family:arial; font-size:19px;'>26007 Rasplatz</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:8.5mm; color:#000000;font-family:arial; font-size:19px;'>-</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:109mm; top:17mm; color:#000000;font-family:arial; font-size:16.8px;'>Tel.: 04444-974888 Mail: AM@heikotutnix</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:109mm; top:8.5mm; color:#000000;font-family:arial; font-size:19px;'>Am Nordkreuz 07</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:153mm; top:72mm; color:#000000;font-family:arial; font-size:17px;'>"+HWV$+"</div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:106mm;top:37mm; width: 88mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:106mm;top:37mm; height: 43mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:106mm;top:80.0mm; width: 88.3mm; box-shadow:0px 0px 0px black; border-top:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:194mm;top:37mm; height: 43.3mm; box-shadow:0px 0px 0px black; border-left:1px solid #000000'></div>")
    WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:112mm; top:72mm; color:#000000;font-family:arial; font-size:17px;'>HW-Version:</div>")
    ;WriteStringN(#DATEI_REPORT,"<div style='position:absolute; left:158mm; top:48mm; color:#000000;font-family:arial; font-size:17px;'>"+SNRH$+"</div>")  
  
    
    
    WriteStringN(#DATEI_REPORT,"</body></html>") 
CloseFile(#DATEI_REPORT)
EndIf
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Linux
;RunProgram("defaultbrowser", "Formular_ausgefüllt.html","")
CompilerCase #PB_OS_Windows
RunProgram("Formular_ausgefüllt.html") ; aktiviert ---> Formular wird im Browser angezeigt
CompilerCase #PB_OS_MacOS
CompilerEndSelect 
EndProcedure


Procedure machhtml(EventType)
  SNummer$ = GetGadgetText(String_kname)
  SNRH$ = GetGadgetText(String_kname_1)
  SWV$ = GetGadgetText(String_kname_2)
  SDIV$ = GetGadgetText(String_kname_3)
  Dat$ = GetGadgetText(String_kname_4)
  Na$ = GetGadgetText(String_kname_5)
  Te1$ = GetGadgetText(String_kname_6)
  Te2$ = GetGadgetText(String_kname_7)
  Te3$ = GetGadgetText(String_kname_8)
  Te4$ = GetGadgetText(String_kname_9)
  Te5$ = GetGadgetText(String_kname_10)
  Te6$ = GetGadgetText(String_kname_11)
  HWV$ = GetGadgetText(String_kname_12)
  htmlanzeigen(EventType)

EndProcedure

 
oberflaeche.pbf:

Code: Alles auswählen

;pbf-File
Global Window_1

Global Button_machhtml, String_kname, String_kname_1, String_kname_2, String_kname_3, String_kname_5, Text_0, Text_0_Copy1, Text_0_Copy2, Text_0_Copy3, Text_0_Copy3_Copy1, Text_0_Copy3_Copy1_Copy1, string_kname_4, Text_1, Text_2, Text_3, String_kname_6, String_kname_7, String_kname_8, String_kname_9, String_kname_10, String_kname_11, Button_machhtml_Copy1, Button_machhtml_Copy2, String_kname_12, Text_4

Enumeration FormGadget
  #Adresse
EndEnumeration

Enumeration FormFont
  #Font_Window_1_0
EndEnumeration

LoadFont(#Font_Window_1_0,"Arial Narrow", 18)

Declare machhtml(EventType)

Procedure OpenWindow_1(x = 0, y = 0, width = 1190, height = 890)
  Window_1 = OpenWindow(#PB_Any, x, y, width, height, "Omasbett  Protokoll Erstellung", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
  Button_machhtml = ButtonGadget(#PB_Any, 840, 580, 100, 25, "Formular erstellen")
  GadgetToolTip(Button_machhtml, "erzeugt eine html-Datei")
  String_kname = StringGadget(#PB_Any, 1010, 65, 105, 25, "150507001HL")
  GadgetToolTip(String_kname, "hier Seriennummer eingeben")
  String_kname_1 = StringGadget(#PB_Any, 1010, 105, 105, 25, "AM2013_000000")
  GadgetToolTip(String_kname_1, "hier die S-Nr. der Hauptplatine eingeben")
  String_kname_2 = StringGadget(#PB_Any, 1010, 145, 105, 25, "PT00.00.0000")
  GadgetToolTip(String_kname_2, "hier die Software-Version eingeben")
  String_kname_3 = StringGadget(#PB_Any, 1010, 185, 105, 25, "000")
  GadgetToolTip(String_kname_3, "hier die SD-Karten-Version eingeben")
  String_kname_5 = StringGadget(#PB_Any, 1010, 305, 105, 25, "Name")
  GadgetToolTip(String_kname_5, "hier den Namen des Pruefers eingeben")
  Text_0 = TextGadget(#PB_Any, 900, 70, 100, 20, "Seriennummer:")
  Text_0_Copy1 = TextGadget(#PB_Any, 900, 110, 100, 20, "SNR-Hauptplatine:")
  Text_0_Copy2 = TextGadget(#PB_Any, 900, 150, 100, 20, "SW-Version:")
  Text_0_Copy3 = TextGadget(#PB_Any, 900, 190, 100, 20, "SD-Image-Version:")
  Text_0_Copy3_Copy1 = TextGadget(#PB_Any, 900, 270, 100, 20, "Datum:")
  Text_0_Copy3_Copy1_Copy1 = TextGadget(#PB_Any, 900, 310, 100, 20, "Prüfer:")
  string_kname_4 = DateGadget(#PB_Any, 1010, 266, 105, 25, "")
  GadgetToolTip(string_kname_4, "hier evt. das Datum ändern")
  Text_1 = TextGadget(#PB_Any, 840, 360, 80, 20, "Bemerkung:")
  Text_2 = TextGadget(#PB_Any, 840, 10, 340, 50, "Protokolleingaben:")
  SetGadgetFont(Text_2, FontID(#Font_Window_1_0))
  Text_3 = TextGadget(#PB_Any, 10, 10, 300, 30, "Protokoll:")
  SetGadgetFont(Text_3, FontID(#Font_Window_1_0))
  String_kname_6 = StringGadget(#PB_Any, 840, 385, 330, 25, "")
  String_kname_7 = StringGadget(#PB_Any, 840, 415, 330, 25, "")
  String_kname_8 = StringGadget(#PB_Any, 840, 445, 330, 25, "")
  String_kname_9 = StringGadget(#PB_Any, 840, 475, 330, 25, "")
  String_kname_10 = StringGadget(#PB_Any, 840, 505, 330, 25, "")
  String_kname_11 = StringGadget(#PB_Any, 840, 535, 330, 25, "")
  Button_machhtml_Copy1 = ButtonGadget(#PB_Any, 955, 580, 100, 25, "Formular drucken")
  Button_machhtml_Copy2 = ButtonGadget(#PB_Any, 1070, 580, 100, 25, "Reserve")
  WebGadget(#Adresse, 10, 45, 810, 835, "file://"+ GetCurrentDirectory() + "Formular_ausgefüllt.html")
  String_kname_12 = StringGadget(#PB_Any, 1010, 225, 105, 25, "HW 1.91 DAT 0215")
  Text_4 = TextGadget(#PB_Any, 900, 230, 100, 20, "HW-Version:")
EndProcedure

Procedure Window_1_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Menu
      Select EventMenu()
      EndSelect

    Case #PB_Event_Gadget
      Select EventGadget()
        Case Button_machhtml
          machhtml(EventType())          
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure  

Re: Formularerstellung

Verfasst: 14.05.2015 12:44
von Fanpost
Kann keiner helfen?