jason.symons Posted February 1, 2017 Posted February 1, 2017 Hi All,I have been trying to use an XML file in the repository as a datasource for a domain without success. Can anyone tell me where I am going wrong, please!I have been looking at this: http://community.jaspersoft.com/documentation/tibco-jasperreports-server-administration-guide/v610/file-data-sources and this: The examples in the links are JSON but as far as I can tell I should be able to do it with an XML file too. I have also successfully got a remote XML working as a datasource, but when I try to place to file in the repository it won't work.These are the steps I am following:1. I upload an xml file to the repository (Add resource>file>xml) as 'note' (I was using this as an example: http://www.w3schools.com/xml/note.xml)2. Create a new datasource (Add resource>Data Source) called NoteDS3. Choose Remote XML Data Source under type (this is the only XML type available - should there be another one?)4. In the file URL as follows: repo:/organizations/organization_1/Data_Sources/note5. Query: /note6. Create domain with Note DS as Data SourceAt this point I get an error: Failed to parse the xml document. As mentioned the exact same query works with the datasource on the web, just not when I load it into the reposotory.Should this work? What am I missing?Thanks in advanceJason
elizam Posted February 1, 2017 Posted February 1, 2017 If it says remote, I would believe that it has to be remote. Looking at the doc, I see it implies that you can upload all file types, but I wonder if that is actually some imprecision around which file types it's possible with. I'll try to look into it further.
jason.symons Posted February 1, 2017 Author Posted February 1, 2017 Yep, i guess it could be that only remote xml is allowed. I just thought that the documtation i mentioned above seemed to imply that a repository xml would work in the same way as a JSON. For example, this quote: "In the Type field, select a file data source that you enabled, for example JSON Data Source or XML Data Source. In this example, we create a JSON data source." So maybe its not possible, but would appreciate any knowledge anyone has. Thanks
gthompso Posted February 1, 2017 Posted February 1, 2017 Looks like you have to enable JSON Data Source as a type. To do that, you will need to edit the applicationContext-remote-services.xml file on the server. The "To enable file data sources in the UI" instructions on the Admin Guide page that you linked to in your question tells you how to edit the file to enable the JSON Data Source type. Basically, under <util:set id="customDataSourcesToHide"> in that file, you will need to edit the jsonDataSource value to make it look like "<!-- value>jsonDataSource</value -->" (without the quotation marks). Hope this helps.
elizam Posted February 1, 2017 Posted February 1, 2017 After further investigation, it seems that you cannot put an XML data source in the repo, it can only be remote.
jason.symons Posted February 2, 2017 Author Posted February 2, 2017 OK, thanks for looking into it. The data I have is in XML, but I could convert to JSON or possibly place the data somewhere remote - it just adds steps to my process at this point.Jason
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now