Solved

Scheduling a Crystal Report with Windows Scheduler/Task

Posted on 2011-02-28
7
598 Views
Last Modified: 2012-05-11
Good morning.  I had a quick question, which I am not sure if it is possible.  I have a crystal report that I want to run via windows scheduled tasks.  However, I want this to report on the Previous Busines day.  For example, if today is a Tuesday, I want it to report on Mondays data. If today is Monday, I want it to report on Fridays Data.

I want to throw this into a windows task and just let it run each day.  What Im guessing is that I can use some formula in the crystla report to select the previous business day but I am not sure how to do it.  Any help would be appreciated.
0
Comment
Question by:nm67304
7 Comments
 
LVL 77

Assisted Solution

by:peter57r
peter57r earned 250 total points
ID: 34996754
Just working on a fixed monday to friday week then you could use a record selection rule of..

numbervar dw:=dayofweek(currentdate);
datevar testdate:=currentdate-1;
if dw = 2 then testdate:=testdate-2; //prev friday
{table.datefield} = testdate

If course if you have other non-working days except weekends then your formula would have to be extended to deal with those as well.

But, if you have a lot of data then this will probably be slow because the selection rule cannot be pased to the database server, so all records will be returned to CR which will then do the selection.
If there is a lot of data, then it might be worth building a query in the database to return fewer records, or using a SQL command as the report data source instead of a table.   (If you have less than say 5000 records it is probably not worth the effort.)


You could use a command something like...

Select * from table where datefield > <currentdate> - 4

in this case <currentdate> needs to be expressed in the SQL of your database to give you the current date.

This would eliminate all records from over 4 days ago from the database 'fetch' process and CR can then deal with its own records selection rule tfor the final selection.





0
 

Author Comment

by:nm67304
ID: 35006325
Peter57r, thanks for your help.
The next portion of this would be to have a Windows Task set up to export the data from crystal.  We now have crystal reports pulling data from previous day excluding weeknds.  However, I need to figure out how to run this report and export it via windows scheduler.  This is probably done via vb script.
Any ideas?
0
 
LVL 77

Expert Comment

by:peter57r
ID: 35007161
Sorry; can't help with that.  Opening the report might be straightforward but I suspect that automating the export will involve quite a lot of work.

I suggest you post a new question so that it is looked at by everyone.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 22

Accepted Solution

by:
Ido Millet earned 250 total points
ID: 35044211
See list of 3rd-part Crystal Reports scheduler at http://www.kenhamady.com/bookmarks.html
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35321857
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0
 
LVL 18

Expert Comment

by:vasto
ID: 36285099
Ken Hamady has an article about schedulers here:
http://kenhamady.com/cru/comparisons/desktop-scheduling-engines
Feature matrix pdf is available from this link :
http://kenhamady.com/desktopscheduler2011.pdf
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now