What is the correct way to pass parameter "DateRangeFilter" in GenerateReport Service?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I want to get a report by Services. For that I am using "ReportService1" service and "GenerateReport" Operation.

But I am finding very hard To Guess how to set "filterValues" array properties.

I want to use this 3 types of filters types:

-DateRangeFilter
-ApprovalStatusFilter
-ProjectFilter

Can someone give me some examples how to pass this parameters to the service?
Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes

Posted 2 years ago

  • 1
Photo of Aashnee Kamboj

Aashnee Kamboj, Community Moderator

  • 1598 Posts
  • 109 Reply Likes
Hi Jo,

Thank you for using the Replicon Community!

May we please request you to go through the following link:

https://community.replicon.com/replicon/topics/daterangefilter-submitting-through-reportservice1-svc

Please do let me know in case of any further concerns.

Thanks,
Aashnee
Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes
OK, I understand That I need to insert 3 instances of date range filter...
Anyway the service Continue not giving me the right response.

1o scenario




2o scenario




If I want to pass 2 concrete dates (begining and end dates), whats is the right format I should use to put in parameters? where I can find this knowledge???

The same apply to the "ApprovalStatusFilter" that I not try to felled yet!
Photo of Karthik

Karthik, Product Support Engineer

  • 1 Post
  • 1 Reply Like
Hi Jo,

Can you try the below steps and let us know if you need more assistance from our end.

1. Navigate to "ReportService1.svc" >> "GetAllReports"2. From the List, choose the Report Uri for which you want to "GenerateReport".
3. Now with the Report Uri, Navigate to "ReportService1.svc" >> "GetReportDetails2"
4. ReportDetails2 Output have the Filters used in the Report. (Note: Enabled Filters are all the Filters in the Report)
5. In your case, the choice is date range Filter.
6. From the screenshots above, we noticed "Lastweek" mentioned for the Value which is not required.
7. You can leave the Value for the First Filter blank.
8. Now for the second and third Filters you can assign values accordingly as per the requirement of start and end date.
9. For the Timesheet approval status choose the Uri from  the "GetReportDetails2" and provide the Value accordingly ("Approved","Rejected","Open","Waiting")

Thanks,
Karthik Santhosh
Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes
Hi Karthik,
I did pretty much what you suggest before, but everytime I use DateRangeFilter the service return me "Index was outside the bounds of the array." Error.
Can you give me an example of a well formatted value for DateRangeFilter if i want to put a specific date on it?
Photo of Isaiah Madem

Isaiah Madem, Community Moderator

  • 28 Posts
  • 5 Reply Likes
Hi Jo, 

I would like to confirm if you have the below values on your web services when using the date range filter.

1) First Filter Value: Blank
2) 2 & 3 Filter Value Date format: DD/MM/YY

 

May I request you to share a screenshot of the Values and the error message if the above does not answer your question.

Thanks and Regards,

Isaiah Madem
Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes
Bellow the screen of the error and the parameters inputs. Keep in mind I try just with the 3 date Range filters and the result was the same.

Kind regards.

Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes
OK, I understand That I need to insert 3 instances of date range filter...
Anyway the service Continue not giving me the right response.

1o scenario




2o scenario




If I want to pass 2 concrete dates (begining and end dates), whats is the right format I should use to put on parametes? where I can find this knowledge???

The same apply to the "ApprovalStatusFilter" that I not try to felled yet!
Photo of Isaiah Madem

Isaiah Madem, Community Moderator

  • 28 Posts
  • 5 Reply Likes
Hi Jo, 

Thank you for the screenshots. 

I have requested one of my Subject matter experts to assist us in this query. Could you please suggest a good time to reach you to further discuss this over a phone call. 

Regards,

Isaiah Madem
Photo of Neves, Jo

Neves, Jo

  • 6 Posts
  • 0 Reply Likes
Hi, I am available for a call since 9:30am to 18:00pm (London time) everyday of week.

Thank you,
Kind regards,
João Neves.
Photo of Isaiah Madem

Isaiah Madem, Community Moderator

  • 28 Posts
  • 5 Reply Likes
Hi Jo, 

Further to our discussion over the phone conversation I have  drafted the steps below to generate the report.

To generate report using the daterangefilter through webservices please follow the steps below:

1. From the services help page, navigate to "ReportService1" and select "GenerateReport"
2. Select the report name from the "reportUri" dropdown

To use thedaterangefilter follow the below steps:

1. For using the Date Range Filter, you have to pass 4 daterangefilter objects.
2. Value of filterValues[0] will be set as "Blank"
3. Value of filterValues[1] will be "Start Date value (mm/dd/yyyy)"
4. Value of filterValues[2] will be the "End Date value (mm/dd/yyyy)"
5. Value of filterValues[3] will have the value “Filter by Expenses” field, that you get to see in the UI. The two valid values are “ExpenseEntry” (for Expense Incurred Date) and “ExpenseSheet” (for Expense Sheet Date).
6. Specify the outputFormatUri for filterValues[4] by selecting from the dropdown
7. Click on Submit to generate the report.

To get the "reportFilterUri" which is "DateRangeFilter" follow the steps below

1. From the "ReportService1" help page select "GetReportDetails2" service
2. Select the Report name from the dropdown and click on Submit
3. Click on JSON and search for "DateRangeFilter" and copy the "uri"

Thanks and Regards,

Isaiah Madem
(Edited)