Normal Topic Report Command Buttons in a Separate Form (Read 1080 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Report Command Buttons in a Separate Form
May 10th, 2005 at 1:25pm
Print Post Print Post  
I have two forms within my database:  one named Employee and the other named Reports.

Initially I had set up Report Command Buttons at the bottom of the Employee form and they function just fine (I should really set up tabs).

Then I decided to create a Reports form so that users do not have to scroll all the way down the Employee form to select a report. The other advantage is that the Employee form does not have to be open and there is a central location for the various reports.  This form has the exact same report command buttons and the same code as found in the Employee form.

When I run any of the reports in the Reports Form, it runs but includes every record within the database.  It appears that it is not recognizing the Load Retrieve/Sort Specs.

I have tried inserting the menu paths that I thought would work in the Load Retrieve/Sort Spec but when I do that the report doesn't even run. i.e.: vSpec = @LoadRetrieveSpec("Search Update Menu!Search Commands!Employee!PAYROLL COMPENSATION")

Is this feasible to load retrieve/sort specs into another form ? 

Code that works in the Employee Form is as follows:

var vMonth as String      
var vRun as Int
var vSpec as Int
var vTree as Int

//offer user choice of reports to print

//LOADS RETRIEVE SPEC

vSpec = @LoadRetrieveSpec("PAYROLL COMPENSATION")
vSpec = @LoadSortSpec("PAYROLL COMPENSATION")
vTree = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")

//popup is placed directly over Print Button

PopupSelectPosition(4, @XPos(PAYROLL COMP MTH),@YPos(PAYROLL COMP MTH))

vMonth = @Popupmenu("01-JAN;02-FEB;03-MAR;04-APR;05-MAY;06-JUN;07-JUL;08-AUG;09-SEP;10-OC
T;11-NOV;12-DEC", "Select A Month")

If @LEN(vMonth) = 0
{
     vMonth = "JAN"
}
Else
{
     vMonth = @Right(vMonth, 3)
}
GlobalValue("Report Month", vMonth)

vRun = @SelectTreeItem("Search Update Menu!Results Commands!Reports!Employee!Payroll Compensation - MTH (Preview)")


Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Report Command Buttons in a Separate Form
Reply #1 - May 10th, 2005 at 2:36pm
Print Post Print Post  
Louis,

You can't retrieve or sort by values that do not exist on your Form. Put the values that appear in your saved specs on your Report Form and make them invisible. Then, you can use them with your saved specs, but the user won't see them.

Also, this...
@LoadRetrieveSpec("Search Update Menu!Search Commands!Employee!PAYROLL COMPENSATION")
... can't work. The Load commands take the name of a saved spec, not a menu tree path. Also, a menu tree path cannot include anything that does not actually appear on a menu tree.
  

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


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Report Command Buttons in a Separate Form
Reply #2 - May 10th, 2005 at 9:51pm
Print Post Print Post  
Thanks for the info.

So, I copied the entire Employee form layout and called it Reports as I needed reference to all the fields.  I made all fields, text, etc. in the Reports form invisible except the Report Command buttons and actually moved this to the top of the Form.

Everything seems to work great !

However, I have a mental block though !  I updated some info on a test basis to see if Reports would spit out the new revised info and as you know, it does.

How is that so ?  I assumed that by copying a form to a new one, that it would only reference the info found in the new form.

Also, if you add or change specs, I noticed that you need to update in both forms.

I think eventually I will probably go the tab route.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Report Command Buttons in a Separate Form
Reply #3 - May 10th, 2005 at 9:59pm
Print Post Print Post  
Quote:
However, I have a mental block though !  I updated some info on a test basis to see if Reports would spit out the new revised info and as you know, it does.

How is that so ?  I assumed that by copying a form to a new one, that it would only reference the info found in the new form.


The two different Forms both display values from the same set of underlying database records.
  

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


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Report Command Buttons in a Separate Form
Reply #4 - May 11th, 2005 at 12:32pm
Print Post Print Post  
Is there anyway for it to recognize the same spec manager ?  I assume no.

I take it the typical example of where you would use this concept is say an invoice database i.e. Sesame Seasons sample.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Report Command Buttons in a Separate Form
Reply #5 - May 11th, 2005 at 1:18pm
Print Post Print Post  
Quote:
Is there anyway for it to recognize the same spec manager ?  I assume no.


No, specs are tied to a particular Form. Just for whatever it's worth, this allows you to use a Form to help create a "role" for the people meant to use it by providing them with only the specs that apply to them.
  

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