montypython1
Technical User
Greetings,
How do I tell a report to Page Advance vs. Line Advance at run time? I would think that I could pass a parameter to do this. I realize that within the Report Designer properties, there is an area called "Data Grouping". And within this area, I can cause a Group to generate either a New Page or a New Line.
What I can't seem to figure out is how to change this on demand (I do not want to maintain 2 separate reports). I suspect that it would look something like this, where there are 4 parameters being passed:
DO ReportPreview IN 01Main WITH "1on1 Report" , "reports\var_all_3ld.frx", "P" , "L"
In the 3rd parameter, the "P" signifies that the first data group should have a Page break. In the 4th parameter, the "L" signifies that the second group should have a Line break. The procedure "ReportPreview" is below (it has 5, not 4 parameters, but you get the idea).
Any ideas how to implement this kind of report flexibility?
Thanks,
Dave Higgins
****************************************************************
*** ReportPreview
*** 20100907
****************************************************************
****************************************************************
PROCEDURE ReportPreview
PARAMETERS RptCaption, RptName, RptForClause, P_L_Group1, P_L_Group2
****************************************************************
oRepForm = CREATEOBJECT("Form")
WITH oRepForm
.CAPTION = (RptCaption) + " - - - - - To Close: either click on the 'Print Preview Toolbar Door' -or- click on the Red 'X' -or- press the 'ESC' button"
.WINDOWSTATE = 2 &&This will maximize the form
.MINBUTTON = .F.
.MAXBUTTON = .F.
.SHOW()
ENDWITH
IF VARTYPE(RptForClause) <> "L"
REPORT FORM (RptName) ;
FOR &RptForClause ;
TO PRINTER PROMPT PREVIEW WINDOW (oRepForm.NAME)
ELSE
REPORT FORM (RptName) ;
TO PRINTER PROMPT PREVIEW WINDOW (oRepForm.NAME)
ENDIF
oRepForm.RELEASE()
****************************************************************
RETURN
****************************************************************
ENDPROC
*****************************************************************************************************
*****************************************************************************************************
How do I tell a report to Page Advance vs. Line Advance at run time? I would think that I could pass a parameter to do this. I realize that within the Report Designer properties, there is an area called "Data Grouping". And within this area, I can cause a Group to generate either a New Page or a New Line.
What I can't seem to figure out is how to change this on demand (I do not want to maintain 2 separate reports). I suspect that it would look something like this, where there are 4 parameters being passed:
DO ReportPreview IN 01Main WITH "1on1 Report" , "reports\var_all_3ld.frx", "P" , "L"
In the 3rd parameter, the "P" signifies that the first data group should have a Page break. In the 4th parameter, the "L" signifies that the second group should have a Line break. The procedure "ReportPreview" is below (it has 5, not 4 parameters, but you get the idea).
Any ideas how to implement this kind of report flexibility?
Thanks,
Dave Higgins
****************************************************************
*** ReportPreview
*** 20100907
****************************************************************
****************************************************************
PROCEDURE ReportPreview
PARAMETERS RptCaption, RptName, RptForClause, P_L_Group1, P_L_Group2
****************************************************************
oRepForm = CREATEOBJECT("Form")
WITH oRepForm
.CAPTION = (RptCaption) + " - - - - - To Close: either click on the 'Print Preview Toolbar Door' -or- click on the Red 'X' -or- press the 'ESC' button"
.WINDOWSTATE = 2 &&This will maximize the form
.MINBUTTON = .F.
.MAXBUTTON = .F.
.SHOW()
ENDWITH
IF VARTYPE(RptForClause) <> "L"
REPORT FORM (RptName) ;
FOR &RptForClause ;
TO PRINTER PROMPT PREVIEW WINDOW (oRepForm.NAME)
ELSE
REPORT FORM (RptName) ;
TO PRINTER PROMPT PREVIEW WINDOW (oRepForm.NAME)
ENDIF
oRepForm.RELEASE()
****************************************************************
RETURN
****************************************************************
ENDPROC
*****************************************************************************************************
*****************************************************************************************************