How to call a jasper report through REST_V2 service with a specification what dataSource from repository should be used? - rest

I have this scenario:
Created a jasper report and uploaded to JasperSoft Server:
"MyTestReport"
Uploaded report does not have a link to dataSource in JSS
In JasperSoft Server I have defined two datasources: AGD and AGL
I would like to call report through "rest_v2" service from database.
My URL to list resources looks like:
http://myserverurl:8081/jasperserver/rest_v2/resources
Q1: How to pass a correct datasource to this report?
http://myserverurl:8081/jasperserver/rest_v2/reports/reports/MyTestReport.pdf?j_username=jasperadmin&j_password=jasperadmin
Q2: Is there an option how to authenticate it in more secured way?

I don't think you can pass the datasource with the rest interface (but feel free to check that in the JasperReports-Server-Web-Services-Guide).
What I'd do is copy the report in Jasperserver and link one to datasource AGD and one to AGL. Then you can get your code to call the required report.
It's possible to integrate your application using single sign on so you don't have to pass the login on the url line (or I guess you could also use ssl)
This is covered in the jasperserver authentication cookbook which is available on the jaspersoft community site.

Related

"Client Error" message when trying to implement an Rest API View

I'm creating an API with Drupal to serve a angular application. The problem is, when I create the view with Rest export and try to access it (via browser or postman), it gaves me an "Client error" message (and nothing more).
I'm using drupal-8.7.6, running with PHP7.3, mysql and apache 2. But I've tried at nginx also and the error appeared again.
To reproduce it, just add some contents, enable the Restful web services, jsonm hal and create a view that exports rest data.
I expect to access the information via GET request (using browser, postman or any other way)
Go to your View
Go to Format
Click on Settings beside Serializer
Finally check Json option and save.
You are done :)
find out what was happening
I was not specificating the format of output, so Drupal was searching for an html to serve. To workaround this, just add to url: ?_format=json, for example, if my view route is "/articles", it will be: http://drupal.dev/articles?_format=json
Go to the rest exports view, click on format setting and click accepted request format to json.

How to: Get Report Definition using SSRS RESTful API?

I have been working with the RESTful SSRS endpoint documentation at https://app.swaggerhub.com/apis/microsoft-rs/SSRS/2.0 and It states that I can retrieve the Report defintiion for my reports, however I cannot find any of the endpoints to do such?
From Microsoft docs:
The REST API can also be used to provide more advanced functionality,
such as:
Navigate the folder hierarchy Discover the contents of a folder
Download a report definition
Modify default report parameters Change
or execute a refresh plan A whole lot more
The REST API is a RESTful successor to the legacy SOAP API.
Maybe I am missing something?
I am able to get the Parameter Definitions, the report by ID,
however passing in any parameters such as
https://{myreportserver}/reports/api/v2.0/reports({id})?paramter1=somevalue
does not return any definition. I am trying to get a definition return so maybe I can render the report on a web application (or at minimum provide a pdf download of the report?)
Late to the game, but in case anyone else is looking for this answer, use this URL:
https://{myreportserver}/reports/api/v2.0/reports({id})?Content/$value

How to get name of report used by different user in jasperserver

I am using jasper server enterprise version 7.0. Multiple users login to the server I can get the user name by using parameter - LoggedInUsername. But how can i get which report is used by the Logged in user. Is there any method to do so or is there any workaround for this?
Inside a report template (JRXML), you can get its own name calling $P{JASPER_REPORT}.getName():
And this is what you see when it's published to the server (6.4.2 in my case):
As you can see from the screenshot, the report file name and report name do not necessarily have to match.
For further details, see: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRParameter.html#JASPER_REPORT

Autocomplete testing on Azure Search explorer

I am trying to build and test the auto complete feature on a master item lookup tables using Azure Search (for a ASP MVC application). The search index was done with the suggesterName SG set to ItemDisplayName
I was looking to test it first on Azure portal- so that I could aim to replicate the results via code. This is because the results I am getting in code are quite unexpected
As I type the substring the itemDislayName, the expectation was that upto 5 selected names will be displayed
On the portal, I tried a query string of
search=str&suggesterName=SG
with the base request URL containing the index, api version and sugestorName-but I don't get results of items containing 'str' and with the fuzziness as below
Could you please guide around
[1] how I can get suggestor output in azure portal-search explorer
[2] can I control fuzziness using queryType and ~1,~2
I was referring to these 3 links
1) https://learn.microsoft.com/en-us/rest/api/searchservice/suggestions
and
2) https://channel9.msdn.com/Shows/Azure-Friday/Azure-Search-103-Azure-Search-Suggestions-with-Liam-Cavanagh
3) gunnarpeipman.com/2016/07/azure-search-suggesters/
Azure Search Portal doesn't support the Suggestion API yet. You will need to use an HTTP client like Fiddler or Postman.
Make sure you use the right URL for you Suggest requests:
https://[service name].search.windows.net/indexes/[index name]/docs/suggest
Please use our User Voice page to vote for adding the Suggest API to the Portal: https://feedback.azure.com/forums/263029-azure-search

Requesting Report with URL Parameters

My issue is exactly the same as Mr. John Ortega's described here.
However, both of the proposed solutions have not worked for me.
If I replace "Report.aspx" with "ReportViewer.aspx" in the Report Manager URL (ex: "http://servername/Reports/Pages/Report.aspx?ItemPath=%2fFolder+1+Name%2fFolder+2+Name%2fReport+Name"), I'm given a 404.
If I use the Web Service URL structure instead (ex: "http://servername/Reports?/Folder 1 Name/Folder 2 Name/Report Name"), I just get redirected back to the home page of my report server (which is "http://servername/Reports/Pages/Folder.aspx").
So I'm not really given an opportunity to pass report parameters via URL parameters, because the report itself won't come up.
If your requirement to jump to any other report in the same report server and directory, you can use “go to report” option instead of using “go to URL”.