File: Report1.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 (32 lines) | stat: -rw-r--r-- 720 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
' 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