|
From: Roberto M. <rob...@gm...> - 2007-07-20 06:01:38
|
He Peter, I have committed the functionality to retrieve searches in XML. I modified the existing report servlet to handle this. So now if you navigate to: http://localhost:8080/lmas-addons-example/reportservlet?searchName=Search_1 you will get an XML representation of the search result (see attachment). I also removed the dynamic bean creation stuff an modified the pdf creation to use this XML as a data source. This makes authoring jasper templates in iReport even easier. You should use the actual XML file and setup a datasource. In the query window select XPath, and use "/searchResults/row" as the search expression. Form the XPath selection drag and drop to define your fields. I also updated the sample jasper templates in the full example project. The PDF functionality is still there and you can get a PDF of a report if you navigate to (this URL is also used form the meta data applet): http://localhost:8080/lmas-addons-example/reportservlet?reportName=Report_1 Please have a look and send me your comments. Regards, Roberto Peter Salomonsen wrote: > On Monday 16 July 2007 06:55:16 you wrote: > >> I have started working on implementing the feature. I have created a new >> servlet - XmlReportServelet. My idea is to be able to use the reporting >> template mechanism that we have, but load report templates in XSLT >> format. The results of a saved search would be represented in a fixed >> defined XML format, for e.g.: >> >> <searchResults latest="true"> >> <row> >> <column name="id" >1</column> >> <column name="airportName" >JFK</column> >> <column name="latitude" >- 44.98</column> >> <column name="longitude" >15.63</column> >> <column name="altitude" >128</column> >> <column name="windSpeed" >43</column> >> </row> >> <row> >> <column name="id" >2</column> >> <column name="airportName" >JFK</column> >> <column name="latitude" >- 44.98</column> >> <column name="longitude" >15.63</column> >> <column name="altitude" >128</column> >> <column name="windSpeed" >43</column> >> </row> >> </searchResults> >> > > This is a very good idea. Is this format compatible with the XML data source > that you have in iReport? Eventually could you change it so that it would be > compatible? > > >> The new servlet would apply the XSL transformation to this XML and >> return the result. It would receive the the template and search names >> (unique IDs) as URL params for e.g.: >> /xmlReport/Position.klm?template=Placemark&search=Vehicle1 >> > > XSL transformation is a good way of providing the kml. Actually I don't think > you should implement this part then. Providing the xml is enough, and let > external applications apply xsl templates for now. I think just providing the > stored search as xml is sufficient for now - and we'll make the decision > about also storing xml templates later. > > >> This would ultimately allow us to have URLs that generate HTML reports, >> RSS feeds etc. >> > > That is exactly what we want. > > Since we're now going for XMLDatasources would this eliminate the need for the > DynamicBean? I see a problem with this regarding datatypes. The DynamicBean > makes everything as strings, and this is e.g. a problem when sorting numbers > in the report. > > With the xml datasource we wouldn't any longer have to use the csv for > designing templates in iReport - right? > > Another thing - iReport has a possibility of viewing the report as Excel - > could we use the same mechanism to send an excel file rather than pdf? > > regards, > > Peter > > > |