165 pts.
 Variable page heading in query
I have created a query in which I am passing parameters. The query works great but I was wondering is there a way to make the page heading variable? For example, if the user needed a report on a particular vendor and this parameter was passed to my query, I would want the report heading to read 'Payments made to vendor XXXXXXX' with XXXXXXX being the vendor number.

Software/Hardware used:
ASKED: October 11, 2006  1:35 PM
UPDATED: December 24, 2009  10:37 PM

Answer Wiki:
The only way I have been able to do this is to use SQM/400 to create the final report. This allows you to use any data from the file in headings & footers. I create a holding file to keep the parameter, e.g. User name, Company Name, date range, etc. I join this file to my final created file, in SQM. I then use the information in the header for the report. Kas
Last Wiki Answer Submitted:  October 12, 2006  7:21 am  by  KasMcc   230 pts.
All Answer Wiki Contributors:  KasMcc   230 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

You can OVRPRTF QPQUPRFIL when you run the query and load the parm field PRTTXT with the parameters to id the query. This will print at the bottom of each page of the query. The field is short (I think 30 characters), but gives you the flexibility to label the report. HTH.

 0 pts.

 

You haven’t said what product you’re using to create and run your query. If this is with Query/400, there is no good way to do it. If this is a QM query, you simply enter the column number as a variable in the heading text.

The column number refers to the ordinal position of the column (&1, &2, etc.) in the underlying SELECT statement column list.

Often, that column is only desired as part of the heading and not as part of any detail line. To remove it from detail lines, you set the width to zero for it in the detail line of the report form.

The QM reference describes the steps for inserting variable values in headings in the ‘Specifying page headings and footings in Query Manager’ subtopic. An example is in the manual.

Tom

 110,115 pts.