Solved

Scheduling a Crystal Report with Windows Scheduler/Task

Posted on 2011-02-28
7
610 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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