File: Report3.class

package info (click to toggle)
gambas3 3.20.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 77,208 kB
  • sloc: ansic: 197,232; cpp: 124,273; sh: 18,999; javascript: 7,761; sql: 5,399; makefile: 2,358; perl: 1,397; xml: 490; python: 335
file content (45 lines) | stat: -rw-r--r-- 958 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
' 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