Hola amigos,
¿Alguno usa este?
http://reportman.sourceforge.net/indexes.html
Muchas gracias.
//--------------------------------------------------------//
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
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
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: Google [Bot] and 51 guests