Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
XML Datasource
hallj05
<p>Hey,</p><p> </p><p>We are using an XML Datasource along with a JNDI Datasource. Sometimes the XML file that is being used by the XML Datasource will not exist, is there anyway to make it so that the report will still run if the XML file is missing?</p><p> </p><p>Since at the moment it gives a file not found error. The report works fine if the XML files are blank so the data from the XML files are not needed for the reports to run it just highlights certain parts depending on whats in the XML files.</p><p> </p><p>Thanks for any help!</p>
Find more posts tagged with
Comments
mwilliams
<p>Maybe you could check if the file exists in the beforeFactory method of the report and change the settings if the file doesn't exist before the report runs. Haven't tried it, just an idea.</p>
hallj05
<p>Actually I've discovered that the error isn't happening because the datasource can't find the xml file, it's when it gets to the dataset that uses the xml file.</p><p> </p><p>Is there anyway to make it so that the dataset will just be empty when the xml file can not be found?</p><p> </p><p>Since on this report we have three datasets. One uses the xml file, one is using a database, and the other combines the two using a left outer join so that it will still return data if the xml file is empty. So I'm thinking that I just need to find out a way to make it put the xml dataset as empty when the xml does not exist.</p><p> </p><p>Also this is using Birt 4.2.2</p>
mwilliams
<p>You could check the existence of the file in your beforeFactory method. If it doesn't exist, you could drop all of the elements from the report which would keep the dataSource from running. This would effectively stop the error since the file should never be accessed. Let me know.</p>