Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

SkipLabelsWithCopiesRAP example problem

edited October 2006 in General
Hi,
I still did not get my problem solved in previous post so here it again

All I need in this example instade of placing a fixed number for fcopies
variable I need to get this value from record set for each record I want to
use rap only , and I tried alot please help me on this, I tried detail
before and after print event and did not get any correct result

thanks

Comments

  • edited October 2006
    Hi Isaac,

    Take a look at the following example. This is the first step to get your
    application working. The example skips an amount of labels then prints a
    variable number of copies for each label based on a value in the dataset
    using the DetailBand.BeforePrint event. Let me know if this works.

    http://www.digital-metaphors.com/tips/LabelsSkipPlusQuantity.zip

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    wonderful it work great even better than previous example I modified the
    example to use only RAP (attached with my reply)

    thanks alot my friend
  • edited October 2006
    ok, only one situation the print is not accurate

    I select few items from my table and construct the sql the first item has
    qty =0 and I set skip = 2 then it did not print the first item but it print
    the second one twice although its quantity = 1

    so I think qty=0 is confusing the code , any ideas ?
    thanks alot
  • edited October 2006
    Hi Isaac,

    Changing the DetailBand.BeforePrint event to the following seemed to solve
    the problem.

    procedure TForm1.ppDetailBand1BeforePrint(Sender: TObject);
    var
    liBandsGenerated: Integer;
    liCurrPageBands: Integer;
    liPrevPageBands: Integer;
    begin

    if ppReport1.DataPipeline['lblQty'] = 0 then
    begin
    ppDetailBand1.BandsPerRecord := 1;
    ppDetailBand1.Visible := False;
    end
    else
    begin

    ppDetailBand1.Visible := True;

    liPrevPageBands := (ppReport1.AbsolutePageNo-1) * FBandsPerPage;
    liCurrPageBands := ((ppReport1.CurrentColumn - 1) * FBandsPerColumn) +
    ppReport1.DetailBand.Count;

    liBandsGenerated := liPrevPageBands + liCurrPageBands;

    if (liBandsGenerated = FSkip) then
    BarCode.Visible := True // turn on the label

    else if (liBandsGenerated > (FSkip+FLabelsPerRecord)) then
    ppReport1.DetailBand.BandsPerRecord :=
    ppReport1.DataPipeline['lblQty']; // update number of bands to print
    end;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2006
    thank alot, it work fine
This discussion has been closed.