johanandren Posted May 13, 2009 Share Posted May 13, 2009 Hello. I have created a custom component for our reports following the demo/barcode example and I am now trying to add it to one of our reports by adding a componentElement block to our jrxml like in the example. I am now stuck with this problem: To specify the namespace for my custom component i need to define schemaLocation, the xsd-file for my report is placed on classpath in a jar together with the custom component. When I set it to a relative classpath to the xsd-file and then try to compile the report or view it in iReport in design mode i get an error that the file cannot be found (the xml parser treats the relative path as an absolute path in the filesystem). Is it possible to get jasper to tell the XML-parser to look for my .xsd in the classpath? In my spring beans-file which i have based on the xml in the barcode demo i have an xmlParser with a "internalSchemaResource" pointing to the xsd-file on the classpath. Is it possible to avoid coding any path to the .xsd file in the report xml and make it use that? Thanks. Link to comment Share on other sites More sharing options...
lucianc Posted May 27, 2009 Share Posted May 27, 2009 Your xmlParser bean should specify a publicSchemaLocation as well, even if the location is invalid. This public location should be used in JRXML as it would be automatically resolved to the internal XSD resource.Regards,Lucian Link to comment Share on other sites More sharing options...
pwd Posted May 31, 2010 Share Posted May 31, 2010 This is kind of a thread hijack but does anyone know of any tutorials about creating and using a custom report element for iReport? Link to comment Share on other sites More sharing options...
lucianc Posted June 11, 2010 Share Posted June 11, 2010 You can follow the custom components implemented in the jchartscomponent and openflashchart JR samples, and the barcode components included in the JR codebase. An explained tutorial is available in the commercial JasperReports Ultimate Guide.Note that these only cover JasperReports, for iReport support post a query on the iReport forum.Regards,Lucian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now