Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Subform - Reports (Read 3631 times)
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Subform - Reports
Reply #15 - Feb 20th, 2018 at 9:44pm
Print Post Print Post  
Thank you Ray, you were right on the money with number 3. I went to Sesame Designer > Security Manager > Application Settings > then "Remove All Security Application"  and now it works. I wasn't aware that application security had even been setup as I've never had to enter a username or password or anything, except for system administration stuff. The report is still coming up blank but I'm sure I can figure that out from here. At least I'm getting something. Thank you.
  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Subform - Reports
Reply #16 - Feb 21st, 2018 at 3:03am
Print Post Print Post  
Figured it out. Here's my working code:

Code
Select All
#include "sbasic_include.sbas"

var vDateInitial as String
var v1stHalf as Date
var v2ndHalf as  Date
var vDate as String
var vHandle as Int
var vPrint as String

//Takes user input from the Date field in the Work Subform in however format they type it and converts
it to the Sesame system dating of yyyy/mm/dd so that it works as a search spec with @XResultSetSearch.

vDateInitial = @FormFieldValue("Work", "Work_Date", 0)
v1stHalf = @Del(vDateInitial, @Instr(vDateInitial, ".."), 10)
v2ndHalf = @Mid(vDateInitial, @Instr(vDateInitial, ".."), 10)
vDate = v1stHalf + ".." + v2ndHalf

//Imports the search spec into the result set search and assigns an RS Handle.

vHandle = @XResultSetSearch(@FN, "ACTION!Work", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!LE0=" + vDate)

//Prints the result set within the RS Handle if the form is in Update mode.

	If(vHandle > -1)
		{
			vPrint = @XResultSetPrintReport("Techs Receivable", vHandle, REPORT_MODE_HTML_PREVIEW)
		}
//Closes result set.

XResultSetClose(vHandle)
 



It turns out there were a couple things wrong that weren't working.

Yes the security was the number one issue, and why I continually got "-1". Even though I never had to enter a username or password to do anything with the database, there were still security settings that were set that needed to be removed.

But also, it wouldn't work using "Work_Date" as the  name in @XResultSetSearch(), I did indeed have to use "LE0" which is the original name that it was assigned to, which is interesting because I thought I remember reading that you only have to use the original bound to names for XLookUp commands.

Anyways, the other key thing that was wrong was the format of the search criteria in @XResultSetSearch(). It turns out you can't enter a date range like you can in the main form for a date field. You know where you might enter something like "2/1/18..2/28/18." This is what it wants instead: "2018/02/01..2018/02/28. Essentially yyyy/mm/dd. So if you convert it to that then, it will work perfectly.

Thanks for all the help everybody, now to make the report look better.
  
Back to top
 
IP Logged
 
actiontech
Full Member
***
Offline



Posts: 173
Joined: Apr 10th, 2016
Re: Subform - Reports
Reply #17 - Feb 23rd, 2018 at 2:13am
Print Post Print Post  
* Correction

Code
Select All
//Takes user input from the Date field in the Work Subform in however format they type it and converts
//it to the Sesame system dating of yyyy/mm/dd so that it works as a search spec with @XResultSetSearch.

 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send Topic Send Topic Print Print