Código: Seleccionar todo
cSQL :="Select * from Branches"
oRs := FW_OpenRecordSet(oConnection, cSQL)
oFrPrn := frReportManager():new()
With Object oFrPrn
:SetUserDataset("Branch",MySqlFields(oRs),;
{|| If(!oRs:BOF() .OR. !oRs:EOF() ,oRs:MoveFirst() ,)} ,;
{|| oRs:MoveNext()} ,;
{|| oRs:MovePrev()} ,;
{|| oRs:EOF() },;
{ | aField | oRs:Fields(afield):Value })
:LoadFromFile("Branch.fr3")
:DesignReport()
:DestroyFr()
End With
*---------------------------------------------------------------------------------------------*
Function MySqlFields( oRs ) /* Generating Fast Reports Data fileds from Recordset*/
*---------------------------------------------------------------------------------------------*
Local cField := ""
Local I
Local nLen
nLen := oRs:Fields:Count()-1
For i := 0 To nLen
cField := cField + iif(oRs:Fields(i):Name='Photo',oRs:Fields(i):Name+'^b',oRs:Fields(i):Name)+ iif( i < nLen ,";","" )
Next
Return cField