Ahora sale un problema mi codigo de reportes que funcionaba en gambas2 no funciona en gambas3 :s Bueno aqui les dejo mi codigo.
Public Sub Button7_Click()
Dim A As Single
Dim B As Single
Dim C As Single
Dim reporte As New Report
Dim cabezera As ReportTextLabel
Dim texto As ReportLabel
Dim columnas As ReportHBox
Dim body As ReportVBox
Dim j As Integer
Dim i As Integer
Dim R As Integer
Dim enteimpuesto As String
Dim riff As String
Dim nombref As String
Dim direa As String
Dim direb As String
Dim zonapostale As String
Dim ivae As Float
Dim ivasacado As Float
Dim totalsiniva As Float
Dim horar As String
Dim fechar As String
Dim monedaresult As Result
Dim n_factura As Integer
Dim contadorf As Result
monedaresult = cn.Exec("SELECT * FROM opcionesdf")
If mc = True Then
r = Message.Warning(" ¿Desea Finalizar la compra? ", " SI ", " NO ")
If r = 1 Then
reporte.Clear
reporte.Padding = "1 cm"
reporte.Size = "A4"
cabezera = New ReportTextLabel(reporte)
cabezera.Font = Font["Arial,+12"]
cabezera.Alignment = Align.Center
cabezera.Text = "<table><tr>"
cabezera.Text = "<td>Factura</td>"
cabezera.Text = "</tr></table>"
rs = cn.Exec("SELECT * FROM opcionesdf")
rs.MoveFirst
enteimpuesto = rs!Ente_impuesto
riff = rs!rif
nombref = rs!nombre_f
direa = rs!direccion_a
direb = rs!direccion_b
zonapostale = rs!zona_postal
ivae = rs!iva
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Text = "\n"
texto.Text &= " D A T O S D E L C L I E N T E \n"
texto.Text &= " Nombre y Apellido: " " " & TextBox2.Text & " " & TextBox3.text & " \n"
texto.Text &= " RIF/CI:" " " & TextBox1.Text & " \n"
texto.Text &= " Direccion: " " " & TextBox4.Text & " \n"
texto = New ReportLabel(reporte)
texto.Alignment = Align.Center
texto.Font = Font["Arial,+2"]
texto.Text = "\n"
texto.Text &= "FACTURA\n"
contadorf = cn.Exec("Select * from opcionesdf")
n_factura = contadorf!contador_f
n_factura = n_factura + 1
contadorf = cn.Exec("UPDATE opcionesdf SET contador_f = '" & n_factura & "' ")
texto = New ReportLabel(reporte)
texto.Alignment = Align.Left
texto.Text &= "FACTURA:" " " & n_factura
'formateando hora y fecha.'
fechar = Format(Date, "dd/mm/yyyy")
horar = Format$(Time, "h:nn:ss AM/PM")
'fecha y hora'
texto = New ReportLabel(reporte)
texto.Alignment = Align.Left
texto.Text = "FECHA: " & fechar & " " " HORA: " & horar
body = New ReportVBox(reporte)
body.LineStyle = Line.Solid
body.ForeColor = Color.black
body.Autoresize = True
columnas = New ReportHBox(body)
columnas.Autoresize = True
columnas.Spacing = "1 cm"
For i = 1 To TableView1.Columns.Count - 1
texto = New ReportLabel(columnas)
texto.Text = TableView1.Columns[i].Text
texto.Font.Bold = True
texto.Autoresize = True
texto.Expand = True
texto.Alignment = Align.Center
Next
For i = 0 To TableView1.rows.Count - 1
columnas = New ReportHBox(body)
columnas.Autoresize = True
columnas.Spacing = "1 cm"
For j = 1 To TableView1.Columns.Count - 1
texto = New ReportLabel(columnas)
texto.Text = TableView1[i, j].Text
texto.Autoresize = True
texto.Expand = True
texto.Alignment = Align.Center
Next
Next
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
texto.Text = "\n"
texto.Text &= " SUBTTL " & monedaresult!Moneda & totalvalue.Value
iva = CInt(totalvalue.Value) * 0.12
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
a = CFloat(totalvalue.Value)
ivasacado = a * (ivae / 100)
totalsiniva = a - ivasacado
texto.Text = "\n"
texto.Text &= " BI G(" & ivae & "%) " & monedaresult!Moneda & Round(totalsiniva, -2) & "\n"
texto.Text &= " IVA G(" & ivae & "%)" & monedaresult!Moneda & Round(ivasacado, -2) & "\n"
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
texto.Text = "\n"
texto.Text &= " TOTAL " & monedaresult!Moneda & totalvalue.Value & "\n"
texto.Text &= " EFECTIVO " & monedaresult!Moneda & ValueBox1.Value & "\n"
texto.Text &= " CAMBIO " & monedaresult!Moneda & vueltovalue.Value & "\n"
reporte.Preview
mc = False
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox3.Enabled = True
TextBox4.Enabled = True
TextBox5.Enabled = True
TextBox1.text = ""
TextBox2.text = ""
TextBox3.text = ""
TextBox4.text = ""
TextBox5.text = ""
totalvalue.Value = ""
ValueBox1.Value = ""
vueltovalue.Value = ""
TableView1.Clear
TableView1.Rows.Count = 0
Button5.Enabled = False
actividad_empleado()
codigoarticulo.clear
horacompra.clear
Message.Info("Compra efectuada")
Endif
Endif
End
Dim A As Single
Dim B As Single
Dim C As Single
Dim reporte As New Report
Dim cabezera As ReportTextLabel
Dim texto As ReportLabel
Dim columnas As ReportHBox
Dim body As ReportVBox
Dim j As Integer
Dim i As Integer
Dim R As Integer
Dim enteimpuesto As String
Dim riff As String
Dim nombref As String
Dim direa As String
Dim direb As String
Dim zonapostale As String
Dim ivae As Float
Dim ivasacado As Float
Dim totalsiniva As Float
Dim horar As String
Dim fechar As String
Dim monedaresult As Result
Dim n_factura As Integer
Dim contadorf As Result
monedaresult = cn.Exec("SELECT * FROM opcionesdf")
If mc = True Then
r = Message.Warning(" ¿Desea Finalizar la compra? ", " SI ", " NO ")
If r = 1 Then
reporte.Clear
reporte.Padding = "1 cm"
reporte.Size = "A4"
cabezera = New ReportTextLabel(reporte)
cabezera.Font = Font["Arial,+12"]
cabezera.Alignment = Align.Center
cabezera.Text = "<table><tr>"
cabezera.Text = "<td>Factura</td>"
cabezera.Text = "</tr></table>"
rs = cn.Exec("SELECT * FROM opcionesdf")
rs.MoveFirst
enteimpuesto = rs!Ente_impuesto
riff = rs!rif
nombref = rs!nombre_f
direa = rs!direccion_a
direb = rs!direccion_b
zonapostale = rs!zona_postal
ivae = rs!iva
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Text = "\n"
texto.Text &= " D A T O S D E L C L I E N T E \n"
texto.Text &= " Nombre y Apellido: " " " & TextBox2.Text & " " & TextBox3.text & " \n"
texto.Text &= " RIF/CI:" " " & TextBox1.Text & " \n"
texto.Text &= " Direccion: " " " & TextBox4.Text & " \n"
texto = New ReportLabel(reporte)
texto.Alignment = Align.Center
texto.Font = Font["Arial,+2"]
texto.Text = "\n"
texto.Text &= "FACTURA\n"
contadorf = cn.Exec("Select * from opcionesdf")
n_factura = contadorf!contador_f
n_factura = n_factura + 1
contadorf = cn.Exec("UPDATE opcionesdf SET contador_f = '" & n_factura & "' ")
texto = New ReportLabel(reporte)
texto.Alignment = Align.Left
texto.Text &= "FACTURA:" " " & n_factura
'formateando hora y fecha.'
fechar = Format(Date, "dd/mm/yyyy")
horar = Format$(Time, "h:nn:ss AM/PM")
'fecha y hora'
texto = New ReportLabel(reporte)
texto.Alignment = Align.Left
texto.Text = "FECHA: " & fechar & " " " HORA: " & horar
body = New ReportVBox(reporte)
body.LineStyle = Line.Solid
body.ForeColor = Color.black
body.Autoresize = True
columnas = New ReportHBox(body)
columnas.Autoresize = True
columnas.Spacing = "1 cm"
For i = 1 To TableView1.Columns.Count - 1
texto = New ReportLabel(columnas)
texto.Text = TableView1.Columns[i].Text
texto.Font.Bold = True
texto.Autoresize = True
texto.Expand = True
texto.Alignment = Align.Center
Next
For i = 0 To TableView1.rows.Count - 1
columnas = New ReportHBox(body)
columnas.Autoresize = True
columnas.Spacing = "1 cm"
For j = 1 To TableView1.Columns.Count - 1
texto = New ReportLabel(columnas)
texto.Text = TableView1[i, j].Text
texto.Autoresize = True
texto.Expand = True
texto.Alignment = Align.Center
Next
Next
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
texto.Text = "\n"
texto.Text &= " SUBTTL " & monedaresult!Moneda & totalvalue.Value
iva = CInt(totalvalue.Value) * 0.12
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
a = CFloat(totalvalue.Value)
ivasacado = a * (ivae / 100)
totalsiniva = a - ivasacado
texto.Text = "\n"
texto.Text &= " BI G(" & ivae & "%) " & monedaresult!Moneda & Round(totalsiniva, -2) & "\n"
texto.Text &= " IVA G(" & ivae & "%)" & monedaresult!Moneda & Round(ivasacado, -2) & "\n"
texto = New ReportLabel(reporte)
texto.LineStyle = Line.Dot
texto.Alignment = Align.Left
texto.Font = Font["Arial,+1"]
texto.Autoresize = True
texto.Text = "\n"
texto.Text &= " TOTAL " & monedaresult!Moneda & totalvalue.Value & "\n"
texto.Text &= " EFECTIVO " & monedaresult!Moneda & ValueBox1.Value & "\n"
texto.Text &= " CAMBIO " & monedaresult!Moneda & vueltovalue.Value & "\n"
reporte.Preview
mc = False
TextBox1.Enabled = True
TextBox2.Enabled = True
TextBox3.Enabled = True
TextBox4.Enabled = True
TextBox5.Enabled = True
TextBox1.text = ""
TextBox2.text = ""
TextBox3.text = ""
TextBox4.text = ""
TextBox5.text = ""
totalvalue.Value = ""
ValueBox1.Value = ""
vueltovalue.Value = ""
TableView1.Clear
TableView1.Rows.Count = 0
Button5.Enabled = False
actividad_empleado()
codigoarticulo.clear
horacompra.clear
Message.Info("Compra efectuada")
Endif
Endif
End
El error que me sale en muchas secciones es: Simbolo '_Free' desconocido en la clase ReportSection en Formularioparaadmin:349. este error sale apenas se ejecuta la linea que dice:
reporte.Clear
De verdad no me esperaba este cambio de codificacion en los reportes de gambas3. Por ahi leei que gambas3 una de sus mejoras es la elaboracion mas facil de reportes, alguien me puede decir si es verdad? Saludos camaradas