New property Path in report that allow to define the output file
When used with preview, the returned value is the new path used. [GB.REPORT2] * NEW: New property Path in report that allow to define the output file
This commit is contained in:
parent
f77f4b8188
commit
3937ea5fb8
4 changed files with 31 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
# Gambas Project File 3.0
|
||||
Title=ReportsEvolution
|
||||
Startup=Report13
|
||||
Startup=Module2
|
||||
Icon=.hidden/control/reportview.png
|
||||
Version=3.15.90
|
||||
VersionFile=1
|
||||
|
|
|
@ -82,6 +82,8 @@ Property Orientation As Integer
|
|||
Property Read _Width As Float
|
||||
Property Read _Height As Float
|
||||
|
||||
Property Path As String Use $sPath
|
||||
|
||||
Event Open
|
||||
|
||||
Static Public Sub Main()
|
||||
|
@ -322,9 +324,9 @@ End
|
|||
'
|
||||
|
||||
Public Function Preview()
|
||||
|
||||
If Me.Path Then FPreview.Path = Me.Path
|
||||
FPreview.Run(Me)
|
||||
|
||||
If FPreview.Path Then Me.Path = FPreview.Path
|
||||
End
|
||||
|
||||
|
||||
|
|
13
comp/src/gb.report2/.src/Tests/Module2.module
Normal file
13
comp/src/gb.report2/.src/Tests/Module2.module
Normal file
|
@ -0,0 +1,13 @@
|
|||
' Gambas module file
|
||||
|
||||
Public Sub main()
|
||||
|
||||
Dim hreport As New Report13
|
||||
|
||||
hreport.Path = User.Home &/ "Test.pdf"
|
||||
|
||||
hreport.Preview
|
||||
|
||||
Print hreport.Path
|
||||
|
||||
End
|
|
@ -7,6 +7,8 @@ Private $hPrinter As New Printer As "Printer"
|
|||
Private $bVerif As Boolean
|
||||
Private $bPrinting As Boolean
|
||||
Private $iFileRes As Integer = 150
|
||||
Static Property Path As String Use $sPath
|
||||
|
||||
|
||||
Static Public Function Run(hReport As Report)
|
||||
|
||||
|
@ -88,6 +90,7 @@ Private Sub GetValuesFromReport()
|
|||
spHeight.Value = $hPrinter.PaperHeight
|
||||
Object.Unlock(spHeight)
|
||||
|
||||
|
||||
End
|
||||
|
||||
Public Sub sldZoom_Change()
|
||||
|
@ -404,6 +407,9 @@ Public Sub Form_Close()
|
|||
Settings.Save()
|
||||
Endif
|
||||
|
||||
FPreview.Path = IIf(tabPrint.Index = 1, txtFile.Text, "")
|
||||
|
||||
|
||||
End
|
||||
|
||||
Public Sub Form_Open()
|
||||
|
@ -447,6 +453,13 @@ Public Sub Form_Open()
|
|||
|
||||
btnOnePage.Value = True
|
||||
tabPrint_Click
|
||||
|
||||
If FPreview.Path And If Not IsDir(FPreview.Path) Then
|
||||
tabPrint.Index = 1
|
||||
txtFile.Text = FPreview.Path
|
||||
Endif
|
||||
|
||||
|
||||
End
|
||||
|
||||
Public Sub btnZoomIn_Click()
|
||||
|
|
Loading…
Reference in a new issue