IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

BIRT Discussion :

[2.1.1][Java] erreur executereport


Sujet :

BIRT

  1. #1
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut [2.1.1][Java] erreur executereport
    bonjour,
    j'essaye d'utiliser exécute l’exemple du wiki de birt :executereport.java
    ( que l'on trouve ici : http://wiki.eclipse.org/Simple_Execute)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    /**
     * 
     */
    package servlet;
     
    /**
     * @author antoine
     * 
     */
    import java.util.HashMap;
    import java.util.logging.Level;
     
    import org.eclipse.birt.core.framework.Platform;
    import org.eclipse.birt.report.engine.api.EngineConfig;
    import org.eclipse.birt.report.engine.api.EngineConstants;
    import org.eclipse.birt.report.engine.api.EngineException;
    import org.eclipse.birt.report.engine.api.HTMLActionHandler;
    import org.eclipse.birt.report.engine.api.HTMLEmitterConfig;
    import org.eclipse.birt.report.engine.api.HTMLRenderContext;
    import org.eclipse.birt.report.engine.api.HTMLRenderOption;
    import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
    import org.eclipse.birt.report.engine.api.IReportEngine;
    import org.eclipse.birt.report.engine.api.IReportEngineFactory;
    import org.eclipse.birt.report.engine.api.IReportRunnable;
    import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
     
    public class ExecuteReport {
     
    	static void executeReport() throws EngineException {
    		//HashMap<String, Integer> parameters = new HashMap<String, Integer>();
     
            HashMap parameters = new HashMap();
    		String name = "Top Count";
    		Integer pvalue = new Integer(4);
    		parameters.put(name, pvalue);
     
    		IReportEngine engine = null;
    		EngineConfig config = null;
    		try {
     
    			// Configure the Engine and start the Platform
    			config = new EngineConfig();
                config.setEngineHome("E:/install_birt/birt-runtime-2_1_3/ReportEngine");
    			//config.setEngineHome("C:/Birt/birt-runtime-2_2_0/ReportEngine");
    			// set log config using ( null, Level ) if you do not want a log
    			// file
    			// config.setLogConfig("c:/Birt/logs", Level.FINE);
    			config.setLogConfig(null, Level.OFF);
     
    			Platform.startup(config);
    			IReportEngineFactory factory = (IReportEngineFactory) Platform
    					.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
    			engine = factory.createReportEngine(config);
    			engine.changeLogLevel(Level.WARNING);
     
    		} catch (Exception ex) {
    			ex.printStackTrace();
    		}
     
     
            // Configure the emitter to handle actions and images
            HTMLEmitterConfig emitterConfig = new HTMLEmitterConfig();
            emitterConfig.setActionHandler(new HTMLActionHandler());
            HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
            emitterConfig.setImageHandler(imageHandler);
            config.getEmitterConfigs().put("html", emitterConfig); //$NON-NLS-1$
     
            IReportRunnable design = null;
     
            // Open the report design
            design = engine
                    .openReportDesign("C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/rapport_petiteenfance.rptdesign");
     
            /****/
     
            // design =
            // engine.openReportDesign("C:/Birt/birt-runtime-2_2_0/ReportEngine/samples/hello_world.rptdesign");
            // Create task to run and render the report,
            IRunAndRenderTask task = engine.createRunAndRenderTask(design);
     
            // Set Render context to handle url and image locataions
            HTMLRenderContext renderContext = new HTMLRenderContext();
            // Set the Base URL for all actions
            renderContext.setBaseURL("http://localhost:8080/");
            // Tell the Engine to prepend all images with this URL - Note this
            // requires using the HTMLServerImageHandler
            renderContext.setBaseImageURL("http://localhost:8080/myimages");
            // Tell the Engine where to write the images to
            renderContext.setImageDirectory("C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/myimages");
            // Tell the Engine what image formats are supported. Note you must have
            // SVG in the string
            // to render charts in SVG.
            renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
            HashMap contextMap = new HashMap();
            contextMap.put(EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
                    renderContext);
            task.setAppContext(contextMap);
            // Set parameters for the report
            task.setParameterValues(parameters);
            // Alternatively set each seperately
            // task.setParameterValue("Top Count", new Integer(12));
            task.validateParameters();
     
            // Add a scriptable object, which will allow the report developer to put
            // script in the report that references this Java object. eg in script
            // pFilter.myjavamethod()
            // ProcessFilter pf = new ProcessFilter();
            // task.addScriptableJavaObject("pFilter", pf);
     
            // Set rendering options - such as file or stream output,
            // output format, whether it is embeddable, etc
            HTMLRenderOption options = new HTMLRenderOption();
     
            // Remove HTML and Body tags
            // options.setEmbeddable(true);
     
            // Set ouptut location
            options.setOutputFileName("/rapports/output.pdf");
            // options.setOutputFileName("/rapports/output.html");
     
            // Set output format
            options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_PDF);
            // options.setOutputFormat("html");
            task.setRenderOption(options);
     
            // run the report and destroy the engine
            // Note - If the program stays resident do not shutdown the Platform or
            // the Engine
            task.run();
            task.close();
     
     
            /*****/
            engine.shutdown();
            Platform.shutdown();
    		System.out.println("Finished");
    	}
     
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		try {
    			executeReport();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
     
    }

    et j'ai le message d'erreur suivant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
     
    java.lang.NoClassDefFoundError: com/ibm/icu/util/ULocale
    	at org.eclipse.birt.core.format.NumberFormatter.<init>(NumberFormatter.java:50)
    	at org.eclipse.birt.report.model.api.util.StringUtil.doubleToString(StringUtil.java:208)
    	at org.eclipse.birt.report.model.api.metadata.DimensionValue.toString(DimensionValue.java:375)
    	at org.eclipse.birt.report.model.metadata.DimensionPropertyType.validateXml(DimensionPropertyType.java:240)
    	at org.eclipse.birt.report.model.metadata.PropertyDefn.validateXml(PropertyDefn.java:762)
    	at org.eclipse.birt.report.model.metadata.MetaDataHandler$DefaultValueState.end(MetaDataHandler.java:1226)
    	at org.eclipse.birt.report.model.util.XMLParserHandler.endElement(XMLParserHandler.java:170)
    	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1720)
    	at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    	at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    	at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    	at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
    	at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
    	at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
    	at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
    	at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    	at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
    	at javax.xml.parsers.SAXParser.parse(SAXParser.java:143)
    	at org.eclipse.birt.report.model.metadata.MetaDataReader.read(MetaDataReader.java:116)
    	at org.eclipse.birt.report.model.api.impl.DesignEngineImpl.initialize(DesignEngineImpl.java:93)
    	at org.eclipse.birt.report.model.api.impl.DesignEngineImpl.newSessionHandle(DesignEngineImpl.java:137)
    	at org.eclipse.birt.report.model.api.DesignEngine.newSessionHandle(DesignEngine.java:106)
    	at org.eclipse.birt.report.model.api.DesignEngine.newSession(DesignEngine.java:128)
    	at org.eclipse.birt.report.engine.parser.ReportParser.getDesignHandle(ReportParser.java:144)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:243)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:191)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.openReportDesign(ReportEngineHelper.java:125)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngine.openReportDesign(ReportEngine.java:235)
    	at servlet.ExecuteReport.executeReport(ExecuteReport.java:73)
    	at servlet.ExecuteReport.main(ExecuteReport.java:88)
    Exception in thread "main"
    quelqu'un pourrait il m'aider ?
    merci d'avance

  2. #2
    BiM
    BiM est déconnecté
    Expert éminent sénior
    Avatar de BiM
    Femme Profil pro
    Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
    Inscrit en
    Janvier 2005
    Messages
    7 796
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 38
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT

    Informations forums :
    Inscription : Janvier 2005
    Messages : 7 796
    Points : 10 765
    Points
    10 765
    Par défaut
    Bonjour,

    J'ai déjà eu cette erreur, il me manquait une bibliothèque sur mon serveur, donc ça ne fonctionnait pas bien, forcément...

    Tu as peut-être le problème parce qu'en l'occurence tu as changé de version, non ?

    Désolée de ne pas pouvoir être plus précise, peut être que cela me reviendra.

  3. #3
    Nouveau membre du Club

    Profil pro
    Inscrit en
    Février 2005
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 34
    Points : 35
    Points
    35
    Par défaut
    la librairie icu d'ibm est manquante au classpath

    on la trouve dans toute distrib birt. Par exemple dand birt runtime/ report engine/ lib/ com.ibm.icu_machin_truc.jar

    et qu'est ce qu'on lit en bas de la page de l'exemple ? la procedure a suivre pour faire fonctionner l'exemple... Toujours lire les articles en entier ;-)


    Comments

    In order to compile and run the sample code, you have to make sure that all the necessary libraries are in the classpath. I assume you are using eclipse as your development environment and that you created a java project where you created a java file containing the sample code above. Also you should have downloaded and installed the birt-runtime. (I guess you have because otherwise what did you set the engine home in the code above?)

    First of all the question is which libraries do you have to add? The answer is quite easy: All the libraries in the birt-runtime-2_1_1/ReportEngine/lib directory. So all you have to do is to right click the project and choose the properties action to open the project property dialog. There select the "Java Build Path" property page. Go to the Libraries tab and add the above mentioned libraries using the "Add external jars ..." button.

  4. #4
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut
    merci,
    effectivement je n'avais pas rajouté toutes les librairies ( j'avais lu sur un post que cela n'était pas nécessaire ... mais ça devait pas etre dans ce cas la précis ) enfin bref

    ça serait évidemment trop simple si ça marchait du coup sans problème

    en exécutant j'ai eu un message long comme le bras, car je pense qu'il me manque toujours la librairie pour générer en pdf ( je sais plus laquelle)

    du coup j'ai décommenté les lignes pour générer le rapport en html et j'ai le message d'erreur suivant :
    ( a noter que le répertoire myimages a bien été crée)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    18 févr. 2008 09:35:57 org.eclipse.birt.report.engine.executor.css.HTMLProcessor execute
    GRAVE: There is a invalid value for property SIZE of element FONT in the HTML.
    Finished

  5. #5
    Nouveau membre du Club

    Profil pro
    Inscrit en
    Février 2005
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2005
    Messages : 34
    Points : 35
    Points
    35
    Par défaut
    Les logs sont désactivés ?

    // config.setLogConfig("c:/Birt/logs", Level.FINE);
    config.setLogConfig(null, Level.OFF);
    une erreur dans le rptdesign ?

    C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/rapport_petiteenfance.rptdesign

  6. #6
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut
    salut
    j'ai testé avec un autre rapport celui d'exemple ( test.rptdesign ) et ça ne marche pas non plus

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    18 févr. 2008 10:35:41 org.eclipse.birt.report.engine.api.impl.EngineTask validateScalarParameter
    GRAVE: Parameter sample doesnt allow a null value.
    18 févr. 2008 10:35:41 org.eclipse.birt.report.engine.api.impl.EngineTask validateScalarParameter
    GRAVE: Parameter sample doesnt allow a null value.
    org.eclipse.birt.report.engine.api.EngineException: Some required parameter values are not set or set to incompatible data type.
    	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:158)
    	at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:145)
    	at servlet.ExecuteReport.executeReport(ExecuteReport.java:132)
    	at servlet.ExecuteReport.main(ExecuteReport.java:147)
    et j'ai essayé de réactiver les logs en decommentant la ligne et cela donne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    java.io.IOException: Couldn't get lock for C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/logs\ReportEngine_2008_02_18_10_38_17.log
    	at java.util.logging.FileHandler.openFiles(FileHandler.java:361)
    	at java.util.logging.FileHandler.<init>(FileHandler.java:261)
    	at org.eclipse.birt.report.engine.api.impl.EngineLogger.startEngineLogging(EngineLogger.java:56)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.setupLogging(ReportEngineHelper.java:338)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngine.setupLogging(ReportEngine.java:109)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngine.<init>(ReportEngine.java:90)
    	at org.eclipse.birt.report.engine.api.impl.ReportEngineFactory.createReportEngine(ReportEngineFactory.java:13)
    	at servlet.ExecuteReport.executeReport(ExecuteReport.java:53)
    	at servlet.ExecuteReport.main(ExecuteReport.java:147)

  7. #7
    BiM
    BiM est déconnecté
    Expert éminent sénior
    Avatar de BiM
    Femme Profil pro
    Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT
    Inscrit en
    Janvier 2005
    Messages
    7 796
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 38
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Consultante/Formatrice BIRT & Ingénieur Java/J2EE/GWT

    Informations forums :
    Inscription : Janvier 2005
    Messages : 7 796
    Points : 10 765
    Points
    10 765
    Par défaut
    Pour les erreurs avec un autre rapport, c'est simplement (comme le dit l'erreur) que tu as des paramètres que tu devrais remplir et que tu as laissé vides.

  8. #8
    Membre du Club
    Inscrit en
    Février 2007
    Messages
    64
    Détails du profil
    Informations forums :
    Inscription : Février 2007
    Messages : 64
    Points : 43
    Points
    43
    Par défaut
    bon beh maintenant mon code c'est ça :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
     
    /**
     * 
     */
    package servlet;
     
    /**
     * @author antoine
     * 
     */
     
    import java.util.HashMap;
    import java.util.logging.Level;
     
    import org.eclipse.birt.core.framework.Platform;
    import org.eclipse.birt.report.engine.api.EngineConfig;
    import org.eclipse.birt.report.engine.api.EngineConstants;
    import org.eclipse.birt.report.engine.api.EngineException;
    import org.eclipse.birt.report.engine.api.HTMLActionHandler;
    import org.eclipse.birt.report.engine.api.HTMLEmitterConfig;
    import org.eclipse.birt.report.engine.api.HTMLRenderContext;
    import org.eclipse.birt.report.engine.api.HTMLRenderOption;
    import org.eclipse.birt.report.engine.api.HTMLServerImageHandler;
    import org.eclipse.birt.report.engine.api.IReportEngine;
    import org.eclipse.birt.report.engine.api.IReportEngineFactory;
    import org.eclipse.birt.report.engine.api.IReportRunnable;
    import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
    import org.eclipse.birt.report.engine.api.RenderOptionBase;
    public class ExecuteReport {
     
    static void executeReport() throws EngineException
    {
     HashMap parameters = new HashMap();
     
     String name = "Top Count";
           Integer pvalue = new Integer(4);
     parameters.put(name, pvalue);
     
     IReportEngine engine=null;
     EngineConfig config = null;
     try{
     
      //Configure the Engine and start the Platform
      config = new EngineConfig( );
      config.setEngineHome( "E:/install_birt/birt-runtime-2_1_3/ReportEngine" );
      //set log config using ( null, Level ) if you do not want a log file
      //config.setLogConfig("c:/birt/logs", Level.FINE);
      config.setLogConfig(null,Level.FINE);
     
      Platform.startup( config );
      IReportEngineFactory factory = (IReportEngineFactory) Platform
        .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
      engine = factory.createReportEngine( config );
      engine.changeLogLevel( Level.WARNING );
     
     }catch( Exception ex){
      ex.printStackTrace();
     }
     
     //Configure the emitter to handle actions and images
     HTMLEmitterConfig emitterConfig = new HTMLEmitterConfig( );
     emitterConfig.setActionHandler( new HTMLActionHandler( ) );
     HTMLServerImageHandler imageHandler = new HTMLServerImageHandler( );
     emitterConfig.setImageHandler( imageHandler );
     config.getEmitterConfigs( ).put( "html", emitterConfig ); //$NON-NLS-1$
     
     IReportRunnable design = null;
     
     //Open the report design
     //design = engine.openReportDesign("C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/test.rptdesign"); 
     design = engine.openReportDesign("C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/rapport_petiteenfance.rptdesign"); 
     
     //Create task to run and render the report,
     IRunAndRenderTask task = engine.createRunAndRenderTask(design); 
     
     
     //Set Render context to handle url and image locataions
     HTMLRenderContext renderContext = new HTMLRenderContext();
     //Set the Base URL for all actions
     renderContext.setBaseURL("http://localhost/");
     //Tell the Engine to prepend all images with this URL - Note this requires using the HTMLServerImageHandler
     renderContext.setBaseImageURL("http://localhost/myimages");
     //Tell the Engine where to write the images to
     renderContext.setImageDirectory("C:/ecitiz_v3.1.1/studio/workspace/servlet_birt/myimages");
     //Tell the Engine what image formats are supported.  Note you must have SVG in the string 
     //to render charts in SVG.
     renderContext.setSupportedImageFormats("JPG;PNG;BMP;SVG");
     HashMap contextMap = new HashMap();
     
     //Version pdf
     contextMap.put( EngineConstants.APPCONTEXT_PDF_RENDER_CONTEXT, renderContext );
     //version html
     //contextMap.put( EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT, renderContext );
     
     
     task.setAppContext( contextMap );
     //Set parameters for the report
     task.setParameterValues(parameters);
     //Alternatively set each seperately
     //task.setParameterValue("Top Count", new Integer(12));
     task.validateParameters();
     
     //Add a scriptable object, which will allow the report developer to put
     //script in the report that references this Java object. eg in script 
     //pFilter.myjavamethod()
     //ProcessFilter pf = new ProcessFilter();
     //task.addScriptableJavaObject("pFilter", pf);
     
     //Set rendering options - such as file or stream output, 
     //output format, whether it is embeddable, etc
     //version html
     //HTMLRenderOption options = new HTMLRenderOption();
     //version pdf
     RenderOptionBase options = new RenderOptionBase();
     
     //Remove HTML and Body tags
     //options.setEmbeddable(true);
     
     //Set ouptut location
     //version html
     //options.setOutputFileName("./output.html");
     //version pdf
     options.setOutputFileName("./output2.pdf");
     
     //Set output format
     //options.setOutputFormat("html");
     //version pdf
     options.setOutputFormat(RenderOptionBase.OUTPUT_FORMAT_PDF); //Format du fichier de sortie
     //options.setOutputFormat("pdf");
     task.setRenderOption(options);
     
     //run the report and destroy the engine
     //Note - If the program stays resident do not shutdown the Platform or the Engine
     task.run();
     task.close();
     engine.shutdown();
     Platform.shutdown();
     System.out.println("Finished");
    } 
    	/**
             * @param args
             */
    	public static void main(String[] args) {
    		try {
    			executeReport();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
     
    }

    et ça marche...

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [WebService Java] Erreur : java.lang.ClassCastException
    Par alpha25 dans le forum Web & réseau
    Réponses: 3
    Dernier message: 13/03/2008, 14h40
  2. [JAVA] Erreur OPENGL
    Par Iphelias dans le forum OpenGL
    Réponses: 2
    Dernier message: 16/01/2008, 14h37
  3. [Java] Erreur avec FOP
    Par osoumayaj dans le forum XML/XSL et SOAP
    Réponses: 1
    Dernier message: 11/08/2006, 13h46
  4. SQL Server: Java Erreur Socket
    Par BenoitM dans le forum MS SQL Server
    Réponses: 4
    Dernier message: 28/04/2003, 16h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo