Solved

Scheduling a Crystal Report with Windows Scheduler/Task

Posted on 2011-02-28
7
600 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

25 Experts available now in Live!

Get 1:1 Help Now