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

Strange problems in PassThru

edited January 2005 in General
In my passtrhu functions i'm having some strange problems.

First of all, setting the value to := '' doesn't change anything on the
layout of the CrossTab, i'm calling the passthru on the AfterCalc.

Secondly, the sendstring to codesite results in a 'Could not convert variant
of type(null) into type (string), although i'm doing the tests.

Any idea ??

procedure TSdwRapCrossTab_022_LayOutFunction.ExecuteFunction(aParams:
TraParamList);
var
iRow,
iCol,
FVisit : Integer;
FCrossTab : TppCrossTab;
FMatrix : TppMatrix;
FGbo,
FAvgTp : Double;
begin
GetParamValue(0, FCrossTab);
FMatrix := FCrossTab.Matrix;
for iRow := 0 to FMatrix.RowCount - 1 do
for iCol := 0 to FMatrix.ColumnCount - 1 do
begin
if (iRow = 0)
and (FMatrix.DataType[iCol, iRow] = dtString)
and (FMatrix.DataType[iCol, iRow] <> null) then
FMatrix.Value[iCol, iRow] := ' ';

if (FMatrix.DataType[iCol, iRow] = dtString)
and (FMatrix.DataType[iCol, iRow] <> null) then
CodeSite.SendString('Col = ' + IntToStr(iCol) + ', Row = ' +
IntToStr(iRow), FMatrix.Value[iCol, iRow]);

Comments

  • edited January 2005
    Hi Harry,

    Have you tried type casting the variant as a String? You might also try
    using a simple ShowMessage command if CodeSite is giving you problems :).

    If you are looking to change the values of certain cells, you need to use
    the events...

    OnGetCaptionText
    OnGetValueText
    OnGetTotalValueText
    OnGetTotalCaptionText

    These events are designed to fire at the correct moment to allow
    customization. I have not tested the AfterCalc event but I would be willing
    to bet that this event fires too late to make changes.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.