MySQL recordset data not displating in Fast Reports for Harbour Master Databand

edited 11:53PM in FastReport 4.0
I am using Sergey Spirin Fastreport for my Harbour applications so far, but now a days Harbour new version not supporting Sergey Spirin Fastreport. So I am planing to change reports into xailer fastreport. For that, I downloaded the demo version for testing. In my case, I am using a MySQL Database ADO record set and SetUserDataset function for reports in Sergey Spirin Fastreport and same code used in xailer fastreport. In xailer fastreport design, data window shows data sets with all fields / columns. Drag the fields /columns into a master data band and run preview it not showing data. But in this case, ADO Table data set and drag the fields / columns into the master data band, then it shows the value while previewing. Following code used for reporting.
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

Please help me to solve this issue.

Comments

  • gpigpi
    edited 11:53PM
    Does your Branch dataset enabled in the FR (menu Report-Data)?
    Ask xailer fastreport developers about :SetUserDataset usage
  • edited 11:53PM
    gpi wrote: »
    Does your Branch dataset enabled in the FR (menu Report-Data)?

    Yes, Dataset listed in Data Tree window.

    gpi wrote: »
    Ask xailer fastreport developers about :SetUserDataset usage

    In which forum or topic?
  • gpigpi
    edited 11:53PM
    wrote:
    In which forum or topic?
    http://www.xailer.com

Leave a Comment