Page 1 of 1

diseñador de informes Reportman

Posted: Wed Feb 27, 2013 7:06 pm
by lucasdebeltran
Hola amigos,

¿Alguno usa este?
http://reportman.sourceforge.net/indexes.html

Muchas gracias.

Re: diseñador de informes Reportman

Posted: Wed Feb 27, 2013 9:13 pm
by nnicanor
Excelente generador de reportes, por donde quieres empezar ?

Slds,

Re: diseñador de informes Reportman

Posted: Wed Feb 27, 2013 9:55 pm
by lucasdebeltran
Hola Nicanor,

¿Lo has conseguido llamar y utilizar desde Harbour?.

Muchas gracias.

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 3:31 am
by nnicanor
puedes usarlo a traves de una conexion oledb con el motor de advantage sever o local.

slds

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 12:11 pm
by lucasdebeltran
Hola,

Muchas gracias por la respuesta.

¿Podrías por favor al menos poner un .exe de ejemplo, con Fivewin?.

Si quieres hablamos en privado acerca del precio del código fuente para usarlo desde Harbour, gracias.

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 2:17 pm
by nnicanor
Lucas,

Reportman permite ser usuado con cualquier motor de base de datos ODBC u OLEDB, para el caso de harbour y advantade server o local instalo el contrlador odbc y oledb que puedes descargar en http://devzone.advantagedatabase.com


comparto el código y hablamos en privado cualquier otro detalle que te pueda ayudar con tu implementacion este es un ejemplo adapatado para Tdolphin para mysql para facilitar la distibucion de reportes en entornos cliente servidor yo los guardo en la base de datos.

Mañana comparto un ejemplo usando tablas DBF usando avantage local, el mismo ejemplo aplicaría para advantage server

Code: Select all


//--------------------------------------------------------//

Function Reportman_Empresas( cCual )
Local cCon, oQry


   HCONN := 'Provider=MSDASQL.1;Password=sistemas;Persist Security Info=True;' + ;
            'User ID=sistemas;Extended Properties="Driver={MySQL ODBC 5.1 Driver};' + ;
            'Server='+HSERVER+';DefaultDatabase='+HDBNAME+';Database='+HDBNAME+';' + ;
            'Port=3306;User=sistemas;Option=3"'


      DEFAULT cCual := "E"

        do case
         case cCual == "E"
            cTitulo := "Listado de Empresas"
         case cCual == "T"
            cTitulo := "Listado de Terceros"
         case cCual == "D"
            cTitulo := "Listado de Entidades"
         case cCual == "A"
            cTitulo := "Listado de Aseguradoras"
         case cCual == "C"
            cTitulo := "Listado de Corredores"
    EndCase

      cSql:="Select codemp as CODIGO,nitemp as NIT, nomemp as NOMBRE from empresas where clasemp='"+cCual+"' order by nomemp"
      ???  CRLF+cSql

      oQry := oServer:Query( "Select file,reporte from reportes where reporte='Empresas.rep'" )

     cReportName := SaveReport( oQry )

     if ! file( cReportName )
        
       MsgStop("Error al descargar reporte")
       Return
        
      Endif 

      TRY

        oReport := createobject("Reportman.ReportManX")

        oReport:Filename        := cReportName //HDRIVE+HDIR+"\empresas.rep"
        oReport:Preview         := .t.
        oReport:ShowPrintDialog := .t.
        oReport:Title           := "Sistema de Reportes: "+cTitulo
        oReport:ShowProgress    := .t.
        oReport:SetDatasetSQL("EMPRESAS",cSql)
        oReport:SetParamValue("TITULOINFORME",cTitulo)
        oReport:SetParamValue("ADOCONNECTIONSTRING",HCONN)

//      msginfo(oReport:GetParamValue("ADOCONNECTIONSTRING"))

        oReport:Execute()

      CATCH oErr

           ShowError( oErr )

        END

      SET DATE ANSI

return nil


//----------------------------------//

Static Function SaveReport( oQry )

   LOCAL nHandle, hWnd:=GetActiveWindow()
   LOCAL cDir := GetEnv("TEMP")

   cursorwait()

    cFilename := AllTrim( oQry:reporte )

   nHandle := FCreate( cDir + "\" + cFilename )

   IF FError() # 0

         RETURN

   ENDIF

   FWrite( nHandle, oQry:file, Len( oQry:file ) )
   FClose( nHandle )

    cursorarrow()
        
RETURN cDir +"\"+cFileName

cadena de conexion en Reportman Driver={MySQL ODBC 5.1 Driver};Server=127.0.0.1;DefaultDatabase=controles;Database=controles;Port=3306;User=*****;Option=3

 

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 2:30 pm
by nnicanor
Este es el reporte, puedes copiar el codigo y guardarlo como .rep

Code: Select all


object TRpReport
  PageOrientation = rpOrientationLandscape
  PageHeight = 8120
  PageWidth = 5742
  PageBackColor = 16777215
  SubReports = <
    item
      SubReport = TRpSubReport0
    end>
  DataInfo = <
    item
      Alias = 'EMPRESAS'
      DatabaseAlias = 'CONTROLES'
      SQL = 'Select * from empresas'
    end
    item
      Alias = 'DOCUMENTOS'
      DatabaseAlias = 'CONTROLES'
      SQL = 'select * from document'
    end>
  DatabaseInfo = <
    item
      Alias = 'CONTROLES'
      LoadParams = True
      LoadDriverParams = True
      LoginPrompt = False
      Driver = rpdataado
      ReportTable = 'REPMAN_REPORTS'
      ReportSearchField = 'REPORT_NAME'
      ReportField = 'REPORT'
      ReportGroupsTable = 'REPMAN_GROUPS'
      ADOConnectionString = 
        'Provider=MSDASQL.1;Password=********;Persist Security Info=True;' +
        'User ID=sistemas;Extended Properties="Driver={MySQL ODBC 5.1 Dri' +
        'ver};Server=127.0.0.1;DefaultDatabase=controles;Database=control' +
        'es;Port=3306;User=sistemas;Option=3"'
    end>
  Params = <
    item
      Name = 'TITULOINFORME'
      AllowNulls = False
      Value = 'Reporte por Empresa'
      SearchDataset = 'EMPRESAS'
      SearchParam = 'TITULOINFORME'
      Description = ''
      Hint = ''
      Search = ''
      ErrorMessage = ''
      Validation = ''
    end
    item
      Name = 'ADOCONNECTIONSTRING'
      AllowNulls = False
      Value = 
        'Provider=MSDASQL.1;Password=sistemas;Persist Security Info=True;' +
        'User ID=sistemas;Extended Properties="Driver={MySQL ODBC 5.1 Dri' +
        'ver};Server=127.0.0.1;DefaultDatabase=controles;Database=control' +
        'es;Port=3306;User=sistemas;Option=3"'
      Datasets.Strings = (
        'DOCUMENTOS'
        'EMPRESAS')
      SearchDataset = 'DOCUMENTOS'
      SearchParam = 'ADOCONNECTIONSTRING'
      Description = ''
      Hint = ''
      Search = ''
      ErrorMessage = ''
      Validation = ''
    end>
  StreamFormat = rpStreamText
  ReportAction = []
  Type1Font = poHelvetica
  WFontName = 'Arial'
  LFontName = 'Helvetica'
  object TRpSubReport0: TRpSubReport
    Sections = <
      item
        Section = TRpSection1
      end
      item
        Section = TRpSection0
      end
      item
        Section = TRpSection2
      end>
    Alias = 'EMPRESAS'
  end
  object TRpSection0: TRpSection
    Width = 14130
    Height = 255
    SubReport = TRpSubReport0
    ChangeBool = False
    PageRepeat = False
    SkipPage = False
    AlignBottom = False
    SectionType = rpsecdetail
    Components = <
      item
        Component = TRpExpression2
      end
      item
        Component = TRpExpression0
      end
      item
        Component = TRpExpression1
      end
      item
        Component = TRpExpression3
      end>
    ExternalTable = 'REPMAN_REPORTS'
    ExternalField = 'REPORT'
    ExternalSearchField = 'REPORT_NAME'
    StreamFormat = rpStreamText
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    ChangeExpression = ''
    BeginPageExpression = ''
    ChangeExpression = ''
    SkipExpreV = ''
    SkipExpreH = ''
    SkipToPageExpre = ''
    BackExpression = ''
    Stream = {0000000000000000}
  end
  object TRpSection1: TRpSection
    Width = 14145
    Height = 1305
    SubReport = TRpSubReport0
    ChangeBool = False
    PageRepeat = False
    SkipPage = False
    AlignBottom = False
    SectionType = rpsecpheader
    Components = <
      item
        Component = TRpShape0
      end
      item
        Component = TRpExpression4
      end>
    ExternalTable = 'REPMAN_REPORTS'
    ExternalField = 'REPORT'
    ExternalSearchField = 'REPORT_NAME'
    StreamFormat = rpStreamText
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    ChangeExpression = ''
    BeginPageExpression = ''
    ChangeExpression = ''
    SkipExpreV = ''
    SkipExpreH = ''
    SkipToPageExpre = ''
    BackExpression = ''
    Stream = {0000000000000000}
  end
  object TRpSection2: TRpSection
    Width = 14160
    Height = 1701
    SubReport = TRpSubReport0
    ChangeBool = False
    PageRepeat = False
    SkipPage = False
    AlignBottom = False
    SectionType = rpsecpfooter
    Components = <>
    ExternalTable = 'REPMAN_REPORTS'
    ExternalField = 'REPORT'
    ExternalSearchField = 'REPORT_NAME'
    StreamFormat = rpStreamText
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    ChangeExpression = ''
    BeginPageExpression = ''
    ChangeExpression = ''
    SkipExpreV = ''
    SkipExpreH = ''
    SkipToPageExpre = ''
    BackExpression = ''
    Stream = {0000000000000000}
  end
  object TRpExpression2: TRpExpression
    Width = 4200
    Height = 264
    PosX = 2190
    PosY = 0
    Type1Font = poHelvetica
    FontSize = 8
    AutoExpand = False
    AutoContract = False
    ExportPosition = 0
    ExportSize = 1
    ExportDoNewLine = False
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    WFontName = 'Arial'
    LFontName = 'Helvetica'
    Expression = 'EMPRESAS.nomemp'
    DisplayFormat = ''
    ExportDisplayFormat = ''
    AgIniValue = '0'
    ExportExpression = ''
  end
  object TRpExpression0: TRpExpression
    Width = 2100
    Height = 264
    PosX = 0
    PosY = 0
    Type1Font = poHelvetica
    FontSize = 8
    AutoExpand = False
    AutoContract = False
    ExportPosition = 0
    ExportSize = 1
    ExportDoNewLine = False
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    WFontName = 'Arial'
    LFontName = 'Helvetica'
    Expression = 'EMPRESAS.nitemp'
    DisplayFormat = ''
    ExportDisplayFormat = ''
    AgIniValue = '0'
    ExportExpression = ''
  end
  object TRpExpression1: TRpExpression
    Width = 4200
    Height = 264
    PosX = 7470
    PosY = 0
    Type1Font = poHelvetica
    FontSize = 8
    AutoExpand = False
    AutoContract = False
    ExportPosition = 0
    ExportSize = 1
    ExportDoNewLine = False
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    WFontName = 'Arial'
    LFontName = 'Helvetica'
    Expression = 'EMPRESAS.diremp'
    DisplayFormat = ''
    ExportDisplayFormat = ''
    AgIniValue = '0'
    ExportExpression = ''
  end
  object TRpExpression3: TRpExpression
    Width = 2100
    Height = 264
    PosX = 12075
    PosY = 0
    Type1Font = poHelvetica
    FontSize = 8
    AutoExpand = False
    AutoContract = False
    ExportPosition = 0
    ExportSize = 1
    ExportDoNewLine = False
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    WFontName = 'Arial'
    LFontName = 'Helvetica'
    Expression = 'EMPRESAS.telemp'
    DisplayFormat = ''
    ExportDisplayFormat = ''
    AgIniValue = '0'
    ExportExpression = ''
  end
  object TRpShape0: TRpShape
    Width = 14145
    Height = 225
    PosX = 0
    PosY = 1035
    PenWidth = 0
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
  end
  object TRpExpression4: TRpExpression
    Width = 8280
    Height = 585
    PosX = 4020
    PosY = 225
    Type1Font = poHelvetica
    FontSize = 15
    FontStyle = 1
    Alignment = 4
    AutoExpand = False
    AutoContract = False
    ExportPosition = 0
    ExportSize = 1
    ExportDoNewLine = False
    PrintCondition = ''
    DoBeforePrint = ''
    DoAfterPrint = ''
    WFontName = 'Arial'
    LFontName = 'Helvetica'
    Expression = 'M.TITULOINFORME'
    DisplayFormat = ''
    ExportDisplayFormat = ''
    AgIniValue = '0'
    ExportExpression = ''
  end
end


 

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 2:40 pm
by ruben Dario
Tengo una duda , pero tienes que colocar alguna libreria para compilar con harbour fivewin.
seria posible hacer el llamado del designer , algo parecido con Fastreport solamente se usa una DLL
Que archivos habria que copiar para que se ejecute en estaciones de trabajo.

Saludos

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 3:16 pm
by nnicanor
Solo debes registar el OCX y copiarlo donde esta la aplicacion el system32, el Designer no tiene esa funcionabilidad si lo necesitas lo instalas en el cliente y lo llamas haciendo un llamado con un shellexecute(.....) asociando los .rep al designer

registar el ocx con

regsvr32 reportman.ocx

Slds

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 7:26 pm
by ruben Dario
Saludos , Gracias por tu informacion.

Nicanor , si hago el regsvr32 reportman.ocx en la estacion de trabajo, no se requiere instalar el Reportman enla estacion de trabajo.

Gracias

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 7:48 pm
by nnicanor
Ruben,

No es necesario instalar el diseñador solo registrar el Ocx, lo que si debes instalar en cada estacion es el conector ODBC u OLEDB, no es necesario crear un DSN si configuras correctamente la cadena de conexion.


Slds

Re: diseñador de informes Reportman

Posted: Thu Feb 28, 2013 8:35 pm
by ruben Dario
Gracias,

Voy hacer mis pruebas.

Re: diseñador de informes Reportman

Posted: Mon Mar 04, 2013 8:09 pm
by ruben Dario
Saludos

Nicanor , podrias colocar el ejemplo con DBF

Re: diseñador de informes Reportman

Posted: Tue Mar 05, 2013 3:52 am
by nnicanor
Ruben,

una vez lo tenga armado lo pongo para la descarga.


SLds