From: Philippe Mermod on
Hi Jairo,

Sorry for the delay.

Did you find a solution ? I had the 1st volume of technical
reference in which this method was not available.

The third parameter could be diificult to adapt in Visual
Objects. I recommend you to move to RDC and, if possible to CRXI
R2. That's we have done for more than 500+ reports, migrating
from DBF to SQL.

If you need some help, don't hesitate to contact me.

--
Phil Mermod
Crystal Reports Library for Visual Objects
http://www.pkl.ch/dev/


JD wrote:

> Hi Philippe,
>
> Version 8.5.
>
> Crystal Reports� 8.5
> Technical Reference Guide, vol 2:
>
> "(...)
> SetTablePrivateData
> The SetTablePrivateData method is used to provide information
> about a data
> source to the database driver associated with the reports
> database at runtime. For
> instance, if a report has been designed using the Crystal
> Active Data Driver this
> method can be used to provide an active data source for the
> report, such as a DAO,
> ADO, or RDO Recordset or a CDO Rowset. In this case, the
> object passed to the
> third parameter of this method replaces, at runtime, the field
> definition file used to
> create the report.
>
> Syntax
> [form.]Report.SetTablePrivateData TableIndex% , DataTag&, Data
>
> For Example:
> CrystalReport1.SetTablePrivateData 0, 3, rs
> Passes a recordset to the first table in the report.
>
> Remarks
> This method can only be called AFTER �ReportFileName� on page
> 230, has been set.
>
> The first parameter, TableIndex, specifies the index number of
> the table to be
> set. Default value = 1.
>
> The second parameter, DataTag, is value indicating the type of
> data being
> passed to the report in the Data parameter. Currently, the only
> possible value
> is 3. This value must be used for all Active data sources
> including DAO, ADO,
> RDO, CDO, and the Visual Basic data control.
>
> The third parameter, Data, is the variant data passed to the
> database driver.
>
> For example, with Active data, this must be a Recordset object
> if you are using
> DAO, ADO, or the Visual Basic data control. This must be a
> Rowset object if
> you are using CDO.
>
> Availability
> Runtime only."
>
>
> and this a code generated with VO Setup OLE Control:
>
> METHOD SetTablePrivateData(;
> TableIndex,; // AS SHORT
> DataTag,; // AS LONG
> Data; // AS USUAL
> ) CLASS CrystalReport
> // Set private data for table
>
> LOCAL a AS ARRAY
> LOCAL pFirstParamDesc AS VOOLEARGDESC
> LOCAL pParamDesc AS VOOLEARGDESC
> LOCAL uRetValue AS USUAL
> LOCAL pRetDesc IS VOOLEARGDESC
>
> a := {String2Symbol("SetTablePrivateData"), 127,
> INVOKE_METHOD, 3, 0, TRUE, NULL, @pRetDesc}
>
> pParamDesc := pFirstParamDesc := SELF:oAuto:__AllocArgDescs(3)
> a[OFD_PARAMDESC] := pParamDesc
> pParamDesc.dwIDLFlag := 1
> pParamDesc.dwVarType := VT_I2
> pParamDesc.atomArgName := #TableIndex
> pParamDesc += 1
> pParamDesc.dwIDLFlag := 1
> pParamDesc.dwVarType := VT_I4
> pParamDesc.atomArgName := #DataTag
> pParamDesc += 1
> pParamDesc.dwIDLFlag := 1
> pParamDesc.dwVarType := VT_VARIANT
> pParamDesc.atomArgName := #Data
> pParamDesc += 1
>
> pRetDesc.dwIDLFlag := 0
> pRetDesc.dwVarType := VT_VOID
>
> uRetValue := SELF:oAuto:__InvokeMethod(a,
> DWORD(_bp+16),PCount())
>
> MemFree(pFirstParamDesc)
>
> RETURN(uRetValue)
>
>
> Regards.
>
> Jairo.
From: JD on
Thanks Philippe. I didn't get to do that.
 | 
Pages: 1
Prev: app crashes...
Next: Clipper Programmers Needed