Printing one page of Labels

  • I have created a label editor and can print all the labels from the preview component, does anyone know how to print just the first page of labels?

    also I would like to make my own preview using a form designer can anyone help with this?

    thanks

    David

    • Offizieller Beitrag

    >> I have created a label editor and can print all the labels from the preview component, does anyone know how to print just the first page of labels? <<

    Instead of PreviewReport.Print(Caption);

    use PrintPages(First, Last: Integer; const title: string);

    (unit WPFPrv)


    >> also I would like to make my own preview using a form designer can anyone help with this? <<

    If you save the label sheet this is a file WPR format - a file which contains multiple pages. You need the WPFReportEngine to view and print this file. Please use the original preview component as a template for a viewer. (unit WPFPrv)

    Julian

  • I have tried this method looking at the print preview unit and I'm using

    the following 2 procedrues

    The problem is that I am using fields and when the page is displayed in the 2nd form designer I only get a preview of the first label or which ever record is being viewed?

    How do I view all the labels?

  • I have the same problem with the ReportArea. Only first record is displayed in preview.
    Table Alias and ObjName of the report area are the same. MasterDataSource is set.

    • Offizieller Beitrag

    There is extra code missing in the even OnReportState.

    WPForm1.WPFReportEngine1ReportState(Sender: TObject;
    Area: TWPFReportArea; State: TWPFReportState; Number: Integer;
    var DoBegin: Boolean);
    begin
    if state = wpfBeginReport then
    begin
    PageNr := 0;
    LinNr := 0;
    Summe := 0;
    end
    else
    if State=wpfNeedNewRow then
    begin
    // For report Areas!!!
    DoBegin := not DetailDataset.EOF;
    end
    else if State=wpfNeedNewDocument then
    begin

    end;
    end;