[Gambas-user] Questions about gb.report

Willy Raets willy at ...2734...
Thu Sep 19 15:54:12 CEST 2013


Hi,

I'm working on my first report in Gambas and I'm getting nowhere.
I've been reading that someone took 60 hours to get a grasp on it.
I hope to seriously shorten that time by simply asking here as
documentation is scarce.

My situation very much simplified (it is part of a big migration project
from Windows to Linux with Gambas clients, so I can't really send you a
project).

Table 1 (IC):
ID  |  ProductID  |  RestIC |  ActueelIC

Table 2 (Product):
ProductID  |  Omschrijving

Goal is to make a report with on top field names followed by data.
This field names part needs to be on top of each page.

So the result of the report should look like:

ID      Omschrijving     ActueelIC      RestIC  '<-- this on every page

13	A product	1200		240
12	Other product	2400		2400
...

So there is a header on each page and the body with data.
I have made a report, but have no idea what to put where and how.

On main form this is my code:

Private $hConnTest As New Connection

Public Sub OpenReport()

  Dim rData As Result
  Dim hReport As New RprtIC
  Dim sQuery As String
  sQuery = "SELECT IC.ID, Product.Omschrijving, IC.Actueel.IC, IC.RestIC
from IC LEFT JOIN Product ON IC.ProductID=Product.ProductID ORDER BY
IC.ID DESC

  rData = $hConnTest.Exec(sQuery)
  hReport = New RprtIC($hConnTest, rData)
  hReport.Preview

End

On the report I have this:

Private $hConn As Connection
Private $rResult As Result

Public Sub _new(hConn As Connection, rResult As Result)

  $hConn = hConn
  $rResult = rResult

End

My questions:
1. What objects do I need to draw on the report and where and in what
order?
2. What properties do I need to set on the drawn objects?
3. In what objects do I place what data?

I hope when getting this clear to have some basic insight in reports.


-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org








More information about the User mailing list