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

crosstab

edited September 2001 in General
I have the next problem:

I working with delphi 5 and with report builder 5.55.

I have an crosstab with four rows and one column.
When I print with subtotals everything is well, but when I print this
without subtotals (and with 1 card) then I get the message:

'Can't generate a rapport'
List index out of bounds(4)

I work with an JITPipeline.
When I print this with more then one card everything go well.

Please, can someone helps me?
Thanks,
Annelies Snelders

Comments

  • edited September 2001
    Upgrade to RB 6.02. The cross tab is noting but lists and indexes, and we
    fixed a problem like this for RB 6.

    Contact info@digital-metaphors.com for a free upgrade.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited September 2001
    I tried to reproduce the error by only using the designer-I couldn't
    reproduce it. So, there must be something different about the code the
    designer uses to hide the row sub totals than from what your code is doing.
    The crosstab designer sets the visible property directly on the row total.
    It doesn't call the ShowSubTotal method on the crosstab like you are doing.

    In ppCTCtrl.pas in your copy of the source:

    {---------------------------------------------------------------------------
    ---}
    { TppCrossTabControl.SetVisiblePropertyOfTotal }

    procedure TppCrossTabControl.SetVisiblePropertyOfTotal(aTotal: TppTotal);
    var
    lbVisible: Boolean;
    begin

    lbVisible := not(aTotal.Visible);

    if (aTotal.Parent is TppRowDef) then
    aTotal.Visible := lbVisible

    else if (aTotal.Parent is TppColumnDef) then
    TppColumnDef(aTotal.Parent).ShowSubTotals(lbVisible)

    else if (aTotal.Parent is TppCrossTab) and
    (FCrossTab.IndexOfRowGrandTotal(TppGrandTotal(aTotal)) <> -1) then
    aTotal.Visible := lbVisible

    else if (aTotal.Parent is TppCrossTab) and
    (FCrossTab.IndexOfColumnGrandTotal(TppGrandTotal(aTotal)) <> -1) then
    TppCrossTab(aTotal.Parent).ShowGrandTotals(ctttColumn, lbVisible);

    end; {procedure, SetVisiblePropertyOfTotal}


    You are going to have to accesss the row definition in order to set the
    visibility. This can be done like this:

    ppCrossTab1.RowDefs[0].SubTotals[0].Visible := False;

    See the help file for crosstab to see the properties of the row definitions
    and total and subtotal objects. This will turn the first row's subtotal
    off.

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.