[Gambas-user] gb.report pagebreak?
Fabien Bodard
gambas.fr at ...626...
Tue Dec 29 11:03:08 CET 2009
Please wait gambas3 to use the gb.report component as it is not
finished ! it's just an early alpha version in gb2.
Regards,
Fabien Bodard
2009/12/29 JLichter <jlichter at ...20...>:
> I use Ubuntu 9.10 with Gambas 2.13 and I try the gb.report.
> All is running good, however I can't create a page 2 or more in the
> report.
> Is it possible two create more pages (pagebreak)?
>
> Thanks in advance,
> jo42
>
> Here my code:
> ___________________________________________________
>
>
> ' Gambas module file
>
> PRIVATE hCon AS NEW Connection
> PRIVATE hResult AS Result
> PRIVATE hReport AS Report
>
> PUBLIC SUB Main()
> hcon.Close() ' sure is sure
> hcon.host = "localhost"
> hCon.User = "root"
> hCon.Type = "mysql"
> hcon.Name = "test"
> hcon.Password = "mysql_password"
> hcon.Open()
> hResult = hcon.Find("test", "active=1", TRUE)
> InitReport()
> hcon.Close()
> Report.Preview()
>
> ' GB 2.13 Error if more as 10 DS:
> ' The Program has stopped unexpectedly by raising signal #11
> ' (This is not a bug in your project, but a bug in the interpreter.)
> ' hint:
> hReport.Clear()
> END
>
>
> PRIVATE SUB InitReport()
>
> DIM hLabel AS ReportLabel
> DIM hField AS ReportField
> DIM hHbox AS ReportHBox
> DIM hEmpty AS ReportHBox
> DIM hVBox AS ReportVBox
> DIM hSpecialField AS ReportSpecialField
>
>
> Report.Size = "A4"
> Report.LineStyle = line.Solid
> Report.Padding = "1 cm"
> Report.Resolution = Desktop.Resolution
>
>
> ' Header
> hLabel = NEW ReportLabel(Report)
> hLabel.Text = "REPORT TEST"
> hLabel.Height = "2.5 cm"
> hLabel.Alignment = Align.Center
> hLabel.Font.Size = 25
> hLabel.LineStyle = Line.Solid
> hLabel.FillColor = Color.LightGray
> hLabel.FillStyle = Fill.Solid
>
> hVBox = NEW ReportVBox(Report)
> hVBox.Height = "1 cm"
>
> hReport = NEW Report(Report)
> hReport.Expand = TRUE
>
> 'to do
> 'hReport.Count = hResult.Count
>
>
>
> ' Abstand zwischen den DS
> hReport.Spacing = "0.2 cm"
>
> FOR EACH hResult
>
> hVBox = NEW ReportVBox(hReport)
> hVBox.Height = "1.5 cm"
> hVBox.Padding = "0.2 cm"
> hVBox.LineStyle = Line.Solid
>
> hHbox = NEW ReportHBox(hVBox)
> hHbox.Height = "0.5 cm"
>
>
> hLabel = NEW ReportLabel(hHbox)
> hLabel.Text = "Name:"
> hLabel.Width = "2 cm"
> hLabel.Font.Bold = TRUE
>
> hField = NEW ReportField(hHbox)
> hField.MaxLength = 40
> hField.LineStyle = Line.Solid
> hField.Width = "4 cm"
> hField.Font.Bold = TRUE
> hField.Data = hResult!name
>
>
>
> hEmpty = NEW ReportHBox(hHbox)
> hEmpty.Expand = TRUE
>
>
>
> hLabel = NEW ReportLabel(hHbox)
> hLabel.Text = "Geburtstag:"
> hField = NEW ReportField(hHbox)
> hField.Width = "2 cm"
> hField.Data = hResult!birth
>
>
>
> hHbox = NEW ReportHBox(hVBox)
> hHbox.Height = "0.5 cm"
>
>
>
> hLabel = NEW ReportLabel(hHbox)
> hLabel.Text = "Vorname:"
> hLabel.Width = "2 cm"
> hLabel.ForeColor = color.Gray
>
> hField = NEW ReportField(hHbox)
> hField.MaxLength = 40
> hField.LineStyle = Line.Solid
> hField.Width = "4 cm"
> hField.Font.Italic = TRUE
> hField.ForeColor = color.Gray
> hField.Data = hResult!firstname
>
> NEXT
>
> hSpecialField = NEW ReportSpecialField(Report)
>
> hSpecialField.Text = "Seite $PAGE / $NPAGE"
> hSpecialField.Height = "1 cm"
> hSpecialField.Alignment = align.Center
>
> END
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list