How to use ReportService1.svc/GenerateReport

  • 1
  • Question
  • Updated 4 years ago
I'm trying to generate a report for a specific client and project, which works fine using the interactive menu, but the GenerateReport service isn't working. Specifically, I'm trying to use it through the services/help page. I don't know what to put in filterValues[0], [1], etc. to match the interactive filter menu. I've tried everything I can think of, but I always get a NullReferenceException error. The reportUri and outputFOrmatUri fields are set using the drop down list, which should mean those values are correct. What am I supposed to put in the other fields? I've tried pasting in the URI of a client and project in the reportFilterUri fields as well as the string values of the client and project names, but neither method works.

(Originally posted by bandtank)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes

Posted 4 years ago

  • 1
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Hi bandtank, I assuming you have the outputFormatUri and reportUri from the drop down menu within the GenerateReport call. To pass filters on these reports, you would need reportFilterUri and its corresponding value 1. for filterValues[x].reportFilterUri, this can be got by passing the reportUri to ReportService1.svc/GetReportDetails2 2. The values for these filters to be populated in filterValues[x].value can be got from ReportService1.svc/GetAllFilterValueDetailsForFilter. This service would return IDs for project,clients, users etc. You would then need to match the names to these IDs by either using your previously extracted data, or by matching against ProjectService1.svc/GetAllProjects or ClientService1.svc/GetAllClients etc.

(Originally posted by Saurabh Verma)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Well, that helped some, but I'm getting empty payloads. reportUri: outputFormatUri: For the filter, I picked 'Client Filter'. From GetReportDetails2, the URI is listed under "filterConfiguration" -> "enabledFilters" -> "ClientFilter" reportFilterUri: urn:replicon-tenant:-pg1:report-filter:;clientfilter The value is listed in GetAllClients by looking at the end of the URI (urn:repli...:client:2). The confusing part is how to use the 2. Is that the value that I should put here? filterValues[x].value: 2 Or do I need to look for '"value": 2' in the output of GetAllFilterValueDetailsForFilter and then use the index of the JSON array? For example, array index number 75 has a value of '"value" : 2', which matches the URI for the client I chose. Do I use 2 or 75? Either way, the result is '"payload" = "NoData\r\n"' (this is with CSV output, but the payload is empty with all other output formats as well). From the GUI report interface, I can turn off all filters except client and enter the same client ("2") in the "Name" field. The result is the expected set of reports. What's wrong?

(Originally posted by bandtank)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
, so that we can look at this report directly.The acceptable values for filterValues[x].value are the ones displayed in GetAllFilterValueDetailsForFilter.

(Originally posted by Saurabh Verma)
Photo of Archived Post

Archived Post, Official Rep

  • 2132 Posts
  • 6 Reply Likes
Here's what worked for me. The instructions were somewhat unclear, but I thought I had tried this exact thing last night. To filter based on project number: 1) Go to: https://na2.replicon.com//services/Re... 2) Select from the drop down for reportUri. 3) Add a filter by clicking the + next to filterValues[0]. 4) Go to: https://na2.replicon.com//services/Re... 5) Paste the value from step 2 in the reportUri field. 6) Copy the URI from “filterConfiguration” -> “enabledFilters” -> “ProjectFilter” into the GenerateReport field called reportFilterUri. 7) Go to: https://na2.replicon.com//services/Pr... 8) Search the results for to find the project number, which is , e.g. 488. 9) Going back to the Generate Report service, put 488 in filterValues[0].value. 10) For outputFormatUri, select CSV from the drop down. 11) Hit submit To add other filters, repeat steps 3 through 9 using the appropriate services.

(Originally posted by bandtank)