get dataset value
Publicado: Vie Feb 27, 2009 8:50 am
First i want to thank everybody for answers to my questions here.
Now the next question:
I am trying FastReports, with an oSqlQuery.
What should be the codeblock to get the value of the fields?
//---------------------------------------------------------- --------------------
function SetXailerDataSet(oFrManager, cFrAlias, oDataSet)
//---------------------------------------------------------- --------------------
local cStr:='', x
// get the fieldnames from the dataset. This works fine
for x := 1 to len( oDataSet:aFields)
cStr += oDataSet:aFields[x]:cName + ";"
next
aVelden := oDataSet:aFields
oFrManager:SetUserDataSet(cFrAlias, cStr,;
{||oDataSet:GoTop()}, {||oDataSet:Skip(1)}, ;
{||oDataSet:Skip(-1)}, {||oDataSet:Eof()},;
// here comes a codeblock to get the field values, but what should it be?
{|xxxxxxxxxxxx|xxxxxxxxxxxx})
Return Nil
// for a dbf dataset the code example from fastreports is
//////////////////////////////////////////////////////////// ///////////
function DoWAUserDS()
SELECT Items
SET ORDER TO 3
FrPrn:SetUserDataSet("Parts in oders", "PartNo;Part;Total qty;Price",;
{|| Parts->( DbGoTop() )} ,;
{|| Parts->( DbSkip(1) )},;
{|| Parts->( DbSkip(-1) )},;
{|| Parts->( Eof() )},;
{|cField| GetDSValue(cField)})
//////////////////////////////////////////////////////////// ///////////
function GetDSValue(cField)
local RES
DO CASE
CASE cField == "PartNo"
RETURN Parts->PartNo
CASE cField == "Part"
RETURN Parts->Descriptio
CASE cField == "Total qty"
SELECT Items
OrdScope(0, Parts->PartNo)
OrdScope(1, Parts->PartNo)
SUM QTY TO RES
RETURN RES
CASE cField == "Price"
RETURN Parts->ListPrice
ENDCASE
return nil
Now the next question:
I am trying FastReports, with an oSqlQuery.
What should be the codeblock to get the value of the fields?
//---------------------------------------------------------- --------------------
function SetXailerDataSet(oFrManager, cFrAlias, oDataSet)
//---------------------------------------------------------- --------------------
local cStr:='', x
// get the fieldnames from the dataset. This works fine
for x := 1 to len( oDataSet:aFields)
cStr += oDataSet:aFields[x]:cName + ";"
next
aVelden := oDataSet:aFields
oFrManager:SetUserDataSet(cFrAlias, cStr,;
{||oDataSet:GoTop()}, {||oDataSet:Skip(1)}, ;
{||oDataSet:Skip(-1)}, {||oDataSet:Eof()},;
// here comes a codeblock to get the field values, but what should it be?
{|xxxxxxxxxxxx|xxxxxxxxxxxx})
Return Nil
// for a dbf dataset the code example from fastreports is
//////////////////////////////////////////////////////////// ///////////
function DoWAUserDS()
SELECT Items
SET ORDER TO 3
FrPrn:SetUserDataSet("Parts in oders", "PartNo;Part;Total qty;Price",;
{|| Parts->( DbGoTop() )} ,;
{|| Parts->( DbSkip(1) )},;
{|| Parts->( DbSkip(-1) )},;
{|| Parts->( Eof() )},;
{|cField| GetDSValue(cField)})
//////////////////////////////////////////////////////////// ///////////
function GetDSValue(cField)
local RES
DO CASE
CASE cField == "PartNo"
RETURN Parts->PartNo
CASE cField == "Part"
RETURN Parts->Descriptio
CASE cField == "Total qty"
SELECT Items
OrdScope(0, Parts->PartNo)
OrdScope(1, Parts->PartNo)
SUM QTY TO RES
RETURN RES
CASE cField == "Price"
RETURN Parts->ListPrice
ENDCASE
return nil