LOCAL lcWindow,lcWindowName yy=CREATEOBJECT("_form") yy.Show() yy.Name="yy" lcWindow="wndReport"+SYS(2015) lcWindowName="wndReportName"+SYS(2015) DEFINE WINDOW (lcWindow) FROM 0,0 TO 10,20 NOMDI NOMINIMIZE; NOZOOM NOGROW SYSTEM ; TITLE "Report " NAME (lcWindowName) IN ("yy") REPORT FORM (lcReport) PREVIEW WINDOW (lcWindow) RELE WINDOW (lcWindow) **************************************** DEFINE CLASS _form AS form ShowWindow=2 ENDDEFINEMartinJ
>oRepForm = CREATEOBJECT("basecontrols.wb_prev") >DO CASE >&&That part checks the name of the report that's run (lcReport) in order to provide a >&&relevant title for the window > CASE lcReport = "lstAvantSoc" > oRepForm.caption = "Détail des avantages sociaux" > CASE lcReport = "lstCompRatio" > oRepForm.caption = "Comparaison de la rationalisation" >&& and so on... >ENDCASE > >WITH oRepForm as wb_prev >*!* .WindowState = 2 &&those are set in the derived form I made to that effect >*!* .ScrollBars = 3 &&so I comment them... > .Name = "fenRapp" > .Show() >ENDWITH > >REPORT FORM (lcReport) NOCONSOLE PREVIEW WINDOW fenRapp TO FILE &lcPSFile >oRepForm.Release() > >&& That is the case when the user want to print the report to a PDF (using the Oh, so >&& efficient print2PDF, by Paul James, but the same thing >&& happens with "REPORT FORM (pcRapport) TO PRINTER PREVIEW WINDOW fenRapp", when the >&& user just try to print the report normally... > >>