Page Index Toggle Pages: 1 [2]  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) CHANGING REPORTS ON THE FLY (Read 4169 times)
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: CHANGING REPORTS ON THE FLY
Reply #15 - Apr 8th, 2005 at 2:51pm
Print Post Print Post  
Louis,

If the programming wasn't "recognizing" sMonth, you would get compile errors. It may just not be getting set/retrieved properly, so the value is blank.

Try hardcoding it in the report and see if it appears.

For example, in the GLOBAL CODE for your report, instead of this:
stat sMonth as String
sMonth = @GlobalValue("ReportMonth")

... try this:
stat sMonth as String
sMonth = "This shows up!"
  

- 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: CHANGING REPORTS ON THE FLY
Reply #16 - Apr 11th, 2005 at 6:53pm
Print Post Print Post  
I was able to finally get this particular report to work.

I went through it from top to bottom and finally decided to copy the Global code from one of the other similar reports as follows:

stat sMonth as String

sMonth = @Globalvalue("Report Month")

I initially typed this manually, but it doesn't appear to be any different from our discussions above except for a capital on String which should not matter. 

Just figured out a new problem.  The reports default to the saved sort spec.

Is there a way to program the report to sort by one particluar field ?  I have been reading about Sort Arrays but can't figure out how this would apply here.

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: CHANGING REPORTS ON THE FLY
Reply #17 - Apr 11th, 2005 at 7:45pm
Print Post Print Post  
Quote:
I was able to finally get this particular report to work.

I went through it from top to bottom and finally decided to copy the Global code from one of the other similar reports as follows:

stat sMonth as String

sMonth = @Globalvalue("Report Month")

I initially typed this manually, but it doesn't appear to be any different from our discussions above except for a capital on String which should not matter. 


I see another difference. The original does not have a space between Report and Month. The one you typed above has a space. This would cause the behavior you described.

Quote:
Just figured out a new problem.  The reports default to the saved sort spec.

Is there a way to program the report to sort by one particluar field ?  I have been reading about Sort Arrays but can't figure out how this would apply here.


By what field would you need to sort? Do you need to sort by a different field depending on which month the report is for?
  

- 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: CHANGING REPORTS ON THE FLY
Reply #18 - Apr 11th, 2005 at 8:55pm
Print Post Print Post  
Funny part is I don't remember putting a space in the programming to begin with.  My eyes are going !

The sort would be based on a descending order on a commission field, the contents of which would change with each month.

Thanks for your help.

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: CHANGING REPORTS ON THE FLY
Reply #19 - Apr 12th, 2005 at 11:53am
Print Post Print Post  
Quote:
The sort would be based on a descending order on a commission field, the contents of which would change with each month.


Is there one commission field on your Form, or are there twelve?
  

- 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: CHANGING REPORTS ON THE FLY
Reply #20 - Apr 12th, 2005 at 12:26pm
Print Post Print Post  
There are 12.  One for each month with LE names of JANCOMM, FEBCOMM, ....................

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: CHANGING REPORTS ON THE FLY
Reply #21 - Apr 12th, 2005 at 1:00pm
Print Post Print Post  
Quote:
There are 12.  One for each month with LE names of JANCOMM, FEBCOMM, ....................


Louis,

You can do this the manual way, or the automated way.

The Manual Way
--------------------
Don't attach a Sort Spec to the Report. Without an attached sort spec, the report will use the records as they are currently sorted. The user can sort their result set as they want it before running the report. This method would be similar to what they would have done in Q&A, by typing 1AS into whichever field was appropriate at the moment.

The Automatic Way
------------------------
Create and save 12 different sort specs. Have the command button that runs the report look at which month was selected and use @LoadSortSpec and @SelectTreeItem to load and run the appropriate sort before running the report.
  

- 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: CHANGING REPORTS ON THE FLY
Reply #22 - Apr 13th, 2005 at 4:07pm
Print Post Print Post  
I will use the manual way for now until I can digest how to incorporate the LoadSortTree into my program at which point I will work through.

Thanks for all your help in getting me to this point.

The command buttons with the pop-up menu's are much more efficient than how we are/were printing these reports in Q & A.

Louis
  

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