>Hello All!
>
>Our system creates a report title page for every report that the user runs. This title page shows the selection/search criteria that was used to query for the report.
>
>The issue: reports can be initiated from four (4) separate places in the system: report manager (normal), a specific user form, from multiple search forms and from a report scheduling process.
>
>The one that is really causing me some issues is the search form option.
>
>There are 12 search forms in the system. Each search form has different search criteria on it.
>
>The problem is that a single report can then be run based on a variety of 12 different sets of search criteria.
>
>Putting all those fields in the Title Page band and controlling them with Print When clause is not a preferred solution.
>
>The REAL problem is the fields would all have to be overlaid in order to fit all the different criteria sets into an 8 1/2 by 11 inch window, which is a VFP restriction. Maintaining this every time we make a change to a search form would be a nightmare!
>
>Any ideas on how I can handle this one?
I use custom textmerge with variables for this. Criteria are taken into variables (could be properties) then simply merged into report criteria
lines of text (array elements).
Account# nSomething
---------------------- --------
From: nFromVariable1 From... x
To....: nToVariable1 To.. y
------------------------
Inlist: cInlist
Criteria text is to be shown with monospaced font (eg courrier new) to preserve alignment across multiple lines As for calling report from multiple places;
Build it as session object!
define class myReportTask as session
procedure GetCriteria
procedure RunReport
this.ExtractReportData()
this.PrepareRanges()
.
report form myFrx to printer ...
procedure ExtractReportData
select blah blah ...
procedure PrepareRanges
enddefine
Then run the whole thing literally from anywhere you want
local oRP
oRP=CreateObject('myReportTask')
oRP.RunReport()
Apply extra effort to avoid usage of public variables ;)
HTH
Sergio