?
Solved

Scheduling a Crystal Report with Windows Scheduler/Task

Posted on 2011-02-28
7
Medium Priority
?
633 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 1000 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
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 23

Accepted Solution

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

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

777 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