Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow Reports To Be Scheduled "Now" or "Once" But Not Repeti 1

Status
Not open for further replies.

horatiog

Technical User
Oct 31, 2000
40
GB
Hi,

We are running CE 8.5, soon to move to CE 10. For the record we report off a variety of System & File DSNs.

I have been writing a guide for our users on how they can schedule reports to be delivered to them by email in PDF or native RPT format.

However, the powers that be (i.e. my boss!) is concerned that our valued clients (ahem!) might decide that, rather than schedule the report as "Now" or "Once", might decide that they would like to run their reports (some of which are very large and take some time to run) every hour or similar. If more than one or two of them decided to do this, we believe it would bring our server (Single machine / single processor - we're stuck with this for the time being) to its knees.

What we would like to do, is to be able to allow the user to schedule reports but only do this on a "Once" or "Now" basis and remove their rights to run it on any repetitive schedule (e.g. Hourly, Daily, etc.)

I've had a look through the CE help, and in the posts on this forum, but cannot find a way to do this. Is there any way to do it on 8.5? If not, is there any way to do it at CE10?

Many thanks for any help proferred.

Regards,
Harry.
 
You can do it in either version, but it will require that you rewrite the CSP script for the schedule.csp page.

Change it to only reflect the Now and Once options.

-k
 
This is a fairly simple edit in CE9.

Open schedule.csp (and make a backup copy).

Search for the string L_HOURLY. This is a Localization variable that is set to the value "Hourly". L_DAILY comes right after it. Don't touch these lines but search for the next occurrences.

Comment out the line that reads "Response.Write("<option value='1'>"+L_HOURLY);" by placing two slashes (//) in front of it. Do the same for "//Response.Write("<option value='2'>"+L_DAILY);"

Save the file. Those options will simply not appear on the drop list of user choices.
 
Hi,

Thanks for that Synapse & MDwyer - that's a great. I am not a CSP programmer myself but I think I can handle that ;-)

However, there are occaisions when we ("administrator") want to set up a repetitive job. Is there some system variable, e.g. $LOGNAME, that could be referenced and then use this to make these options conditional? Or create two schedule.csp scripts and then call one or the other from the parent script, depending on who is trying to schedule?

Any further help would be much appreciated.

Regards,
Harry.
 
Hello All,

After a little help from one of my colleagues with some CSP knowledge, we managed to solve this for ourselves. In case anyone is interested, the solution is as follows:

Response.Write("<option value='-1'>"+L_NOW);
Response.Write("<option value='0'>"+L_ONCE);
if (iStore.EnterpriseSession.UserInfo.UserId == 12)
{ Response.Write("<option value='1'>"+L_HOURLY);
Response.Write("<option value='2'>"+L_DAILY);
Response.Write("<option value='3'>"+L_WEEKLY);
Response.Write("<option value='4'>"+L_MONTHLY);
Response.Write("<option value='5'>"+L_NTHDAY);
Response.Write("<option value='6'>"+L_1STMON);
Response.Write("<option value='7'>"+L_LASTDAY);
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top