Wydruk z formatki + podglad wydruku

0

Witam
Istnieje sobie formatka a na niej bedzie button - wydruk - ktory zrobi cos takiego:
Kliknięcie na w/w buttona - wydruk - spowoduje drukowanie danych z bazy danych z pliku dbf w takiej formie:

Strona nr 1

1 pole z tableli|2 pole z tableli|3 pole z tableli|4 pole z tableli|5 pole z tableli|6pole z tableli|

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

.
.
.

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

Koniec strony nr 1

Strona nr 2

Druga strona jezeli sa dane;

1 pole z tableli|2 pole z tableli|3 pole z tableli|4 pole z tableli|5 pole z tableli|6pole z tableli|

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

.
.
.

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

1 dane z tableli |2dane z tableli|3 dane z tableli|4 dane z tableli|5 dane z tableli|6dane z tableli|

koniec Strony nr 2

Koniec wydruku

Zrobilem cos takiego:
1 położyłem tabele i jest ona połaczona z "wydrukiem" bo widze dane, tak jak chciałem z 6 pól w takim ukladzie jak chce,
2 opisałem pola ustawień szerokości i wysokości oraz rozmiar papieru.

Niestety nie mogę sobie poradzić z tym:

1 Nie umiem połączyć buttona który leży na formatce z formą wydruku.
2 Utworzyc podgladu wydruku,
3 Druku strona po stronie.Żeby drukował strona po stronie.

Serdecznie pozdrawiam
waldi

0

Niestety nie mogę sobie poradzić z tym:

1 Nie umiem połączyć buttona który leży na formatce z formą wydruku.
2 Utworzyc podgladu wydruku,
3 Druku strona po stronie.Żeby drukował strona po stronie.

Byłbyś uprzejmy wkleić kod źródłowy tego co już masz? Rozwiąże Twoje problemy.
Jeśli używasz printDocument, i drukarka drukuje Ci to co renderuje metoda printEvent, wystarczy go (printDocument) jedynie "podpiąć" pod kontrolkę printPreview. Teraz printPreview.Show() i twój wydruk zamiast na drukarkę, poleci na printPreview - to jest bardzo dobre rozwiązanie ze strony Microsoftu.

(ale nigdy nie pojmę sposobu deklarowania i definiowania tablic, zdarzeń i tego, że main() jest częścią obiektu podrzędnego.)

PS. Czy ktoś z Was wie może jak zautomatyzować śledzenie położenia kursora (point) podczas rysowania na Graphics drukarki?

0

Witam,
pisze w D5 i mam taki kod w pliku wydruku:

unit wydruk;

interface

uses
SysUtils, Windows, Messages, Classes, Graphics, Controls,
StdCtrls, ExtCtrls, Forms, QuickRpt, QRCtrls, Db, DBTables;

type
TForm1 = class(TForm)
KontrLQReport: TQuickRep;
PageFooterBand1 : TQRBand;
QRExpr1 : TQRExpr;
ColumnHeaderBand1 : TQRBand;
DetailBand1 : TQRBand;
QRLabel1 : TQRLabel;
QRExpr2 : TQRExpr;
QRLabel2 : TQRLabel;
QRExpr3 : TQRExpr;
QRLabel3 : TQRLabel;
QRExpr4 : TQRExpr;
QRLabel4 : TQRLabel;
QRExpr5 : TQRExpr;
QRLabel5 : TQRLabel;
QRExpr6 : TQRExpr;
QRLabel6 : TQRLabel;
QRExpr7 : TQRExpr;
Table1 : TTable;
TitleBand1: TQRBand;
QRLabel7: TQRLabel;
private
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

end.

to jest środek tego pliku
Serdecznie pozdrawiam
waldi

1 użytkowników online, w tym zalogowanych: 0, gości: 1