Normal Topic Attached Retrieve Spec questions (Read 1194 times)
dhopkins
Member
*
Offline



Posts: 47
Joined: Aug 20th, 2007
Attached Retrieve Spec questions
Jan 8th, 2008 at 7:36pm
Print Post Print Post  
Now that I'm diving into the retrieve spec part of Sesame, I'm confused about certain things.
I've created a retrieve spec in Sesame and saved it. I then attached it to a report. Is it possible to run that report using a result set from a search, or is there no way to get around the attached spec overriding the result set? It would be great if the retrieve spec was applied to the result set instead of ignoring it.

Also, in Q&A, when we ran a report, it would ask if we wanted to make any changes to the spec before running it. This allowed for running a report for different dates/locations. Sesame doesnt seem to give that same option without the user having to manually open the spec manager.

Once a user has gotten a result setm, can I use the SpecCommand command to load different retrieve specs, and run the reports against those specs?

I need to make it as simple as possible for the users to run a report so I want to keep them as far away from menus as possible. I want them to put in a date, click a command button and voila, a report.


Thanks
D
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Attached Retrieve Spec questions
Reply #1 - Jan 8th, 2008 at 7:49pm
Print Post Print Post  
dhopkins wrote on Jan 8th, 2008 at 7:36pm:
Now that I'm diving into the retrieve spec part of Sesame, I'm confused about certain things.
I've created a retrieve spec in Sesame and saved it. I then attached it to a report. Is it possible to run that report using a result set from a search, or is there no way to get around the attached spec overriding the result set?

No. The attached spec's purpose in life is to override the result set. That's why you attach one.

Quote:
It would be great if the retrieve spec was applied to the result set instead of ignoring it.

I'm not sure what this means. What is ignoring what?

Quote:
Also, in Q&A, when we ran a report, it would ask if we wanted to make any changes to the spec before running it. This allowed for running a report for different dates/locations. Sesame doesnt seem to give that same option without the user having to manually open the spec manager.

This is achieved by not attaching a retrieve spec. Then you can retrieve the records you want and run the report against them.

Quote:
Once a user has gotten a result setm, can I use the SpecCommand command to load different retrieve specs, and run the reports against those specs?

Yes. You don't have to wait until they get a result set. If you want, you can put a button on your form that offers a list of saved retrieves, loads the selected one, gets the records, then runs the report. 

Quote:
I need to make it as simple as possible for the users to run a report so I want to keep them as far away from menus as possible. I want them to put in a date, click a command button and voila, a report.

This is quite doable. Take a look at the @SpecCommand and @PrintAReport commands.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Attached Retrieve Spec questions
Reply #2 - Jan 8th, 2008 at 8:27pm
Print Post Print Post  
Maybe this will help. The code below offers the user a list of saved retrieve specs. Once they select one, it loads that spec, retrieves the records, then runs a report called "EMY" showing the retrieved records.

Code
Select All
#include "sbasic_include.sbas"

var vTmp as Int
var vList as String
var vChoice as String

	If @Mode() = 1
	{
		vTmp = @SelectTreeItem("Search Update Menu!Search (F7)")
	}
	If @Mode() = 2
	{
		vList = @SpecCommand(SPEC_OPERATION_LIST, SPEC_TYPE_RETRIEVE, "")
		vList = @InsertStringArray(vList, "Current Spec", 1)
		PopupSelectPosition(4, @XPos(ThisElement), @YPos(ThisElement))
		vChoice = @PopupMenu(vList, "SELECT A SPEC")
		If vChoice <> ""
		{
			If vChoice <> "Current Spec"
			{
				vList = @SpecCommand(SPEC_OPERATION_LOAD, SPEC_TYPE_RETRIEVE, vChoice)
			}
			vList = @SpecCommand(SPEC_OPERATION_RUN, SPEC_TYPE_RETRIEVE, "")
			vTmp = @PrintAReport("EMY", REPORT_MODE_HTML_PREVIEW, PRINT_ORIENTATION_PORTRAIT, PRINT_NO_DIALOG, -1, -1, -1, -1, -1, -1)
		}
	}


 

  

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



Posts: 47
Joined: Aug 20th, 2007
Re: Attached Retrieve Spec questions
Reply #3 - Jan 8th, 2008 at 8:49pm
Print Post Print Post  
Thanks! This will be a huge help.

D
  
Back to top
 
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Attached Retrieve Spec questions
Reply #4 - Sep 5th, 2009 at 1:34pm
Print Post Print Post  
Hallo!

I want to know what all these numbers mean in  @SpecCommand() function.
In Sesame documentation I do not.

SpecCommand(6, 10, “”) ?
@SpecCommand(0, 10, vChoice)

Thank you for your support.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Attached Retrieve Spec questions
Reply #5 - Sep 5th, 2009 at 2:26pm
Print Post Print Post  
The SpecCommand has three parts (arguments), the command, the spec type, and a set of strings indicating the specs and such to be operated upon.

The first "number" is the operation ro be performed. These are define in sbasic_include.sbas:
Code
Select All
#define SPEC_OPERATION_LOAD  0
#define SPEC_OPERATION_SAVE  1
#define SPEC_OPERATION_RUN  2
#define SPEC_OPERATION_VIEW  3
#define SPEC_OPERATION_SET  4
#define SPEC_OPERATION_CLEAR  5
#define SPEC_OPERATION_LIST  6
 



The second number is the spec type to be operated upon:
Code
Select All
#define SPEC_TYPE_RETRIEVE  1
#define SPEC_TYPE_SORT  2
#define SPEC_TYPE_EXPORT  3
#define SPEC_TYPE_IMPORT  4
#define SPEC_TYPE_MASS_UPDATE  5
#define SPEC_TYPE_COPY  6
#define SPEC_TYPE_RESTRICTION  7
#define SPEC_TYPE_TABLE  8
#define SPEC_TYPE_PRINT_SETTINGS  9
#define SPEC_TYPE_QREPORT  10
 



If you right click in the programming editor, one of the menu choices is "List Browser". The list browser lists all of the SBasic commands/functions in a searchable list with descriptions (and often examples) for each.
Here is the list browser entry for SpecCommand:
Code
Select All
@SpecCommand provides a single function that can perform a set of spec commands on any of the Sesame runtime spec types.

@SpecCommand takes three required arguments, operation as an integer, spec_type as an integer, and command_string as string It also accepts a variable number of optional arguments: ... as a string.

operation can be:
	SPEC_OPERATION_LOAD
	SPEC_OPERATION_SAVE
	SPEC_OPERATION_RUN
	SPEC_OPERATION_VIEW
	SPEC_OPERATION_SET
	SPEC_OPERATION_CLEAR
	SPEC_OPERATION_LIST

spec type can be:
	SPEC_TYPE_RETRIEVE
	SPEC_TYPE_SORT
	SPEC_TYPE_EXPORT
	SPEC_TYPE_IMPORT
	SPEC_TYPE_MASS_UPDATE
	SPEC_TYPE_COPY
	SPEC_TYPE_RESTRICTION
	SPEC_TYPE_TABLE
	SPEC_TYPE_QREPORT

The command_string argument can can repeated to send multiple strings. This function returns the spec as a string array when used with the VIEW operation.

Examples:


// Loads an already saved retrieve spec for use
vStr = @SpecCommand(SPEC_OPERATION_LOAD, SPEC_TYPE_RETRIEVE, "MyRetrieveSpec")

// Saves the currrent retrieve spec as "MyName"
vStr = @SpecCommand(SPEC_OPERATION_SAVE, SPEC_TYPE_RETRIEVE, "MyName")

// Runs the currently loaded retrieve spec
vStr = @SpecCommand(SPEC_OPERATION_RUN, SPEC_TYPE_RETRIEVE, "")

// Returns the current retrieve spec to the variable "vStr"
vStr = @SpecCommand(SPEC_OPERATION_VIEW, SPEC_TYPE_RETRIEVE, "")

// Set the current retrieve spec so that last name begins with "w" and first name begins with "w"
vStr = @SpecCommand(SPEC_OPERATION_SET, SPEC_TYPE_RETRIEVE, "Last Name=m..", "First Name=w..")

// Clears the current retrieve spec
vStr = @SpecCommand(SPEC_OPERATION_CLEAR, SPEC_TYPE_RETRIEVE, "")

// Returns a list of saved retrieve specs
vStr = @SpecCommand(SPEC_OPERATION_LIST, SPEC_TYPE_RETRIEVE, "")
 

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Amor
Full Member
Members
***
Offline


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Attached Retrieve Spec questions
Reply #6 - Sep 5th, 2009 at 4:24pm
Print Post Print Post  
i thank you so much.
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
Back to top
 
IP Logged