This is a migrated thread and some comments may be shown as answers.

Date Parameters Not Updating For Scheduled Reports

9 Answers 390 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
OfficialCommunity
Top achievements
Rank 1
OfficialCommunity asked on 05 Dec 2018, 05:16 PM

Hello,

  We have a number of reports configured to show sales data from last week, last month, last quarter, etc. The date parameters all work off of a CurrentDate = Now() expression, and extrapolate from there for the different time periods required (AddDays, AddMonths, etc). All of these work perfectly when used on-demand. However, if I set up a subscription/scheduled report, the date parameters don't seem to get refreshed. I made sure that the CurrentDate parameter was ordered as the first parameter to be run, but that didn't seem to make a difference. The report runs on the scheduled date and time, but the data that it's returning is not relevant.  Is there any way to make sure that those date parameters get refreshed before the scheduled report runs?

Thanks

Travis

9 Answers, 1 is accepted

Sort by
0
OfficialCommunity
Top achievements
Rank 1
answered on 05 Dec 2018, 05:17 PM
I should also mention that all parameters are configured to AutoRefresh = True as well.
0
Todor
Telerik team
answered on 10 Dec 2018, 11:50 AM
Hi Travis,

I tested the described scenario with a simple report (attached - DateTimeNow.trdp) displaying the values of two report parameters, the first one (CurrentDate) with value "=Now()", the second (PastMonth) with value depending of the first parameter "= AddMonths(Parameters.CurrentDate.Value, -1)".
I uploaded the report in the report server and scheduled a task to send the report daily. The report was rendered with the correct Date values - both when send as scheduled, and when run from the "Execute" button of the Report Server Manager.

The report parameters are evaluated early in the report processing stage - check Report Life Cycle. The value of the parameter will be set according to its assigned Expression. The Now() function will get the current Date/Time, hence on each execution the CurrentDate parameter should have a fresh value.

In scheduled tasks we do not use caching, hence I exclude also this possibility.

If the problem persists consider opening a support ticket where to attach a sample runnable report reproducing the issue so that we may investigate locally.

Regards,
Todor
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
OfficialCommunity
Top achievements
Rank 1
answered on 11 Dec 2018, 06:33 PM

Thank you Todor for your reply. Respectfully, your example doesn't encompass our issue.  Your PastMonth parameter is going to be correct because nothing has changed.  If you were to use a Yesterday expression, or LastWeek, you may see our issue. Or, you'd have to wait until the current month has changed, and then look at the values being returned in the scheduled report. 

For the time being, we have amended our SQL query to calculate the specific date ranges needed for our reports. I will create a sample report and upload to a support ticket for further investigation.

 

0
Nagendra Kumar
Top achievements
Rank 1
answered on 25 Feb 2021, 05:04 AM
I Have two Challenges
1) In Report server I should able to create a Record with one of special character which is not happening
2)For Monthly And Yearly schedules BYSETPOS in UI not getting selected when value has been posted using Telerik CreateSchdule API
0
Nagendra Kumar
Top achievements
Rank 1
answered on 25 Feb 2021, 05:05 AM
I Have two Challenges
1) In Report server Under Categories-I should able to create a Record with one of the special character which is not happening
2)For Monthly And Yearly schedules BYSETPOS in UI not getting selected when value has been posted using Telerik CreateSchdule API
0
Todor
Telerik team
answered on 01 Mar 2021, 12:30 PM

Hello Nagendra Kumar,

I'm afraid the described challenges are not very clear. Can you specify which is the special character that you would like to use and that doesn't seem to appear?

Regarding the Report Server Web API, you may see the Scheduled Tasks management endpoint in the linked article. Can you elaborate on what you expect to be updated when using the Web API, but doesn't actually get updated?

Regards,
Todor
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Nagendra Kumar
Top achievements
Rank 1
answered on 02 Mar 2021, 03:31 AM

Hi Todor,

The Report Server Ui is some what acurate on populating the  Recurrence Rule, which

actually helped me to correct the way on how  I am preparing  and sending the recurrenceRule from

API where I had a deviation in understading. I am sorry, as my mail and screen shots are at high level and towards at level

my undersanding as I analysed the Requriements on Mapping recurrence rule of report server  based on the parameter scopes given by and at my level of experience which I am able to rectify now.

 

 

Thanks a lot for your reply

I am looking towards the Report Document Formats now.

 

 

0
Nagendra Kumar
Top achievements
Rank 1
answered on 22 Mar 2021, 09:17 AM

Hi Todor,

The BYSETPOS value is not getting populated IN Report Server UI for both monthly and yearly scenarios using  Telerik Report Server Create Schdule API-  
    POST api/reportserver/v2/scheduledtasks - REST API Documentation | Telerik Report Server

Details in Steps-
1)A Schdule Record is being created & saved using  Report Server Create Schdule    API mentioning specific Week-Name (out of SU,MO,TU,WE,TH,FR,SA) FOR THE RepeatON -  Nth Week Position option
 
After that , if we view the same In The Telerik Report Server's -  UI, it is showing Repeat-on- Nth Week Position(SETBYPOS) as Empty, 

Making a Get Request with the Below API showing the JSON as below with Recurrence Details- 
http://XXXXX/api/reportserver/v2/scheduledtasks
  {
        "Id": "238b61c4387",
        "UserId": "c215f70d019642a9a162a1bbc9d5e2d8",
        "Name": "This is for Product Sales",
        "Enabled": true,
        "Reports": [
            {
                "ReportId": "3c5b96c0355",
                "DocumentFormat": "XLS",
                "Parameters": {}
            }
        ],
        "StartDate": "2021-03-22T01:33:00",
        "RecurrenceRule": "FREQ=MONTHLY;INTERVAL=2;BYDAY=WE;BYSETPOS=3;WKST=SU",
        "LocalUsersMailTemplate": {
            "Subject": null,
            "Body": null
        },
        "ExternalUsersMailTemplate": {
            "Subject": null,
            "Body": null
        },
        "ExternalEmails": [
            "nbattiprolu@osidigital.com"
        ],
        "SubscriberIds": []
    }

Later, to cross verify the change has been explictly   imposed  by editing in Report Server UI with the desired value(BYSETPOS=3) & saved the same from Report Server UI.

The UI is retaining the imposed change with the desired value 

Making a Get Request again with the Below API showing the JSON with Recurrence Details- 
http://XXXXX/api/reportserver/v2/scheduledtasks

Result:-
 {
        "Id": "238b61c4387",
        "UserId": "c215f70d019642a9a162a1bbc9d5e2d8",
        "Name": "This is for Product Sales",
        "Enabled": true,
        "Reports": [
            {
                "ReportId": "3c5b96c0355",
                "DocumentFormat": "XLS",
                "Parameters": {}
            }
        ],
        "StartDate": "2021-03-22T01:33:00",
        "RecurrenceRule": "FREQ=MONTHLY;INTERVAL=2;BYDAY=WE;BYSETPOS=3;WKST=SU",
        "LocalUsersMailTemplate": {
            "Subject": null,
            "Body": null
        },
        "ExternalUsersMailTemplate": {
            "Subject": null,
            "Body": null
        },
        "ExternalEmails": [
            "nbattiprolu@osidigital.com"
        ],
        "SubscriberIds": []
    },

Compared  the BOTH result JSON &  the both files ARE IDENTICAL

Not sure why The UI is not showing the details properly when we saved the Record using API but showing properly using Report  server UI. 
Please share if any infomation available on the same, or its an issue
0
Todor
Telerik team
answered on 25 Mar 2021, 08:52 AM

Hi Nagendra Kumar,

Thank you for sharing your findings with us. I confirm that I managed to reproduce the problem locally. I have logged it as a new bug report and voted on your behalf - When you create a Scheduled Task with the Report Server API, the day of the week in the recurrence rule is not shown by the Report Server Manager. As a token of gratitude, we have updated your Telerik points.

Regards,
Todor
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions
Asked by
OfficialCommunity
Top achievements
Rank 1
Answers by
OfficialCommunity
Top achievements
Rank 1
Todor
Telerik team
Nagendra Kumar
Top achievements
Rank 1
Share this question
or