Maarten,
COLUMN ... OF oReport ;
TITLE ... ;
DATA MyRelation( oDatasetMain, oDataSetRel )
....
STATIC FUNCTION MyRelation( oMain, oRel )
oRel:Locate( <expression involving oMain > )
RETURN oRel:MyRelField
Regards,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
http://www.xailer.com/forum
http://www.xailer.com/dokuwiki
"Maarten Roos" escribió en el mensaje de
noticias:4d2454c7$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
I have managed to export a dataset to Excel... but how do I
use values from other datasets to explain full name instead
of code?
The dataset has relations to other datasets, but no idea to
get them when needed?
METHOD ExportToExcel() CLASS frmNotesSearch
LOCAL aHeader := {}, aField := {}, x := 1, Ohulp :=
::oBrw:aCols
for x=1 to len(::oBrw:aCols)
if ::oBrw:aCols[x]:lVisible
if
Upper(::oBrw:aCols[x]:oDataField:ClassName())==Upper("TDataField ")
AADD(aHeader,::oBrw:aCols[x]:cHeader)
AADD(aField,::oBrw:aCols[x]:oDataField:cDbfName)
endif
endif
next
if len(aHeader)<>0
ExportToExcel(::oDbfTN, "Telephone Notes", aHeader,
aField)
else
MsgInfo("Nothing to export...")
endif
RETURN NIL
Function ExportToExcel(oDataSet, cTitle, aHeader, aField)
Local oReport, x, cHeader, cField
oDataSet:Select()
REPORT oReport ;
TITLE cTitle
oReport:oDataSet = oDataSet
For x := 1 To Len(aField)
cHeader := '"' + aHeader[x] + '"'
cField := aField[x]
COLUMN OF oReport ;
Title &cHeader ;
DATA &cField
Next
oReport:cJobName := "Excel Converter"
oReport:ToExcel()
RETURN NIL
But this will use only one dataset (oDbfTN)
I like to use the same data as shown in the browser (oBrw)
to be exported to Excel.
So this...
Give me now...