[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 446
  • Last Modified:

Quickreport labels

You can use Quickreport (using columns) to print databaserecords to labels using labelpaper from Avery or HP with (by exp.) 18 labels on one sheet.

When I print one label, a complete label-sheet is lost. Does anyone know a way to start printing at  label x on the sheet ?
0
RichardBorst
Asked:
RichardBorst
  • 3
1 Solution
 
kretzschmarCommented:
hi richard,

you can do something like this:
sample qr-unit:

unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Db, DBTables, QuickRpt, Qrctrls, ExtCtrls;

type
  TQRLabelForm = class(TForm)
    QuickRep1: TQuickRep;
    DetailBand1: TQRBand;
    MasterTable: TTable;
    QRDBText1: TQRDBText;
    procedure DetailBand1BeforePrint(Sender: TQRCustomBand;
      var PrintBand: Boolean);
    procedure QRDBText1Print(sender: TObject; var Value: String);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  QRLabelForm: TQRLabelForm;
  StartOnLabel : Integer = 0;
implementation

{$R *.DFM}

procedure TQRLabelForm.DetailBand1BeforePrint(Sender: TQRCustomBand;
  var PrintBand: Boolean);
  var I : Integer;
begin
  if StartOnLabel > 0 then
  begin
    MasterTable.First;  //reAdjust to First record
    dec(StartOnLabel);
  end;
end;

procedure TQRLabelForm.QRDBText1Print(sender: TObject; var Value: String);
begin
  if StartOnLabel > 0 then Value := '';  //do print nothing
end;

end.

to call

procedure TForm1.Button1Click(Sender: TObject);
begin
  StartOnLabel := 5;  //Start at label
  QRLabelForm.quickrep1.Preview;  //show preview
end;

try it out

meikl
0
 
kretzschmarCommented:
hi richard,
any results?
meikl
0
 
kretzschmarCommented:
preventive lock
0
 
RichardBorstAuthor Commented:
Thanks.It work's.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now