SSRS: How to use XML document data source with parameters - reporting-services

I am trying to create an SSRS report that has an XML data source, but am stuck.
I have a URL that accepts a parameter (Below, parameter is named Id with value param1) and returns the following XML data:
https://site1/test/GetInfo/param1
or
https://site1/test/GetInfo?Id=param1
<Contract xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application">
<Id>param1</Id>
<City>Los Angeles</City>
<Country>USA</Country>
<Customer>Customer1</Customer>
<State>WA</State>
<Street>150 Main Street</Street>
<Zip>99999</Zip>
</Contract>
This isn't a web service per se since it simply accepts parameter/query at the URI, so I am believing this to be an XML document.
In SSRS 2016 Report Builder, I did the following:
In my report, I created a Datasource with ConnectionType = XML, and Connection string = https://site1/test/GetInfo
Created a dataset pointing to above data source, with Query type = Text, with the following:
<Query>
<Method Namespace="http://schemas.datacontract.org/2004/07/Dynamics.Ax.Application" Name="GetInfo">
<Parameters>
<Parameter Name="Id">
<DefaultValue>DefaultValue1</DefaultValue>
</Parameter>
</Parameters>
</Method>
</Query>
Upon clicking OK button to complete the dataset, I get the following error:
Could not create a list of fields for the query. Verify that you can connect to the data source and that your query syntax is correct.
Failed to execute web request for the specified URL.
Method Not Allowed: The remote server returned an error: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
<Error><Message>The requested resource does not support http method 'POST'.</Message></Error>
The Method name in the query maps to the actual method name in the class, and and the operation is a GET method.

It's been a while since I played w/ the XML Data Provider, but my recollection is that the XML Data Provider will do a POST with a SOAP payload for any URL that doesn't have a file extension of xml (for example, http://www.example.com/mywebservice). Parameters in this case are included in the SOAP request payload. Since you don't have a web service, then your server likely doesn't support the POST method on the HTTP request which is likely why you're getting the 405 Method not allowed error.
If you have an extension of xml in your url, then the XML Data Provider will do a GET request and include the parameters in the query string of the URL (for example, http://www.example.com/mywebservice/myfile.xml?name=Joe).
If you don't have a way to process these parameters on the server, then it may be easier to return the entire XML data and do a table filter.
Or if you have a Power BI Pro account, then you can create a Power BI Dataset from the XML data, create a Power BI Dataset Connection in RB, then filter the data in a DAX query in Power BI Report Builder (note that Power BI Dataset connections are only supported in Power BI Report Builder and Power BI Premium Capacities, not in SSRS or PBIRS).

Related

Can I import required QueryString parameters as QueryString parameters rather than Template Parameters in APIM?

We are generating an OpenApi definition using Swagger/Swashbuckle. This definition is then imported into Azure API Management.
We have some querystring parameters on get requests that we have marked as required. Our validation ensures the querystring parameters are present and valid, otherwise we return a 400 Bad Request with details of which parameters are invalid/missing. The relevant part of the OpenAPI definition is below. Two querystring parameters (marked as required) and one path parameter (marked as required).
My problem is the way the OpenApi definition is converted into APIM operations.
The required querystring parameters are added as template parameters and they are added to the operation url. This means if they are not provided, APIM cannot match the request to an operation and we return a 404 to the caller rather than the helpful 400 that the backend would return.
I can't add easily add empty values into the querystring. I can't do that in the inbound policy of the operation as it doesn't match the operation. Doing it in the global inbound policy would mean I had to identify the operation myself (this is just one of many). Similarly, while I can return a 400 bad request in the onerror policy, I can't easily tell the caller what was wrong with the request.
I think it's built into the import process. When I changed the template parameters to query parameters in the portal and exported, the OpenApi definition was practically identical. When I reimported the exported template, the same thing happened. I also tried going via Wadl which looked more promising but I couldn't reimport that template.
Is there any way to move template query string parameters to be query string parameters? Any other options?
At the moment (since 2018) there is the bug in Azure APIM API import. Link.
It's status under review. We tried to raise this directly to Microsoft, but there was no solution provided from their side.

JasperReports Server using REST with JSON request return PDF report

I want to export reports in PDF from my app (Writed in MEAN) sending data to fill the report through the request.
It is possible to call JasperReports Server REST with a JSON file as a DataSource returning PDF report as output?
I found some examples using external datasource as JSON, but not sending JSON in request.

Error when trying to pass a value to a parameter via a URL in SSRS

I have a report in SSRS that has a drill-down report. I would like to have the action linking to the drill-down report open it in a new page.
I've used this expression as the action URL:
="javascript:void(window.open('server?ItemPath=%2fTimisoara%2fDrilldown%2fDrill01&ID=123', '_blank'))"
When trying to access the drill-down report I get the following error:
The ID parameter is missing value
You're not constructing your URL properly. For starters the server bit should actually be the name of the server (or the IP address) and you need to properly construct the URL including the http://
You can then construct your URL like so:
http://reportserver/ReportServer?/Path/To/Report/DrillDownReport&Param1=Value1&Param2=Value2
I recommend reading the following MSDN pages:
URL Access (SSRS)
Pass a Report Parameter Within a URL

How i can use the wcf service in Visual Studio 2010 and fetch data from database in the json format?

I am confused. How can I use WCF with a database to show results in json format?
How i can use wcf service in Visual Studio 2010 and fetch data from the database and get the result in json format?
This is what WCF Web HTTP Services is for - making content available at non-SOAP endpoints. Here's a helpful writeup on how to write a simple service returning JSON, written by another SO user, #VisualStuart.
Of note is the endpoint configuration in the web.config, which specifies the data format to be returned:
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name=""
defaultOutgoingResponseFormat="Json"/>
</webHttpEndpoint>
</standardEndpoints>

Assistance with a simple WSO2 ESB project

I'm very very new to this and need some help writing an ESB script to take an event posted via HTTPS on Port 9090 in WSO2 and transform it into a message to be apended to an XML file on the server:
The HTTPS data will contain : “ID=Servername|Severity=sevtype” (Where Servername is a device name and Sevtype can either be "WARNING" or "OK" depending on whether the server is down or up)
This then needs to be transformed and appended to an existing XML file in the following format:
<event>
<componentID>Servername</componentID>
<timestamp>2012-04-27 01:37:10</timestamp> ***(Date and time the event was received)***
<severity>NORMAL</severity> ***(If original is WARNING then severity = SEVERE else it = NORMAL)***
<eti>NodeStatus</eti><etivalue>Up</etivalue> ***(If original is WARNING then severity = Down else it = Up)***
<\event>
Please could someone assist me i'm really floundering with what seems to be a simple thing
Many Many Thanks
Simon
You can write a simple task to poll your data into the server and can do a xslt transformation to construct that particular xml format message.
Some references to write a task;
http://wso2.org/project/esb/java/4.0.3/docs/configuration_language.html#TaskConcept
http://docs.wso2.org/wiki/display/ESB403/Writing+Tasks
http://wso2.org/library/2900
How do you get the ID and Severity? are they http headers?
Generally you can use payload factory mediator[1] to build the payload messages with some input parameter data.
[1] http://wso2.org/project/esb/java/4.0.3/docs/samples/message_mediation_samples.html#Sample17