01: package com.calipso.reportgenerator.common;
02:
03: import net.sf.jasperreports.engine.design.JasperDesign;
04: import net.sf.jasperreports.engine.JRException;
05: import net.sf.jasperreports.engine.JasperManager;
06: import net.sf.jasperreports.engine.JasperCompileManager;
07: import net.sf.jasperreports.engine.xml.JRXmlLoader;
08:
09: /**
10: *
11: */
12: public class ExternalJasperDefinition implements IJasperDefinition {
13: private JasperDesign jasperDesign;
14:
15: public JasperDesign getJasperDefinition(boolean isLandscape)
16: throws JRException {
17: return jasperDesign;
18: }
19:
20: public ExternalJasperDefinition(String externalDefinitionFile)
21: throws InfoException {
22: try {
23: System.out.println("LayoutDesign_FileName:"
24: + externalDefinitionFile);
25: jasperDesign = JRXmlLoader.load(externalDefinitionFile);
26: } catch (JRException e) {
27: throw new InfoException(LanguageTraslator.traslate("257"));
28: }
29: }
30:
31: }
|