Java Doc for JasperReportsMultiFormatView.java in  » J2EE » spring-framework-2.0.6 » org » springframework » web » servlet » view » jasperreports » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.web.servlet.view.jasperreports 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
   org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView

JasperReportsMultiFormatView
public class JasperReportsMultiFormatView extends AbstractJasperReportsView (Code)
Jasper Reports view class that allows for the actual rendering format to be specified at runtime using a parameter contained in the model.

This view works on the concept of a format key and a mapping key. The format key is used to pass the mapping key from your Controller to Spring through as part of the model and the mapping key is used to map a logical format to an actual JasperReports view class. For example you might add the following code to your Controller:

 Map model = new HashMap();
 model.put("format", "pdf");
Here format is the format key and pdf is the mapping key. When rendering a report, this class looks for a model parameter under the format key, which by default is format. It then uses the value of this parameter to lookup the actual View class to use. The default mappings for this lookup are:

  • csv - JasperReportsCsvView
  • html - JasperReportsHtmlView
  • pdf - JasperReportsPdfView
  • xls - JasperReportsXlsView

The format key can be changed using the formatKey property and the mapping key to view class mappings can be changed using the formatMappings property.
author:
   Rob Harrop
author:
   Juergen Hoeller
since:
   1.1.5
See Also:   JasperReportsMultiFormatView.setFormatKey
See Also:   JasperReportsMultiFormatView.setFormatMappings



Field Summary
final public static  StringDEFAULT_FORMAT_KEY
    

Constructor Summary
public  JasperReportsMultiFormatView()
     Creates a new JasperReportsMultiFormatView instance with a default set of mappings.

Method Summary
public  PropertiesgetContentDispositionMappings()
     Return the mappings of Content-Disposition header values to mapping keys.
protected  voidrenderReport(JasperPrint populatedReport, Map model, HttpServletResponse response)
     Locates the format key in the model using the configured discriminator key and uses this key to lookup the appropriate view class from the mappings.
public  voidsetContentDispositionMappings(Properties mappings)
     Set the mappings of Content-Disposition header values to mapping keys.
public  voidsetFormatKey(String formatKey)
     Set the key of the model parameter that holds the format discriminator.
public  voidsetFormatMappings(Properties mappingsWithClassNames)
     Set the mappings of format discriminators to view class names.

Field Detail
DEFAULT_FORMAT_KEY
final public static String DEFAULT_FORMAT_KEY(Code)
Default value used for format key: "format"




Constructor Detail
JasperReportsMultiFormatView
public JasperReportsMultiFormatView()(Code)
Creates a new JasperReportsMultiFormatView instance with a default set of mappings.




Method Detail
getContentDispositionMappings
public Properties getContentDispositionMappings()(Code)
Return the mappings of Content-Disposition header values to mapping keys. Mainly available for configuration through property paths that specify individual keys.



renderReport
protected void renderReport(JasperPrint populatedReport, Map model, HttpServletResponse response) throws Exception(Code)
Locates the format key in the model using the configured discriminator key and uses this key to lookup the appropriate view class from the mappings. The rendering of the report is then delegated to an instance of that view class.



setContentDispositionMappings
public void setContentDispositionMappings(Properties mappings)(Code)
Set the mappings of Content-Disposition header values to mapping keys. If specified, Spring will look at these mappings to determine the value of the Content-Disposition header for a given format mapping.



setFormatKey
public void setFormatKey(String formatKey)(Code)
Set the key of the model parameter that holds the format discriminator. Default is "format".



setFormatMappings
public void setFormatMappings(Properties mappingsWithClassNames)(Code)
Set the mappings of format discriminators to view class names. The default mappings are:

  • csv - JasperReportsCsvView
  • html - JasperReportsHtmlView
  • pdf - JasperReportsPdfView
  • xls - JasperReportsXlsView



Fields inherited from org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
final protected static String CONTENT_DISPOSITION_INLINE(Code)(Java Doc)
final protected static String HEADER_CONTENT_DISPOSITION(Code)(Java Doc)

Methods inherited from org.springframework.web.servlet.view.jasperreports.AbstractJasperReportsView
final protected void convertExporterParameters()(Code)(Java Doc)
protected Object convertParameterValue(JRExporterParameter parameter, Object value)(Code)(Java Doc)
protected JRDataSource convertReportData(Object value) throws IllegalArgumentException(Code)(Java Doc)
protected JRExporterParameter convertToExporterParameter(String fqFieldName)(Code)(Java Doc)
protected void exposeLocalizationContext(Map model, HttpServletRequest request)(Code)(Java Doc)
protected JasperPrint fillReport(Map model) throws IllegalArgumentException, SQLException, JRException(Code)(Java Doc)
protected Map getConvertedExporterParameters()(Code)(Java Doc)
protected JRExporterParameter getExporterParameter(Object parameter)(Code)(Java Doc)
public Map getExporterParameters()(Code)(Java Doc)
protected DataSource getJdbcDataSource()(Code)(Java Doc)
protected JasperReport getReport()(Code)(Java Doc)
protected JRCompiler getReportCompiler()(Code)(Java Doc)
protected JRDataSource getReportData(Map model)(Code)(Java Doc)
protected Class[] getReportDataTypes()(Code)(Java Doc)
final protected void initApplicationContext() throws ApplicationContextException(Code)(Java Doc)
protected void onInit()(Code)(Java Doc)
protected void postProcessReport(JasperPrint populatedReport, Map model) throws Exception(Code)(Java Doc)
protected void renderMergedOutputModel(Map model, HttpServletRequest request, HttpServletResponse response) throws Exception(Code)(Java Doc)
abstract protected void renderReport(JasperPrint populatedReport, Map model, HttpServletResponse response) throws Exception(Code)(Java Doc)
public void setExporterParameters(Map parameters)(Code)(Java Doc)
public void setHeaders(Properties headers)(Code)(Java Doc)
public void setJdbcDataSource(DataSource jdbcDataSource)(Code)(Java Doc)
public void setReportCompiler(JRCompiler reportCompiler)(Code)(Java Doc)
public void setReportDataKey(String reportDataKey)(Code)(Java Doc)
public void setSubReportDataKeys(String[] subReportDataKeys)(Code)(Java Doc)
public void setSubReportUrls(Properties subReports)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.