gambas-source-code/app/examples/Printing/ReportExample/.src/Report3.class
Benoît Minisini c6a9cd69c2 [EXAMPLES]
* NEW: Add examples again. I hope correctly this time.


git-svn-id: svn://localhost/gambas/trunk@6726 867c0c6c-44f3-4631-809d-bfa615b0a4ec
2014-12-12 19:58:52 +00:00

45 lines
957 B
Text

' Gambas class file
Private hResult1 As Result
Private hResult2 As Result
Public Sub _new(sType As String)
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
'Report.Debug = True
hResult1 = db.Exec("select distinct firstname from test")
ReportPanel1.DataCount = hResult1.Count
End
Public Sub ReportLabel1_Data(Index As Integer)
hResult2.MoveTo(Index)
Last.data = hResult2!name
End
Public Sub ReportPanel1_BeforeData()
hResult1.MoveTo(Last.dataindex)
hResult2 = db.Exec("Select * From test where firstname=&1", hResult1!firstname)
ReportHBox1.DataCount = hResult2.Count
End
Public Sub ReportLabel2_Data(Index As Integer)
hResult1.MoveTo(Index)
Last.data = hResult1!firstname
End