English
Forum

elegant Druckausgabe

 

Sebald
Grandjean
Hi,

following task: create of/ one einfachen Eingabemaske for a Buchungsanordnung. Transactions create, Edit, delete etc. In Profan one children's play!

a little bit anspruchsvoller is the Druckausgabe, because there there a very tricky gestalteten form (lines, Kästchen, further boxes, The later by hand ausgefüllt go, etc.)

How would your such a thing solve? with the Zeichenfunktionen of Profan each element on The screen 'malen' or vllt. still a BMP loading, The The erforderlichen items already contain and then The inputted values drüberdrucken let? gives it Perhaps another others Possibility?

Greeting Sebald
 
02/08/18  
 




H.Brill
How see it because with of/ one GridBOX from,
means of/ one scheduler ?

to that print out the Gitternetzes use I always
that here (Printgrid.inc) :
 $H commctrl.ph
 $H Structs.ph
 $H Messages.ph

Proc CountGridColumns

    Parameters lever hGrid
    Declare Memory b
    Declare flag&
    Var TotalColumns& = 0
    Struct LV_COLUMN = ~LV_COLUMN
    Dim b, LV_COLUMN
    b.mask& = ~LVCF_WIDTH

    Repeat

        Inc TotalColumns&
        flag& = SendMessage(hGrid, ~LVM_GETCOLUMN, TotalColumns&, b)

    Until flag& = 0

    Dispose b
    Return TotalColumns&

ENDPROC

Proc LV_GETCOLUMN

    Parameters lever Hdl,Index&
    Declare Column#,Text$,success%
    Struct LVCOLUMN = mask&, fmt&, cx&, pszText%%, cchTextMax&, iSubItem&, iImage&, iOrder&
    Dim Column#, LVCOLUMN
    Text$ = MkStr$("\z",160)' here adjust, if The Texts longer his should
    Column#.mask& = ~LVCF_TEXT
    Column#.pszText%% = Addr(Text$)
    Column#.cchTextMax& = 160' s.o.
    SendMessage(Hdl,~LVM_GETCOLUMN,Index&,Column#)
    Return Text$

ENDPROC

Proc ErstelleHTM

    Parameters lever dGrid, us$, htmdatei$
    Declare anz&, row$, cols&, column$, tmp$
    cols& = CountGridColumns(dGrid)
    Declare Memory b
    Assign #1, htmdatei$
    Rewrite #1
    Print #1,"<!DOCTYPE html PUBLIC"+chr $(34)+"-//W3C//DTD XHTML 1.0 Transitional//EN"+chr $(34)+"https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"+chr $(34)+">"
    Print #1, "<html xmlns="+chr $(34)+"https://www.w3.org/1999/xhtml"+chr $(34)+" xml:lang="+chr $(34)+"de"+chr $(34)+" lang="+chr $(34)+"de"+chr $(34)+">"
    Print #1,"<head>"
    Print #1, "<title>" + us$ + "</title>"
    Print #1, "<style type="+chr $(34)+"text/css"+chr $(34)+">"
    Print #1, "td {font-family:Verdana; font-size:12px; border: 1px sound rgb(0, 0, 0); padding: 3px; Text-align: left}"
    Print #1, "th {font-family:Verdana; font-size:12px; font-weight:bold; border: 1px sound rgb(0, 0, 0); padding: 3px; Text-align: left}"
    Print #1, ".row1 {font-family:Verdana; font-size:12px; }"
    Print #1, ".row3 {font-family:Verdana; font-size:12px;color:black; background-color:#A8D2FD;}"
    Print #1, "</style>"
    Print #1,"</head>"
    Print #1, "<body>"
    Print #1, "<table>"
    Print #1, "<colgroup>"
    Struct LV_COLUMN = Maske&,Formate&,SpaltenBreite&,pointerText&,TextLen&,Spalte&
    Declare Column#,x&
    Dim Column#,LV_COLUMN

    WhileLoop 0,(cols& - 1),1

        With Column#

            .Maske&         = $000F
            .Spalte&        = &loop

        EndWith

        SendMessage(Grid,$1019,&loop,Column#)
        x&= SendMessage(Grid,$101D,&loop,0)
        Print #1, "<col width="+chr $(34)+Str $(x&)+"px"+chr $(34)+">"

    EndWhile

    Print #1, "</colgroup>"
    Print #1, "<tr >"

    WhileLoop 0, Cols&-1

        Print #1, "<th class="+chr $(34)+"zeile3"+chr $(34)+">" + Trim $(LV_GETCOLUMN(dGrid, &loop)) + "</th>"

    EndWhile

    Print #1, "</tr>"
    anz& = GetCount(dGrid)
    Var x%=0

    While x%<anz&

        Print #1, "<tr>"

        WhileLoop 0, Cols&-1

            Print #1, "<td class="+chr $(34)+"zeile1"+chr $(34)+">" + Trim $(GetText$(dGrid, x%, &loop)) + "</td>"

        EndWhile

        Print #1, "</tr>"
        inc x%

    EndWhile

    Print #1, "</table>"
    Print #1, "</body>"
    Print #1, "</html>"
    Close #1
    '@ShellExec(htmdatei$, "open", 1)

ENDPROC

Proc ShowHtm

    Parameters lever hwindow, Grid, String File, us$
    Declare lever htmWin, hWin, hbtn1, hbtn2, Int end2
    end2 = 0
    ErstelleHTM(Grid, us$, File)' Html-File produce
    hWin  = @Create("Dialog", hwindow, "HTML - Fenster", 10, 10, 800, 400)
    hbtn1 = @Create("Button", hWin, "Drucke", 10, 10, 60, 25)
    hbtn2 = @Create("Button", hWin, "Ende", 100,  10, 60, 25)
    htmWin = @Create("HTMLWin", hWin, File, 1, 10, 60, 750, 300)

    WhileNot end2

        WaitInput

        If @Clicked(hbtn1)

            ' Print
            Messagebox("Mit right Mouse button on The scheduler clicking\nund in the Kontexmenü Print select !", "Info", 0)
            '@ShellExec(File, "print", 0)

        ElseIf @Clicked(hbtn2)

            DestroyWindow(hWin)
            end2 = 1
            SetActiveWindow(%HWnd)

        EndIf

    EndWhile

    DestroyWindow(hWin)

ENDPROC


expression : ShowHtm(Fensterhandle, Gridboxhandle, Htmldatei, us$)
Htmldatei is only one Dateiname -> z.B. pressure.html. if one
later times the Htmldatei in the Browser look at/again print would like.
us$ = Headline.

you mußt only look, that each area with something filled is, otherwise
see it later not so beautiful from.

If it only a Page is, could one too with ScreenCopy or
WinCopy try.

otherwise hold on a Bitmap draw and StartPrint...EndPrint
on the printer spend.

there should I of you little more Info having, How the in the individual
looks.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
02/08/18  
 




Sebald
Grandjean
Vielen Thanks!
I forgot: I use another XProfan 10 from 2006, will be soon but time arm on The X4, as they new rauskommt.

inside the boxing müssten then over again Rechtecke and Striche showing, what The thing yet komplexer make would. unfortunately To everything Übel still different Schriftgrößen (
 
02/08/18  
 




H.Brill
Well, draw can you Yes with the Grafikbefehlen
Rectangle,Line, LineTo etc.

means, i'd there everything on one Static (is so a manner
screen) make.

here time one Ansatz :
Declare lever label1, label2, edit1, edit2, static
Declare lever btn1, btn2
Declare Int end
Window 800, 400
static = Create("Static", %HWnd, 10, 10, 350, 200)
label1 = Create("Text", static, "Nummer :", 10, 10, 80, 25)
label2 = Create("Text", static, "Name   :", 10, 40, 80, 25)
edit1  = Create("Edit", static, "", 90, 10, 40, 25)
edit2  = Create("Edit", static, "", 90, 40, 120, 25)
btn1   = Create("Button", %Hwnd, "Drucken", 380, 10, 60, 25)
btn2   = Create("Button", %HWnd, "Ende",    380, 40, 60, 25)
StartPaint static
DrawIcon "A", 50, 80
DrawIcon "GESICHT", 100, 80
UseFont "ARIAL", 24, 16, 1, 0, 0
DrawText 10, 120, "Erster Text !"
UseFont "ARIAL", 16,   8, 1, 0, 0
DrawText 10, 170, "Zweiter Text !"
EndPaint
end = 0

WhileNot end

    WaitInput

    If Clicked(btn1)

        ' Print
        WinCopy static

    ElseIf Clicked(btn2)

        end = 1

    EndIf

    Case %Key = 2 : end = 1

EndWhile

End

the might too in Version 10 walk.

ought to to the form on screen or on the paper
fill out can ?
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
02/08/18  
 




Sebald
Grandjean
The display is only as a manner Endkontrolle virtual, that one sees, what there ausgedruckt becomes. Ausgefüllt becomes then nothing more, except to the Print out by hand.

no large thing on itself, i'll the well over one JPG or BMP make and then objectively whom Eingabetext drüberzeichnen. there DINA4 The Ausgabegröße is, must I well on one element zurückgreifen, what scrollable is.

p.s. the code supra causes Variablenfehler, I must the later on the evening time try.
 
02/08/18  
 




H.Brill
can his, that the Version yet none Variablentyp
lever knows. means simply The variables with Postfix
% or & deklarieren.

Search time here to Mainwindow with Scroll bar.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
02/08/18  
 




Sebald
Grandjean
i'm profantechnisch unfortunately hopelessly antiquated (Prfellow-generation....). The thing I get not ans walk. this is not really tragic, whom expression I get there.

an Print Preview will with einfachen Mitteln well not release let. it reicht first of all, The Inputs editierbar to have, what Yes a light task is.

only on the side: Currently runs The story in EXCEL with something VB. I have whom ambition it 'stand alone' in Profan To release.
 
02/08/18  
 




H.Brill
You can indeed the Free FreeProfan take.
there are you at least time on the stood version of X2.

If it in EXCEL + something VB goes, get to the with
Profan too there. what a editierbare GridBOX concerns, there have
so did i what moreover, what too functions.
 
Benutze XPROFAN X3 + FREEPROFAN
Wir sind die XProfaner.
Sie werden von uns assimiliert.
Widerstand ist zwecklos!
Wir werden alle ihre Funktionen und Algorithmen den unseren hinzufügen.

Was die Borg können, können wir schon lange.
02/09/18  
 




E.T.
Something like I had to langer, langer Time time in X11 gebastelt, with simpler Print Preview and Druckfunktion .
I pack time 'nen Screenshot from the Print Preview and a expression (on pdf-printer made) ran.

If interested can I Yes time on the WE whom View source raussuchen. was but, there any items particular drawn go, one right "aufwendiges" part. naturally get div. data of Program ausgefüllt, if The data in the DB present were. If I right entsinne, even printer-Anpassung (Borders etc.)

 
XProfan X3
Grüße aus Sachsen... Mario
WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte...
02/09/18  
 




Sebald
Grandjean
E.T. (09.02.2018)
Something like I had to langer, langer Time time in X11 gebastelt.....


perfect! so I will the too hinbekommen. The Druckroutine is no so large trouble, even Fleißarbeit. The Durckvorschau (with Scroll bar) already sooner.
 
02/09/18  
 




Michael
W.
The trouble with the Print Preview make I I do not. the can with the Druckerdialog to the expression of Druckertreiber/windows entleihen. there can also aborted go.

with whom Images, if it then his should, would I one verlustfreies stature (means png) dial, so there everything spicy To see is. think too on it: If you plenty with lines draw must, then look you The Metafiles (emf) on.
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
02/09/18  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

6.661 Views

Untitledvor 0 min.
E.T.12/09/22
Stringray01/05/22
R.Schneider01/29/21
Manfred Barei01/29/21
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie