diff --git a/comp/src/gb.report2/.project b/comp/src/gb.report2/.project index 683acbab3..91994956f 100644 --- a/comp/src/gb.report2/.project +++ b/comp/src/gb.report2/.project @@ -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 diff --git a/comp/src/gb.report2/.src/Report.class b/comp/src/gb.report2/.src/Report.class index 73585b038..0cf49aad1 100644 --- a/comp/src/gb.report2/.src/Report.class +++ b/comp/src/gb.report2/.src/Report.class @@ -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 diff --git a/comp/src/gb.report2/.src/Tests/Module2.module b/comp/src/gb.report2/.src/Tests/Module2.module new file mode 100644 index 000000000..cf0cd71ce --- /dev/null +++ b/comp/src/gb.report2/.src/Tests/Module2.module @@ -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 diff --git a/comp/src/gb.report2/.src/Viewer/FPreview.class b/comp/src/gb.report2/.src/Viewer/FPreview.class index 88503fbec..ac7f63a83 100644 --- a/comp/src/gb.report2/.src/Viewer/FPreview.class +++ b/comp/src/gb.report2/.src/Viewer/FPreview.class @@ -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()