From 5dfef252d54e29ad9c980eb45e28cd1ec4270b9d Mon Sep 17 00:00:00 2001 From: Fabien Bodard Date: Sun, 19 Jan 2014 21:44:48 +0000 Subject: [PATCH] [GB.REPORT] * NEW: A New widget ReportPageBreak allow to break a page when you need * NEW: Report.Print take now an optional argument Printer that allow to give an externally initialised printer. In tis case the dialog is not shown. * BUG: Now ReportLabel rotation work fine and the angle is given in Rad * BUG: You can now add an argument to the _New sub. Be carrefull the _New event is called one time only at the report loading. * BUG: The custom size work but there is some bugs with the printer.configure that setup the page size to A4 :-/ git-svn-id: svn://localhost/gambas/trunk@6089 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.report/.component | 3 +- comp/src/gb.report/.directory | 7 - .../.hidden/control/reportpagebreak.png | Bin 0 -> 234 bytes comp/src/gb.report/.info | 33 ++--- comp/src/gb.report/.list | 1 + comp/src/gb.report/.project | 2 +- comp/src/gb.report/.src/Preview/CPrint.class | 24 +++- .../src/gb.report/.src/Preview/FPreview.class | 4 +- comp/src/gb.report/.src/Preview/FPrint.class | 35 +++++ comp/src/gb.report/.src/Preview/FPrint.form | 132 ++++++++++++++++++ comp/src/gb.report/.src/Report.class | 117 +++++++++------- comp/src/gb.report/.src/ReportBrush.class | 2 +- comp/src/gb.report/.src/ReportContainer.class | 14 +- comp/src/gb.report/.src/ReportLabel.class | 13 +- comp/src/gb.report/.src/ReportPageBreak.class | 6 + .../gb.report/.src/Tests/Old/Report5.report | 19 ++- .../gb.report/.src/Tests/Old/Report8.class | 5 +- .../gb.report/.src/Tests/Old/Report8.report | 2 +- .../gb.report/.src/Tests/Old/myReport2.report | 2 +- .../gb.report/.src/Tests/OutputReport2.report | 2 +- comp/src/gb.report/.src/Tests/Report9.class | 8 ++ comp/src/gb.report/.src/Tests/Report9.report | 16 +++ comp/src/gb.report/.src/Tests/Test.module | 22 +-- comp/src/gb.report/printer1.png | Bin 1633 -> 1670 bytes 24 files changed, 346 insertions(+), 123 deletions(-) create mode 100644 comp/src/gb.report/.hidden/control/reportpagebreak.png create mode 100644 comp/src/gb.report/.src/Preview/FPrint.class create mode 100644 comp/src/gb.report/.src/Preview/FPrint.form create mode 100644 comp/src/gb.report/.src/ReportPageBreak.class create mode 100644 comp/src/gb.report/.src/Tests/Report9.class create mode 100644 comp/src/gb.report/.src/Tests/Report9.report diff --git a/comp/src/gb.report/.component b/comp/src/gb.report/.component index 33f23775d..a5705a0ef 100644 --- a/comp/src/gb.report/.component +++ b/comp/src/gb.report/.component @@ -1,7 +1,6 @@ [Component] Key=gb.report -Version=3.3.0 +Version=3.5.90 State=1 Authors=Fabien Bodard Needs=Form,ImageIO - diff --git a/comp/src/gb.report/.directory b/comp/src/gb.report/.directory index 3a2287eaf..06dab1c8a 100644 --- a/comp/src/gb.report/.directory +++ b/comp/src/gb.report/.directory @@ -1,9 +1,2 @@ [Desktop Entry] Icon=./.icon.png - -[Dolphin] -Timestamp=2014,1,4,21,13,1 -Version=3 - -[Settings] -HiddenFilesShown=true diff --git a/comp/src/gb.report/.hidden/control/reportpagebreak.png b/comp/src/gb.report/.hidden/control/reportpagebreak.png new file mode 100644 index 0000000000000000000000000000000000000000..92f6c74e7f487982d3d305fa3d393a7e8bd8960c GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzmSQK*5Dp-y;YjHK@;M7UB8wRq z_>O=u<5X=vX`o<_r;B4qMC;pYhFs2y0Tg{zmvbdcq&iRKc)Q~ESHv4G@i*8 zeQt0lgTXJG*EMUcOG8i>3xf@#<@5inEDz=sn;dn1pt$mn5WB?zM!pHmObccno@f0@ zyMy7>a|@<7dsP{BSZ}!Y>(zuQmyVYjSKm%fYxv($mmp;2z}LZ0?5Dfn`#RPh!z~P{ a?0RWJn%sF$-vJ%Tz~JfX=d#Wzp$PzBdrzkT literal 0 HcmV?d00001 diff --git a/comp/src/gb.report/.info b/comp/src/gb.report/.info index b707d6b4e..862f83114 100644 --- a/comp/src/gb.report/.info +++ b/comp/src/gb.report/.info @@ -290,22 +290,6 @@ Preview m -Image -m -ReportBrush -(Value)s(X)s(Y)s -LinearGradient -m -ReportBrush -(Colors)Integer[];(Positions)Float[]; -RadialGradient -m -ReportBrush -(Colors)Integer[];(Positions)Float[]; -Color -m -ReportBrush -(iColor)i Refresh m @@ -321,7 +305,7 @@ Report Print m - +[(hPrinter)Printer;] #ReportBorder C @@ -420,6 +404,10 @@ _Image v Image +Image +M +ReportBrush +(hImage)Image; _Color v Integer[] @@ -452,10 +440,6 @@ ToString m s -ImageBrush -M -ReportBrush -(hImage)Image; #ReportContainer ReportFrame @@ -1033,6 +1017,13 @@ _Get M ReportPadding (Value)s +#ReportPageBreak +ReportControl +C +_Properties +C +s +-* #ReportPanel ReportContainer C diff --git a/comp/src/gb.report/.list b/comp/src/gb.report/.list index 3f656d14e..508b9a8cd 100644 --- a/comp/src/gb.report/.list +++ b/comp/src/gb.report/.list @@ -12,6 +12,7 @@ ReportImage ReportLabel ReportLine ReportPadding +ReportPageBreak ReportPanel ReportSection ReportSvgImage diff --git a/comp/src/gb.report/.project b/comp/src/gb.report/.project index 21a738f84..dda6c445f 100644 --- a/comp/src/gb.report/.project +++ b/comp/src/gb.report/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 # Compiled with Gambas 3.5.90 Title=Report designer -Startup=OutputReport2 +Startup=Report9 Icon=printer1.png Version=3.5.90 VersionFile=1 diff --git a/comp/src/gb.report/.src/Preview/CPrint.class b/comp/src/gb.report/.src/Preview/CPrint.class index 1be88cec9..49d002969 100644 --- a/comp/src/gb.report/.src/Preview/CPrint.class +++ b/comp/src/gb.report/.src/Preview/CPrint.class @@ -4,23 +4,33 @@ Create Static Private hPrinter As New Printer As "Printer" Private $hPrint As Report -Public Sub PrintReport(hReport As Report) +Public Sub PrintReport(hReport As Report, Optional MyPrinter As Printer) Dim hSizeParse As TSizeParse - - $hPrint = hReport.Clone() + $hPrint = hReport + '$hPrint = hReport.Clone() + If MyPrinter Then + hPrinter = MyPrinter + Else + hPrinter = New Printer + Endif + Object.Attach(hPrinter, Me, "Printer") + hPrinter.Paper = $hPrint.Paper hPrinter.Orientation = $hPrint.Orientation If $hPrint.Paper = Printer.Custom Then hSizeParse = New TSizeParse($hPrint.Width) - hPrinter.PaperWidth = hSizeParse.ToCm() / 10 + hPrinter.PaperWidth = hSizeParse.ToCm() * 10 hSizeParse = New TSizeParse($hPrint.Height) - hPrinter.PaperHeight = hSizeParse.ToCm() / 10 + hPrinter.PaperHeight = hSizeParse.ToCm() * 10 Endif - If Not hPrinter.Configure() Then + If Not MyPrinter Then + If Not hPrinter.Configure() Then + hPrinter.Print + Endif + Else hPrinter.Print Endif - End Public Sub Printer_Draw() diff --git a/comp/src/gb.report/.src/Preview/FPreview.class b/comp/src/gb.report/.src/Preview/FPreview.class index 3ffb57378..9ff25386d 100644 --- a/comp/src/gb.report/.src/Preview/FPreview.class +++ b/comp/src/gb.report/.src/Preview/FPreview.class @@ -31,9 +31,9 @@ Public Sub _new() $hReport.Resolution = Printer1.Resolution If $hReport.Paper = Printer.Custom Then hSizeInt = New TSizeParse($hReport.Width) - Printer1.PaperWidth = hSizeInt.ToCm() / 10 + Printer1.PaperWidth = hSizeInt.ToCm() * 10 hSizeInt = New TSizeParse($hReport.Height) - Printer1.PaperHeight = hSizeInt.ToCm() / 10 + Printer1.PaperHeight = hSizeInt.ToCm() * 10 Endif 'Debug Printer1.Orientation;; Printer1.PaperWidth;; Printer1.PaperHeight diff --git a/comp/src/gb.report/.src/Preview/FPrint.class b/comp/src/gb.report/.src/Preview/FPrint.class new file mode 100644 index 000000000..7e810137a --- /dev/null +++ b/comp/src/gb.report/.src/Preview/FPrint.class @@ -0,0 +1,35 @@ +' Gambas class file + + +Public Sub Form_Open() +Dim hprinter As New Printer + +Dim sPrinter As String + For Each sPrinter In Printer.List + ListView1.Add(sPrinter, sPrinter, IIf(sPrinter = Printer.Default, Picture["icon:/16/ok"], Picture["icon:/16/printer"])) + If sPrinter = Printer.Default Then ListView1[sPrinter].RichText = "" & sPrinter & "" + Next + +' hprinter.ReverseOrder +' hprinter.FullPage +' hprinter.GrayScale +' hprinter.CollateCopies +' hprinter.FirstPage +' hprinter.LastPage +' hprinter.NumCopies +' hprinter.Orientation +' hprinter.Page +' hprinter.OutputFile +' hprinter.Paper +' hprinter.PaperHeight +' hprinter.PaperWidth +' hprinter.ReverseOrder + + +End + +Public Sub Panel6_Show() + + Me.Refresh + +End diff --git a/comp/src/gb.report/.src/Preview/FPrint.form b/comp/src/gb.report/.src/Preview/FPrint.form new file mode 100644 index 000000000..c9a09105e --- /dev/null +++ b/comp/src/gb.report/.src/Preview/FPrint.form @@ -0,0 +1,132 @@ +# Gambas Form File 3.0 + +{ Form Form + MoveScaled(0,0,81,67) + Text = ("Printer Config") + Resizable = False + Arrangement = Arrange.Horizontal + AutoResize = True + Spacing = True + Margin = True + { Panel3 VBox + MoveScaled(3,4,53,60) + Expand = True + AutoResize = True + Spacing = True + Padding = 20 + { ListView1 ListView + MoveScaled(0,0,52,20) + } + { Panel6 Expander + MoveScaled(1,21,51,37) + Text = ("More...") + Hidden = True + { Panel7 VBox + MoveScaled(1,2,44,32) + Spacing = True + Padding = 20 + { HBox3 HBox + MoveScaled(1,2,50,4) + { Label8 Label + MoveScaled(1,1,18,3) + Text = ("Range") + } + { Panel10 Panel + MoveScaled(15,1,12,3) + Expand = True + } + { TextBox1 TextBox + MoveScaled(19,0,22,4) + } + } + { HBox1 HBox + MoveScaled(2,8,50,4) + { Label1 Label + MoveScaled(1,1,18,3) + Text = ("RectoVerso") + } + { Panel5 Panel + MoveScaled(15,1,12,3) + Expand = True + } + { ComboBox1 ComboBox + MoveScaled(20,1,18,3) + ReadOnly = True + List = [("None"), ("Long side"), ("Short side")] + } + } + { HBox2 HBox + MoveScaled(2,13,50,4) + { Label3 Label + MoveScaled(1,1,18,3) + Text = ("Paper") + } + { Panel8 Panel + MoveScaled(15,1,12,3) + Expand = True + } + { cmbPaper ComboBox + MoveScaled(20,1,18,3) + ReadOnly = True + List = [("None"), ("Long side"), ("Short side")] + } + } + { Panel9 Panel + MoveScaled(2,19,40,11) + Border = Border.Etched + { Label4 Label + MoveScaled(1,1,13,3) + Text = ("Width") + } + { Label5 Label + MoveScaled(23,1,13,3) + Text = ("Height") + } + { SpinBox2 SpinBox + MoveScaled(1,4,13,4) + } + { SpinBox3 SpinBox + MoveScaled(23,4,13,4) + } + { Label6 Label + MoveScaled(14,4,4,4) + Text = ("mm") + } + { Label7 Label + MoveScaled(36,4,4,4) + Text = ("mm") + } + } + } + } + } + { Separator1 Separator + MoveScaled(58,4,1,16) + } + { Panel1 VBox + MoveScaled(61,6,17,45) + { Button1 Button + MoveScaled(0,0,16,16) + Picture = Picture["icon:/64/printer"] + } + { Panel4 Panel + MoveScaled(1,16,14,5) + } + { Label2 Label + MoveScaled(1,21,10,2) + Text = ("Copies :") + } + { SpinBox1 SpinBox + MoveScaled(0,23,16,4) + } + { Panel2 Panel + MoveScaled(2,30,12,6) + Expand = True + } + { Button2 Button + MoveScaled(2,38,15,5) + Text = Shortcut(("Cancel"), "C") + Picture = Picture["icon:/22/cancel"] + } + } +} diff --git a/comp/src/gb.report/.src/Report.class b/comp/src/gb.report/.src/Report.class index 68635e155..41f5c8c10 100644 --- a/comp/src/gb.report/.src/Report.class +++ b/comp/src/gb.report/.src/Report.class @@ -33,7 +33,10 @@ Private $iCurSection As Integer Private $iCurPage As Integer = -1 Private $iPaper As Integer = 2 Private $iOrientation As Integer +' Private $hPrinter As New Printer As "Printer" + +' Property Read Printer As Printer Property Resolution As Integer Property Scale As Float Property Read PageCount As Integer @@ -317,55 +320,55 @@ Public Function Preview() End -Public Function Image(Value As String, X As String, Y As String) As ReportBrush +' Public Function Image(Value As String, X As String, Y As String) As ReportBrush +' +' Dim hBrush As New ReportBrush +' +' hBrush._Type = 1 +' hBrush._X = New TSizeParse(X) +' hBrush._Y = New TSizeParse(Y) +' hBrush._Image = Image.Load(Value) +' Return hBrush +' +' End +' +' Public Function LinearGradient(Colors As Integer[], Positions As Float[]) As ReportBrush +' +' Dim hBrush As New ReportBrush +' +' hBrush._Type = 2 +' 'hBrush.X = MRTools.ScanValue(X) +' 'hBrush.Y = MRTools.ScanValue(Y) +' +' hBrush._Color = Colors +' hBrush._Pos = Positions +' Return hBrush +' +' End - Dim hBrush As New ReportBrush +' Public Function RadialGradient(Colors As Integer[], Positions As Float[]) As ReportBrush +' +' Dim hBrush As New ReportBrush +' +' hBrush._Type = 3 +' 'hBrush.X = MRTools.ScanValue(X) +' 'hBrush.Y = MRTools.ScanValue(Y) +' +' hBrush._Color = Colors +' hBrush._Pos = Positions +' Return hBrush +' +' End - hBrush._Type = 1 - hBrush._X = New TSizeParse(X) - hBrush._Y = New TSizeParse(Y) - hBrush._Image = Image.Load(Value) - Return hBrush - -End - -Public Function LinearGradient(Colors As Integer[], Positions As Float[]) As ReportBrush - - Dim hBrush As New ReportBrush - - hBrush._Type = 2 - 'hBrush.X = MRTools.ScanValue(X) - 'hBrush.Y = MRTools.ScanValue(Y) - - hBrush._Color = Colors - hBrush._Pos = Positions - Return hBrush - -End - -Public Function RadialGradient(Colors As Integer[], Positions As Float[]) As ReportBrush - - Dim hBrush As New ReportBrush - - hBrush._Type = 3 - 'hBrush.X = MRTools.ScanValue(X) - 'hBrush.Y = MRTools.ScanValue(Y) - - hBrush._Color = Colors - hBrush._Pos = Positions - Return hBrush - -End - -Public Sub {Color}(iColor As Integer) As ReportBrush - - Dim hBrush As New ReportBrush - - hBrush._Type = 0 - hBrush._iValue = iColor - Return hBrush - -End +' Public Sub {Color}(iColor As Integer) As ReportBrush +' +' Dim hBrush As New ReportBrush +' +' hBrush._Type = 0 +' hBrush._iValue = iColor +' Return hBrush +' +' End Public Sub Refresh() @@ -686,9 +689,12 @@ Private Sub Orientation_Write(Value As Integer) End -Public Sub Print() - +Public Sub Print(Optional hPrinter As Printer) + If hPrinter Then + CPrint.PrintReport(Me, hPrinter) + Else CPrint.PrintReport(Me) + Endif End @@ -746,3 +752,16 @@ Public Sub _Reset() $iPageCount = 0 End + +' Private Function Printer_Read() As Printer +' +' Return $hPrinter +' +' End + + +' Public Sub Print2() +' +' _Reset +' +' End diff --git a/comp/src/gb.report/.src/ReportBrush.class b/comp/src/gb.report/.src/ReportBrush.class index 9490b0025..44dc7ea7a 100644 --- a/comp/src/gb.report/.src/ReportBrush.class +++ b/comp/src/gb.report/.src/ReportBrush.class @@ -211,7 +211,7 @@ Static Public Function RadialGradient(X As Float, Y As Float, Radius As Float, X Return hBrush End -Static Public Function ImageBrush(hImage As Image) As ReportBrush +Static Public Function Image(hImage As Image) As ReportBrush Dim hBrush As New ReportBrush hBrush._Image = hImage diff --git a/comp/src/gb.report/.src/ReportContainer.class b/comp/src/gb.report/.src/ReportContainer.class index b54eb51db..d30e56c12 100644 --- a/comp/src/gb.report/.src/ReportContainer.class +++ b/comp/src/gb.report/.src/ReportContainer.class @@ -694,7 +694,8 @@ Private Sub SetVChildGeometry(X As Float, Y As Float, W As Float, H As Float, Co bForceNewPage = False hchild._DataIndex = j - If Not bForceNewPage Then bExitLoop = True + 'If Not bForceNewPage Then + bExitLoop = True Break Endif @@ -741,10 +742,18 @@ Private Sub SetVChildGeometry(X As Float, Y As Float, W As Float, H As Float, Co 'On prévoie un sortie de boucle si l'enfant demande un affichage 1 par page If hchild.ForceNewPage Then bForceNewPage = True + Loop 'Next '## fin de la boucle de répétition 'Si la sortie anticipé est demandée alors on sort de la boucle If bExitLoop Then Break + If i < Me.Children.Max Then + If Me.Children[i + 1] Is ReportPageBreak Then + bForceNewPage = True + Inc Me._CurItem + Inc i + Endif + Endif 'Tout les objets on été répété alors on remet l'index à 0 'hchild._DataIndex = 0 'On incrémente le compteur des éléments traités @@ -1085,7 +1094,8 @@ Private Function _Index_Read() As Integer End Private Sub _Index_Write(Value As Integer) - 'If Super._Index = Value Then Return + + If Super._Index = Value And If Super._Index > 0 Then Return $bIndexChange = True Super._Index = Value diff --git a/comp/src/gb.report/.src/ReportLabel.class b/comp/src/gb.report/.src/ReportLabel.class index f8e297d10..3f2d3353b 100644 --- a/comp/src/gb.report/.src/ReportLabel.class +++ b/comp/src/gb.report/.src/ReportLabel.class @@ -74,18 +74,19 @@ Public Sub _GetSizeHints((AvailableW) As Float, (AvailableH) As Float, (TotalWid sText = $sText Endif If $fAngle = 0.0 Then - 'hExt = Paint.TextExtents(sText) + hRect = Paint.TextSize(sText) - fTextWidth = Me.Padding._Left + Me.Border._Left + MTools.PixelsToUnitspaint(hRect.Width) + Me.Padding._Right + Me.Border._Right + fTextWidth = Me.Padding._Left + Me.Border._Left + MTools.PixelsToUnitsPaint(hRect.Width) + Me.Padding._Right + Me.Border._Right fTextHeight = MTools.PixelsToUnitsPaint(hRect.Height) + Me.Padding._Top + Me.Padding._Bottom + Me.Border._Top + Me.Border._Bottom 'Debug Paint.Font.Height * Paint.ResolutionX / Desktop.Resolution Else Paint.Save + Paint.Rotate($fAngle) Paint.Text(sText, 0, 0) - Paint.Rotate(Rad($fAngle)) - fTextWidth = Me.Padding._Left + Me.Border._Left + MTools.PixelsToUnits(Paint.PathExtents.Width) + Me.Padding._Right + Me.Border._Right - fTextHeight = MTools.PixelsToUnits(Paint.PathExtents.Height) + Me.Padding._Top + Me.Padding._Bottom + Me.Border._Top + Me.Border._Bottom + hExt = Paint.PathExtents + fTextWidth = Me.Padding._Left + Me.Border._Left + MTools.PixelsToUnitsPaint(hExt.Width) + Me.Padding._Right + Me.Border._Right + fTextHeight = MTools.PixelsToUnitsPaint(hExt.Height) + Me.Padding._Top + Me.Padding._Bottom + Me.Border._Top + Me.Border._Bottom Paint.Restore Endif hMyHints.Height = Max(hMyHints.Height, fTextHeight) @@ -145,7 +146,7 @@ Public Sub _Paint((Page) As Integer, (X) As Float, (Y) As Float, (hControl) As T Paint.Text(sTempText, iX, iY, iW, iH, $iAlignment) Else Paint.Translate(iX + iW / 2, iY + iH / 2) - Paint.Rotate(Rad($fAngle)) + Paint.Rotate($fAngle) Paint.Translate(- (iX + iW / 2), - (iY + iH / 2)) Paint.Text(sTempText, iX, iY, iW, iH, Align.Center) diff --git a/comp/src/gb.report/.src/ReportPageBreak.class b/comp/src/gb.report/.src/ReportPageBreak.class new file mode 100644 index 000000000..ea95ef98d --- /dev/null +++ b/comp/src/gb.report/.src/ReportPageBreak.class @@ -0,0 +1,6 @@ +' Gambas class file + +Export +Inherits ReportControl + +Public Const _Properties As String = "-*" diff --git a/comp/src/gb.report/.src/Tests/Old/Report5.report b/comp/src/gb.report/.src/Tests/Old/Report5.report index fce62bb15..f2bdbb65a 100644 --- a/comp/src/gb.report/.src/Tests/Old/Report5.report +++ b/comp/src/gb.report/.src/Tests/Old/Report5.report @@ -22,32 +22,41 @@ Background = ReportBrush["#FFFF00"] } } - { ReportLabel1 ReportLabel - #MoveScaled(2,9,59,8) + { ReportPageBreak1 ReportPageBreak + #MoveScaled(5,10,60,5) + } + { ReportLabel1 ReportImage + #MoveScaled(1,12,59,8) Height = "7cm" Border = ReportBorder["Bottom:2mm #000000"] Background = ReportBrush["#00FF00"] } { ReportLabel2 ReportLabel - #MoveScaled(2,14,59,8) + #MoveScaled(2,18,59,8) Height = "2cm" Border = ReportBorder["Bottom:2mm #000000"] Background = ReportBrush["LinearGradient(1,0,0.28,0.35,[#00FF00,#FFFFFF],[0,1])"] } - { ReportLabel4 ReportLabel + { ReportLabel4 ReportImage #MoveScaled(3,23,59,8) Height = "6cm" Border = ReportBorder["Bottom:2mm #000000"] Background = ReportBrush["#00FF00"] } + { ReportPageBreak2 ReportPageBreak + #MoveScaled(2,31,59,2) + } { ReportLabel5 ReportLabel #MoveScaled(2,33,59,8) Height = "2cm" Border = ReportBorder["Bottom:2mm #000000"] Background = ReportBrush["#00FF00"] } + { ReportPageBreak3 ReportPageBreak + #MoveScaled(2,42,58,3) + } { ReportLabel3 ReportLabel - #MoveScaled(2,42,59,8) + #MoveScaled(1,44,59,8) Height = "2cm" Border = ReportBorder["Bottom:2mm #000000"] Background = ReportBrush["#00FF00"] diff --git a/comp/src/gb.report/.src/Tests/Old/Report8.class b/comp/src/gb.report/.src/Tests/Old/Report8.class index e5d74341a..33776664d 100644 --- a/comp/src/gb.report/.src/Tests/Old/Report8.class +++ b/comp/src/gb.report/.src/Tests/Old/Report8.class @@ -24,7 +24,10 @@ Public Sub ReportLabel1_Data(Index As Integer) End Public Sub ReportPanel1_BeforeData() - +If hResult1.Max < ReportPanel1.DataIndex Then + Print "error" & ReportPanel1.DataIndex + Return +Endif hResult1.MoveTo(ReportPanel1.dataindex) Print "BeforeData = " & hResult1!firstname hResult2 = db.Exec("Select * From test where firstname=&1 LIMIT 1,20", hResult1!firstname) diff --git a/comp/src/gb.report/.src/Tests/Old/Report8.report b/comp/src/gb.report/.src/Tests/Old/Report8.report index 13063001d..70e14e6a6 100644 --- a/comp/src/gb.report/.src/Tests/Old/Report8.report +++ b/comp/src/gb.report/.src/Tests/Old/Report8.report @@ -31,7 +31,7 @@ Tag = "Boite 1" Spacing = "1cm" { ReportPanel1 ReportVBox - #MoveScaled(1,3,64,45) + #MoveScaled(7,3,64,45) Width = "4cm" Height = "5cm" AutoResize = True diff --git a/comp/src/gb.report/.src/Tests/Old/myReport2.report b/comp/src/gb.report/.src/Tests/Old/myReport2.report index 4382d300f..643c85f70 100644 --- a/comp/src/gb.report/.src/Tests/Old/myReport2.report +++ b/comp/src/gb.report/.src/Tests/Old/myReport2.report @@ -41,7 +41,7 @@ } } { ReportVBox3 ReportVBox - #MoveScaled(37,2,34,16) + #MoveScaled(38,1,34,20) Padding = ReportPadding["Top:4mm;Bottom:4mm;Left:4mm;Right:4mm"] Expand = True AutoResize = True diff --git a/comp/src/gb.report/.src/Tests/OutputReport2.report b/comp/src/gb.report/.src/Tests/OutputReport2.report index a32513be4..43c526f19 100644 --- a/comp/src/gb.report/.src/Tests/OutputReport2.report +++ b/comp/src/gb.report/.src/Tests/OutputReport2.report @@ -6,7 +6,7 @@ Padding = ReportPadding["Top:20mm;Bottom:10mm;Left:20mm;Right:20mm"] Ignore = True AutoResize = True - Paper = Printer.Letter + Orientation = Printer.Landscape Index = 0 Text = ("") { ReportHBox1 ReportHBox diff --git a/comp/src/gb.report/.src/Tests/Report9.class b/comp/src/gb.report/.src/Tests/Report9.class new file mode 100644 index 000000000..7c5efc4de --- /dev/null +++ b/comp/src/gb.report/.src/Tests/Report9.class @@ -0,0 +1,8 @@ +' Gambas class file + +Public Sub _new() + 'Report.Debug = True + Me.Width = "5cm" + Me.Height = "10cm" + +End diff --git a/comp/src/gb.report/.src/Tests/Report9.report b/comp/src/gb.report/.src/Tests/Report9.report new file mode 100644 index 000000000..9b9e06e06 --- /dev/null +++ b/comp/src/gb.report/.src/Tests/Report9.report @@ -0,0 +1,16 @@ +# Gambas Form File 3.0 + +{ Report Report + #MoveScaled(0,0,64,64) + Index = 0 + Text = ("") + { ReportLabel1 ReportLabel + #MoveScaled(22,13,7,41) + Font = Font["Bold,+4"] + AutoResize = True + Border = ReportBorder["Top:1px #000000;Bottom:1px #000000;Left:1px #000000;Right:1px #000000"] + Text = ("Test") + Rotate = 1.57 + } + Index = 0 +} diff --git a/comp/src/gb.report/.src/Tests/Test.module b/comp/src/gb.report/.src/Tests/Test.module index 6834fddd7..593c3ae99 100644 --- a/comp/src/gb.report/.src/Tests/Test.module +++ b/comp/src/gb.report/.src/Tests/Test.module @@ -1,19 +1,9 @@ ' Gambas module file -' Public Sub Main() + Public Sub Main() ' -' 'Dim hReport As New Report11 -' Dim hLabel As ReportLabel -' 'hReport.Padding = ReportPadding["2cm"] -' ' -' ' hLabel = New ReportLabel(hReport) -' ' 'hLabel.Padding = ReportPadding["1mm"] -' ' -' ' hLabel.Border.Width = "1mm" -' ' hLabel.Text = "coucou" -' ' hLabel.Autoresize = True -' ' -' ' hReport.Preview -' hReport.Print -' -' End + Dim hreport As New Report9 + Dim hprinter As New Printer + hprinter.OutputFile = User.Home &/ "sortie.pdf" + hreport.Print(hprinter) + End diff --git a/comp/src/gb.report/printer1.png b/comp/src/gb.report/printer1.png index d554b554fcbe0f0e4968aadef35ce38e4fd655fc..665270884e3a2509bad34423e7dc0c23d7381ab3 100644 GIT binary patch delta 46 xcmaFJ)5beNS($;Q*vT`50|;t3QaTtI7&r?&B8wRq_>O=u<5X=v>5YmGYykcB3UB}b delta 10 RcmZqUeaJIGd83CN8vqqV191QV