In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

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

XBase programming language in english
Sanil
Mensajes: 3
Registrado: Sab Mar 11, 2017 6:02 am

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

Mensaje por Sanil »

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 from Data Tree 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 from Data Tree, then it shows the value while previewing. Following code used for reporting.

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
Please help me to solve this issue, then only I can think about the purchase of Fastreport
Responder