Hi Bruno, this is not exactly the same topic but I would like to share some of my ideas for enhancements for the macro screen widget. Currently, in order to get an html and a csv version of a screen we have to create the two screen definitions (with different decorators) and setup entries in the controller like:
<view-map name="InventoryItemTotals" type="screen" page="component://product/widget/facility/FacilityScreens.xml#InventoryItemTotals"/> <view-map name="InventoryItemTotalsExport" type="screencsv" page="component://product/widget/facility/FacilityScreens.xml#InventoryItemTotalsExport" content-type="text/csv" encoding="none"/> The following improvements will make the rendering in different formats more dynamic: 1) in the controller, the two view-maps could be grouped into one where the content-type is dynamically retrieved from the request (then the view handler will use "screen" or "screencsv" etc based on the content type) 2) enhance the global decorator to render properly on different formats; if the decorator contains screens/forms widgets then the widget should render themselves in the proper format; if the decorator contains ftl templates, we will have to provide alternative ones like: <platform-specific> <html><html-template location="component://common/webcommon/includes/simple.ftl"/></html> <xsl-fo><html-template location="component://common/webcommon/includes/simple.fo.ftl"/></xsl-fo> <xml><html-template location="component://common/webcommon/includes/minimal-decorator.ftl"/></xml> </platform-specific> 3) in the search form we could add a drop down for the selection of the "content-type" At this point we may be able to export in different formats virtually any screen in OFBiz simply by adding a drop down box for the output format at the top of the screen (in a decorator): export to PDF, export to xml. Jacopo On Dec 4, 2010, at 12:22 AM, Bruno Busco wrote: > Hi, > I was thinking that having a CSV export feature embedded in the "list" form > widget could be nice. > > I mean a feature that, simply adding something like a " csv-export="true" " > attribute in the form widget, would show a link or an icon in the top form > pagination bar that would export the actual data listed in the form. > Does this make sense? > Any idea on how to implement this? > > Many thanks to everybody wants to share ideas on this. > > -Bruno