Hot Topic (More than 10 Replies) Probably Stupid Question - Attach Spec in Report (Read 2240 times)
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Probably Stupid Question - Attach Spec in Report
Jul 31st, 2008 at 5:04pm
Print Post Print Post  
I'm trying to create a report that will only list records that meet a particular criteria. I've used the 'Report Wizard' to create a report that lists all the records for a particular database. Then I go into runtime and create a retrieve spec that shows just the records I want to show up in my report. When I then go back into Sdesigner and attach the retrieve spec (it's listed as an option) I get the following message when I try to preview the report:

"Warning - attached retrieve spec uses elements which do not appear on this report."

Which is strange because the spec in question references a single field (in this case, the name of the company) and and I included the field in the report while going through the wizard. When I bypass the error message I see the report with all the records.

What am I doing wrong?
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Probably Stupid Question - Attach Spec in Repo
Reply #1 - Jul 31st, 2008 at 5:12pm
Print Post Print Post  
Did you make the Retrieve Spec on the same form as the one where you are launching the report?
  

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



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #2 - Jul 31st, 2008 at 7:01pm
Print Post Print Post  
Yes.

I preview from SDesigner, open the 'Jobs' database under 'Search/Update' and find the record set that I want to see in a report.
Namely, job records that have been completed. I then hit Ctrl-F8 (to call up the Spec Manager) and save the spec.

Then when I close the preview I go back to SDesigner, and create a new report using the Report Wizard for the Jobs database.

When I preview that form, I get no problems -- I just see all the job records. I usually only include a few fields when I use the wizard -- the company name, the checkbox that indicates whether the job is complete, etc. Then I attach the Retrieve Spec (the one I saved earlier is shown). When I preview the report, however, I get the error message.

I've tried using a very simple search on the company name as a retrieve spec (figuring the error might have something to do with checkboxes) but I still get the same error.
  
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #3 - Jul 31st, 2008 at 7:23pm
Print Post Print Post  
Ok, I did an experiment -- created a database with a single field named 'Company' and added some records to it. Then I created a retrieve spec that restricts to just certain records, and then saved it. I attach that spec to a Wizard-generated report (containing just that field) and I still get the error. There must be something simple that I'm missing.
  
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: Probably Stupid Question - Attach Spec in Repo
Reply #4 - Jul 31st, 2008 at 7:39pm
Print Post Print Post  
Are you running the report by going into Preview Application or by clicking Preview Report from the commands area?

-Ray
  

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



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #5 - Aug 1st, 2008 at 12:03pm
Print Post Print Post  
Quote:
Are you running the report by going into Preview Application or by clicking Preview Report from the commands area?

-Ray


I use Preview Report, and generate a HTML-based report.
  
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: Probably Stupid Question - Attach Spec in Repo
Reply #6 - Aug 1st, 2008 at 1:09pm
Print Post Print Post  
For Reports with attached retrieve specs you need to go into Preview Application and run them from the Form.

-Ray
  

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



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #7 - Aug 1st, 2008 at 2:19pm
Print Post Print Post  
Ok, so I have to first find the records using Search/Update on the form with the report, and then run the report.

Is there anyway to program Sesame to run the search behind the scenes, and then run the report? I'd rather not have my end users have to find the records first, and then select the report.
  
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: Probably Stupid Question - Attach Spec in Repo
Reply #8 - Aug 1st, 2008 at 2:50pm
Print Post Print Post  
Your users only have to be looking at a record in Search/Update. It does not need to be the set of records that you want on the report. It can be any record out of the database.

To run the report you would need to
Open DB file
Open Jobs in Search/Update
Hit F10
Run the report


The attached retrieve Spec will retrieve just the records that meet the criteria specified in it and display just those records in the report.

-Ray
  

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



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Probably Stupid Question - Attach Spec in Repo
Reply #9 - Aug 2nd, 2008 at 10:22pm
Print Post Print Post  
Acebanner wrote on Aug 1st, 2008 at 2:19pm:
Is there anyway to program Sesame to run the search behind the scenes, and then run the report? I'd rather not have my end users have to find the records first, and then select the report.


You could use @XResultSetPrintReport attached to a button on a custom menu (or anywhere you like, actually).

Here is an example of some code I have in a button, which is located on a custom menu. The user never sees the form at all.
Code
Select All
var vRS as int
var vInvNo as string
var vReportFileName as string
var vList as string


vRS = @XResultSetSearch(@FN, "Products", 0, 2, "!BoxesInStock=>0")
If vRS > -1
{
	vReportFileName = @XResultSetPrintReport("Inventory Sheet", vRS, 1)
	XResultSetClose(vRS)
}
 



In this example, the report does NOT have any retrieve specs attached -- that's handled by the last parameter in @XResultSetSearch. It just has sort specs attached.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #10 - Aug 4th, 2008 at 12:40pm
Print Post Print Post  
Thank you Carl, that's what I'm trying to do. I also did not realize the default behavior of Sesame when it comes to reports in the first place (thanks Erika and Ray for pointing it out to me). I'm going to try that out today, Carl, thanks! Smiley
  
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: Probably Stupid Question - Attach Spec in Repo
Reply #11 - Aug 7th, 2008 at 5:04pm
Print Post Print Post  
That worked out beautifully Carl, thanks for the help!  Smiley
  
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Probably Stupid Question - Attach Spec in Repo
Reply #12 - Aug 8th, 2008 at 1:51am
Print Post Print Post  
Acebanner wrote on Aug 7th, 2008 at 5:04pm:
That worked out beautifully Carl, thanks for the help!  Smiley

Glad it worked out for you. Smiley
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged