LOCAL opt, optform opt = CREATEOBJECT("cusOptions") opt.cPagescope = "" opt.cTarget = tcOutput opt.coutputfile = "output" optform = CREATEOBJECT("frmoptions", opt) optform.Show() IF EMPTY(opt.cOutputFile) RETURN .f. ENDIF LOCAL loSession loSession=EVALUATE([xfrx("XFRX#INIT")]) IF loSession.SetParams(opt.coutputfile,,,,,,opt.cTarget) = 0 IF NOT EMPTY(opt.cPageScope) loSession.setPageRange(opt.cPageScope) endif loSession.TransformReport(thisform.oReport) ENDIFAfter create object loSession add new line:
* Create log file, detect mayn bugs losession.clogfile="c:\temp\xlscov.log"IMHO, the big time is flag of many bugs (calling event Error() )
>loSession = xfrx("XFRX#INIT") >lnRetVal = loSession.SetParams(,,,,,,"XFF") && no name = just in memory >If lnRetVal = 0 > * > * initialize the previewer > * > loPreview = CREATEOBJECT("frmPreviewer") > loPreview.windowtype = 1 && modal > * > * the finalize method returns the XFRX#DRAW object reference > * > loSession.ProcessReport(m.lcRepName, m.lcCondition) > loPreview.cmdopen.Click(loSession.finalize()) && show the document > loPreview.show(1) > * >ENDIF >>
>loSession=xfrx("XFRX#INIT") >lnRetVal = loSession.SetParams(ForceExt(m.lcRepName,[xls]),,,,,,"XLS") >If lnRetVal = 0 > > loSession.SetOtherParams("NEXT_SHEET_NAME", m.Title1) > loSession.ProcessReport(m.lcRepName, m.lcCondition) > loSession.finalize() > >Endif >>