No logro hacer la conexion.
Instale myoledb-3.9.6 ... Alguien tiene un ejemplo. de un reporte sencillo con Mysql

Code: Select all | Expand
//----------------------------------------------------------------------------//
Function report_manopd()
Local oFrP
cSql := "select distinct m.id,m.maniobra as numero, m.fecini as fecha, .........."
oRpt := oServer:Query( "Select reporte, file from reportes where id = 3") //Reporte a usar
TRY
oTip := oServer:Query( cSql ) //Creacion del recordset
CATCH
Msginfo("Error datos incompletos")
return
END
oFrP := frReportManager():new() //creacion del objeto frReportManager
with object oFrP
:SetUserDataSet("manimov",mysqlfields(oTip),;
{|| oTip:GoTop()} ,;
{|| oTip:SKIP(1)},;
{|| oTip:SKIP(-1) },;
{|| oTip:EOF() },;
{ | aField | oTip:FieldGet( afield )} ) //configuracion del data set del reporte, este es el metodo que hace toda la magia
:LoadFromString( oRpt:file ) //Carga el reporte guardado en la tabla
// las siguientes lineas son configuraciones del reporte
:SetTitle( "Diseñador de Informes" )
:PreviewOptions:SetButtons( FR_PB_PRINT + FR_PB_EXPORT + FR_PB_ZOOM + FR_PB_FIND + FR_PB_OUTLINE + FR_PB_NAVIGATOR )
:PreviewOptions:SetMaximized(.f.)
:PreviewOptions:SetBounds(120, 120, 800, 600)
:PreviewOptions:SetMaximized(.f.)
:PreviewOptions:SetBounds(120, 120, 800, 600)
:ShowReport() //muestra el reporte
:ClearDataSets() //limpia el data set
:DestroyFr() //limpieza interna del objeto frReportManager
end with
Return
//--------------------------------------------//
function mysqlfields( oQry )
Local clField := ""
nLen := oQry:Fcount()
for x := 1 to oQry:Fcount()
cLfield := cLfield + oQry:FieldName( x ) + iif( x < nLen ,";","" )
Next
Return cLfield
//-------------------------------------------------------//
Daniel Garcia-Gil wrote:Ruben...
El intentar construir el ejemplo sera imposible, no hay que prestarle atencion a la "carpinteria" solo a la parte que construye el reporte partiendo del recordset generado por dolphin
copio y pego el ejemplo de nicanor (con lineas comentadas por mi)
En este ejemplo os reportes estan almacenados en una tabla (reportes) y no en disco local
seria buena idea que nicanor nos mostrara un screenshot de este reporte (solo si es posible)Code: Select all | Expand
//----------------------------------------------------------------------------//
Function report_manopd()
Local oFrP
cSql := "select distinct m.id,m.maniobra as numero, m.fecini as fecha, .........."
oRpt := oServer:Query( "Select reporte, file from reportes where id = 3") //Reporte a usar
TRY
oTip := oServer:Query( cSql ) //Creacion del recordset
CATCH
Msginfo("Error datos incompletos")
return
END
oFrP := frReportManager():new() //creacion del objeto frReportManager
with object oFrP
:SetUserDataSet("manimov",mysqlfields(oTip),;
{|| oTip:GoTop()} ,;
{|| oTip:SKIP(1)},;
{|| oTip:SKIP(-1) },;
{|| oTip:EOF() },;
{ | aField | oTip:FieldGet( afield )} ) //configuracion del data set del reporte, este es el metodo que hace toda la magia
:LoadFromString( oRpt:file ) //Carga el reporte guardado en la tabla
// las siguientes lineas son configuraciones del reporte
:SetTitle( "Diseñador de Informes" )
:PreviewOptions:SetButtons( FR_PB_PRINT + FR_PB_EXPORT + FR_PB_ZOOM + FR_PB_FIND + FR_PB_OUTLINE + FR_PB_NAVIGATOR )
:PreviewOptions:SetMaximized(.f.)
:PreviewOptions:SetBounds(120, 120, 800, 600)
:PreviewOptions:SetMaximized(.f.)
:PreviewOptions:SetBounds(120, 120, 800, 600)
:ShowReport() //muestra el reporte
:ClearDataSets() //limpia el data set
:DestroyFr() //limpieza interna del objeto frReportManager
end with
Return
//--------------------------------------------//
function mysqlfields( oQry )
Local clField := ""
nLen := oQry:Fcount()
for x := 1 to oQry:Fcount()
cLfield := cLfield + oQry:FieldName( x ) + iif( x < nLen ,";","" )
Next
Return cLfield
//-------------------------------------------------------//