Bonjour,


Cette semaine je me suis mis à jasper. J'ai téléchargé Ireport version 4.0.6, j'ai suivis un petit tuto sur internet sur leur site.

j'ai finis par générer le jrmxl: (juste un petit extrait)

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
<?xml version="1.0" encoding="UTF-8"?>
<jasperPrint xmlns="http://jasperreports.sourceforge.net/jasperreports/print" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/print http://jasperreports.sourceforge.net/xsd/jasperprint.xsd" name="TutoProg1" pageWidth="595" pageHeight="842" topMargin="20" leftMargin="20" bottomMargin="20" rightMargin="20" locale="fr_FR" timezone="Europe/Paris">
	<property name="net.sf.jasperreports.export.xml.start.page.index" value="0"/>
	<property name="net.sf.jasperreports.export.xml.end.page.index" value="29"/>
	<property name="net.sf.jasperreports.export.xml.page.count" value="30"/>
	<origin band="background"/>
	<origin band="title"/>
	<origin band="pageHeader"/>
	<origin band="columnHeader"/>
	<origin band="detail"/>
	<origin band="columnFooter"/>
	<origin band="pageFooter"/>
	<origin band="summary"/>
	<page>
		<text textHeight="30.1875" lineSpacingFactor="1.2578125" leadingOffset="-6.0585938">
			<reportElement x="218" y="45" width="194" height="38" origin="1" srcId="1"/>
			<font size="24" isBold="true" isItalic="true"/>
			<textContent><![CDATA[ORDERS]]></textContent>
		</text>
		<text textHeight="0.0">
			<reportElement x="38" y="124" width="100" height="20" origin="3" srcId="2"/>
			<textContent><![CDATA[]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="117" y="126" width="100" height="20" origin="3" srcId="3"/>
			<textContent><![CDATA[SHIPCOUNTRY]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="218" y="126" width="100" height="20" origin="3" srcId="4"/>
			<textContent><![CDATA[SHIPCITY]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="53" y="126" width="100" height="20" origin="3" srcId="5"/>
			<textContent><![CDATA[ORDERID]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="308" y="126" width="100" height="20" origin="3" srcId="6"/>
			<textContent><![CDATA[EMPLOYEEID]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="408" y="126" width="100" height="20" origin="3" srcId="7"/>
			<textContent><![CDATA[SHIPNAME]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="117" y="149" width="100" height="20" origin="4" srcId="8"/>
			<textContent><![CDATA[France]]></textContent>
		</text>
		<text textHeight="12.578125" lineSpacingFactor="1.2578125" leadingOffset="-2.524414">
			<reportElement x="218" y="149" width="100" height="20" origin="4" srcId="9"/>
			<textContent><![CDATA[Reims]]></textContent>........

Déjà ma première question: le jrmxl est static, j'aurais préféré qu'il soit renseigné en runTime car le contenus de base peut évoluer, comment faire? ou si vous connaissez un tuto?

J'essaye d’intégré jasper avec struts 2. Dans mon code de l'action je fait:


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
try {  
            JasperCompileManager.compileReportToFile(  
                    "c:\\jasper\\tuto.jrxml",  
                    "c:\\jasper\\tuto.jasper");  
        } catch (Exception e) {  
            e.printStackTrace();  
            return ERROR;  
        }
Je souhaite compiler le fichier .jrxml en runTime(Juste pour tester du code, dans une app je pense que c'est mieux déjà avoir les jasper??)

J'ai l'erreur suivante:


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
ATTENTION: Parse Warning Error at line 2 column 423: schema_reference.4: Failed to read schema document 'http://jasperreports.sourceforge.net/xsd/jasperprint.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'http://jasperreports.sourceforge.net/xsd/jasperprint.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:96)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:380)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2541)
	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:2532)
	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:1836)
	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:531)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2436)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1781)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:705)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScanne


Dans l’entête du fichier je vois que l'url n'est pas accessible si je la tape dans le browser:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
http://jasperreports.sourceforge.net/xsd/jasperprint.xsd
ce fichier est disponible dans le jar jasperreport-3.0.6.jar, je ne sais pas comment indiquer dans mon .jrxml sa localisation?


Voilà les premiers doute que j'ai pour le moment.

Je vous remercie d'avance pour l'aide que vous puissiez apporter.