gambas-source-code/app/examples/Printing/ReportExample/.src/Report1.class
Fabien Bodard 5907b7c630 [EXAMPLES]
* BUG: ReportExample work again.


git-svn-id: svn://localhost/gambas/trunk@6841 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2015-01-19 22:06:09 +00:00

32 lines
719 B
Text

' Gambas class file
'Static Public Type As String
Public Sub _new(Optional sType As String = "mysql")
Dim hResult As Result
Dim Rlbl As ReportLabel
Dim hConn As Connection
hConn = Connections["Connection1"]
hConn.Type = sType
If hConn.Type = "sqlite" Then hConn.Host = User.Home
Try hConn.Open
If Not hConn.Opened Then
Message.Error(" You have to create the test database with the <b>Database</b> example.")
Return
Endif
hResult = db.Limit(200).Find("test")
If Not hResult.Available Then Return
For Each hResult
Rlbl = New ReportLabel(RVBCont)
Rlbl.Autoresize = True
Rlbl.Text = hResult!name & " " & hResult!firstname
Rlbl.Border.bottom.Width = "1px"
Next
End