Normal Topic @LoadRetrieveSpec (Read 859 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
@LoadRetrieveSpec
Apr 19th, 2005 at 7:36pm
Print Post Print Post  
I have a report command button that has a pop up menu built into it and works fine.  I have added two lines of programming to load a retrieve spec and have made an error in the programming.

Programming as follows:

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

//offer user choice of reports to print


vSpec = @LoadRetrieveSpec("Payroll Compensation")

vRun = @SelectTreeItem("Search Update Menu!Results Commands!Open Spec Manager!Retrieve!Employee!Payroll Compensation")

//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)")


Does my programming dealing with the @LoadRetrieveSpec make sense ?

I am trying to evetually incorporate this into my other report command buttons.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @LoadRetrieveSpec
Reply #1 - Apr 19th, 2005 at 9:32pm
Print Post Print Post  
I was able to work thru this and get the programming to work 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)")


I will try applying this to my other command buttons.

Any ideas on how to incorporate into a command button that lists multiple reports with different load/sort specs ?

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @LoadRetrieveSpec
Reply #2 - Apr 20th, 2005 at 2:17pm
Print Post Print Post  
I was further able to incorporate @LoadSortSpec into a report that required the sort to be selected based on the month of selection as follows:

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

//offer user choice of reports to print

//popup is placed directly over Print Button

PopupSelectPosition(4, @XPos(MKT PERF MTH), @YPos(MKT PERF 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)

//LOADS RETRIEVE SPEC

vSort = "01-JAN;02-FEB;03-MAR;04-APR;05-MAY;06-JUN;07-JUL;08-AUG;09-SEP;10-OCT;11-NOV;12
-DEC"


If @LEN(vSort) = 0
{
     vSort = "JAN"
}
Else
{
     vSort = @Right(vSort, 3)
}

vSpec = @LoadRetrieveSpec("QUOTA PERFORMANCE - MKT - MTH")
vSort = @LoadSortSpec("QUOTA PERFORMANCE - MKT - MTH - "+ vMonth)
vTree = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)")


vRun = @SelectTreeItem("Search Update Menu!Results Commands!Reports!Employee!Quota Performance - MKT - MTH (Preview)")


However, I am stumped on how to incorporate the @LoadRetrieve and Sort Spec into a command button that lists multiple reports and each report has a different sort spec.  For the most part, the name of the report typically coincides with the name of the Retrieve and Sort Specs.

I will continue on at this point.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged