sábado, 28 de marzo de 2015

ArmadoHTML

Buenas gente, aquí les traigo una pequeña idea que nos ayudara en el armado de reportes Html

solo hice lo básico pero este programa podría hacer cosas mas complejas.


' gambas class file

' by postapase

Public Sub Form_Open()
Me.Center
End

Public Sub Button1_Click()
Dim RutaArchivoX As String
Dim ArchivoX As File
Dim LineaX As String
Dim VariableX As String
Dim PrimeraLinea As Boolean = True

VariableX = txtVariable.Text & " &= "
Dialog.Path = User.Home
Dialog.Filter = ["*.html", "Documentos"]

If Dialog.OpenFile() Then Return

RutaArchivoX = Dialog.Path
txtRutaHtml.Text = Dialog.Path

ArchivoX = Open RutaArchivoX For Read

While Not Eof(ArchivoX)
Line Input #ArchivoX, LineaX

If PrimeraLinea = True Then
txtAcuerpo.Text &= txtVariable.Text & " = " & LineaX & gb.NewLine
PrimeraLinea = False
Else
txtAcuerpo.Text &= VariableX & LineaX & gb.NewLine
Endif

Wend

Close ArchivoX

End

Public Sub btnCopiar_Click()
txtAcuerpo.SelectAll
txtAcuerpo.Copy()
End

 Código fuente: http://www.gambas-es.org/download.php?id=555

No hay comentarios.:

Publicar un comentario