Normal Topic Print the search criteria (Read 972 times)
Robert
Member
*
Offline



Posts: 35
Joined: May 7th, 2013
Print the search criteria
Sep 15th, 2014 at 4:30pm
Print Post Print Post  
I'd like to print out what the users are actually searching for on full featured reports.  It's for internal reports so the users would understand.  Basically something like this in the report header:

Population (Designation : /=, Transport Date: >9/15/2014, Actual Term: <9/14/2014;=)


Designation, Transport Date and Actual Term are label names on the fields.
  
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Print the search criteria
Reply #1 - Sep 16th, 2014 at 2:01pm
Print Post Print Post  
Hello Robert,

Are the users running the reports by clicking a command button or from clicking the reports on the Menu tree?

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Robert
Member
*
Offline



Posts: 35
Joined: May 7th, 2013
Re: Print the search criteria
Reply #2 - Sep 16th, 2014 at 6:39pm
Print Post Print Post  
Menu Tree
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Print the search criteria
Reply #3 - Sep 17th, 2014 at 3:08pm
Print Post Print Post  
The Temporary Value attribute contains the search criteria for an element, so you can add an Unbound Value Box to the View Header of your Report and program it to pick up the search criteria from the form.

Criteria :: On Print
Code
Select All
#define	ATTR_ID_TEMPORARY_VALUE	37


	Criteria = "Criteria: " + @FormAttribute("Customers", "Company", ATTR_ID_TEMPORARY_VALUE) 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Robert
Member
*
Offline



Posts: 35
Joined: May 7th, 2013
Re: Print the search criteria
Reply #4 - Sep 17th, 2014 at 3:51pm
Print Post Print Post  
This worked perfectly!!

Thanks!

Now I just need to write a routine that automatically grabs any elements that weren't blank when they searched so I can tack that on to the end of a report when they start telling me the data is wrong....lol   Versus naming each element individually that is.....
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Print the search criteria
Reply #5 - Sep 17th, 2014 at 6:47pm
Print Post Print Post  
Robert wrote on Sep 17th, 2014 at 3:51pm:
Now I just need to write a routine that automatically grabs any elements that weren't blank when they searched so I can tack that on to the end of a report when they start telling me the data is wrong....lol   Versus naming each element individually that is.....



Try something like this. Use a single record mass update or a line of code you can use and then quickly remove to get a list of the elements on your form.
Code
Select All
WriteLn(@StringArrayElementList()) 



Then, once you have that list, you can copy/paste it into a routine like this in your Report.
Code
Select All
#include "sbasic_include.sbas"

var vList as String
var vCnt as Int
var vLoop as Int
var vName as String
var vVal as String
var vCriteria as String

	vCriteria = "Criteria: "
	// List acquired via @StringArrayElementList()
	vList = "LE0;LE1;LE30;LE3;KEY;Active;First;MI;Last;Company;Add1;Add2;City;State;ZIP;Phone;Email;Position;Interests;Numerical;Credit_Limit;Date_Entered;Time_Field"
	vCnt = @CountStringArray(vList)
	For vLoop = 1 To vCnt
		vName = @AccessStringArray(vList, vLoop)
		vVal = @FormAttribute("Customers", vName, ATTR_ID_TEMPORARY_VALUE)
		If vVal <> ""
		{
			vCriteria = vCriteria + "[" + vName + "]=[" + vVal + "] "
		}
	Next
	Criteria = vCriteria 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged