Schedule SSRS task - sql

I want to schedule two reports, one report to be triggered on the last working day of the month. Another report to be triggered on the first workday of the each month. How can I do this?

There are currently no ways to do this through the standard subscription mechanism.
Your requirements are not only conflicting with the UI (the ReportServer website), but with the Reporting Services database design. You can take a look at the Schedules table to see what I mean.
There are 3 things you could do:
Fast & Risky, not recommended
Edit the generated SQL job (never tested and not supported), here you can specify weekdays.
Good approach but (very) long term
Submit a connect suggestion.
Recommended but needs development
Develop an application that consume the Reporting Services webservice and has a tailored subscription mechanism.
You could consider doing step 2 & 3.

a subscription on the first day of the month is pretty easy. Whether data driven or static the schedule you set up can be set to run on the first day of every month.
For the last day of every month, you'll need to create 3 subscriptions. One subscription for September, April, June and November (on calendar day(s) = 30), one for all the rest (on calendar day(s) = 31), and one for February alone (on calendar day(s) = 28).
Leap years.... you're on your own there...

Related

Changing Opening Hours without affecting historic data

I've been tasked to create a data visualisation dashboard that relies on me drilling into the existing database.
One report is 'revenue per available covers' - part of the calculation determining how many hours were booked against how many hours were available.
The problem is the 'hours available', currently this is stored in a schedule table that has a 1-1 link with the venue - and if admin want to update this there is a simple CRUD panel with the pre-linked field ready to complete.
I have realised that if I rely on this table at any point in the future when the schedule changes the calculations change for any historic data.
Any ideas on how to keep a 'historic' schedule with as minimum impact as possible to the database?
What you have is a (potentially) slowly-changing dimension. Basically, there are two approaches:
For each transactional record, include the hours that you are interested in.
Store the schedule with time frames, which capture the schedule at a particular point in time.
In SQL Server, I would normally go for the second option, using effDate and endDate columns to capture the period when the schedule is active.
I would suggest that you start with a deeper explanation of the concept, such as the Wikipedia page.

Youtrack time report coworker free hours per day

Does anybody knows how can I create a youtrack report which show how many free hours left for a user per days if a day is 8 work hours?
Partially this can be addressed by Time report, Per-user mode. You can create daily reports and check Spent time VS Estimation. Though it's not the best approach, but at least it's available at the moment.
We have this task for managing resources https://youtrack.jetbrains.com/issue/JT-29980 , please upvote.

BPMN 2.0 Repeat Activity on a Fixed Date

I have a question related on example:
We have an activity X which has to be executed every 10th day of the month and produce a report as output. How do I build a BPMN model to reflect this?
The answer here really depends on what BPM tool you are using and the defined capabilities of that tool. Generally, you would create a process with a timed start event such that the process only initiates every 10th day of the month. Then, activity X would execute, it builds a report, and finally outputs that report as the process output.
If a start event that can recognize the 10th day of the month is not available, I would create that same process, but instead give it a message start event. Then, I would create a separate process that runs daily. In this process, I would simply check if the current date is the 10th day of the month. If so, fire a message to kick off that first process. If not, end.

Financial App - Recurring

I'm making a financial app and I run into some problems with recurring money like fixed payment, salary, bank saving, ... I tried to add these payments on a certain day by comparing the current day and day of payments. The code is something like this:
If Date.Now.Day = GetPayDate(date) then
//code here //
It's in a start up event and it works but the problem is if users don't open the app on that day, the app will ignore and nothing will be added.
I'm using ADO.net with sql database. It's an app on local client without real time data.
In order to work correctly, users don't have to log on but the app must be run, so I tried to fix it by adding an auto start function on it. But it's not an option because users may not use computer for few days.
Is there any other way to resolve this problem? I just need some solutions or ideas about it, so even if users don't use the app in 2 or 3 months, it still calculate everything once they log on.
Sounds like you really need a windows service that runs on startup, or a scheduled task. A windows service is a type of C# / VB.Net application that's designed to run in the background, and has no UI. The Windows task scheduler can start a program on a regular basis.
For more info about windows services, see https://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.110%29.aspx. For more information on scheduled tasks, see http://www.7tutorials.com/task-scheduler. For a discussion about which is better, see Which is better to use for a recurring job: Service or Scheduled Task?
Or you could compare the current date to >= the pay date if you don't mind paying a few days late.

sharepoint 2010 - How to force expiration policy to run everyday for all items on a list

Have on prem SharePoint 2010, setup expiration policy to run every day that triggers a workflow to create tasks and emails based on an alert day in a calculated column in the list. Calculated columns have dates set to 7 days prior to a due date event. Want the expiration policy to evaluate the entire list each day to create notification emails and tasks to the users of the list.
I have been successful in getting the policy to run the workflow every day, but it starts randomly within the window specified. My assumptions: workflow will not run against an item on the list if the “Expiration Date” in less than 24 hours, I cannot modify that column directly, tightening the run window does not force all items to be evaluated every day. Solution needs be done using designer or sharepoint, not custom code.
Does anyone have a workaround to force all items to be evaluated by the “Expiration Policy” every day?
On another issue, how to you force evaluation for items created under 24 hours?
In SP 2010 there are two timer jobs responsible for this task: "Information management policy" job and "Expiration policy". This blog post may give you some more insight. There is also one more important thing: Information management policy should run before Expiration policy.