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

groups and skipping

edited May 2002 in General
Hi,

I have a subreport that contains one group, it breaks on an employee ID. I
have a treelist where the user will click on the employees that they want to
print their information for. If I have say 8 employees, and the user only
wants to print information on say 5 employees, how do I skip the other 3
employees in the group? All the employees will have data in the groups, so
it seems the pipeline.skip would not work. Any help would be appreciated.

Thank You,


--
Jada C. Case
Programmer
jada@signaldata.com

Comments

  • edited May 2002
    One option is to actually resubmit the query for the report to only gather
    information on the selected employees. Alternately you can also filter the
    data at the dataset. Also, if I understand correctly, there is a record per
    employee so that every time the group breaks you're dealing with a new
    employee. In that case you should be able to use Pipeline.OnTraversal and
    Pipeline.Skip to eliminate records. Lastly this can be accomplished at the
    report level by implementing the BeforePrint for the GroupHeader, then
    checking the Employee ID in the pipeline, and if this is an ID that should
    not be displayed, setting GroupHeader.Visible to False. Don't forget to
    reset it back to true otherwise.

    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

  • edited May 2002
    By far the easiest way to do this: filter the data.

    var
    lsFilter: String;
    liIndex: Integer;
    begin

    lsFilter := '';

    for liIndex := 0 to TreeView1.SelectionCount - 1 do
    begin
    lsFilter := '(' + lsFilter + 'Employee_Name = ' + '''' +
    TreeView1.Selections[liIndex].Text + '''' + ')';

    if (liIndex <> TreeView1.SelectionCount - 1) then
    lsFilter := lsFilter + ' AND ';
    end;

    end;

    Cheers,

    Tom Ollar
    Digital Metaphors Corporation
This discussion has been closed.