Jump to content
We've recently updated our Privacy Statement, available here ×

Custom component and xsd


johanandren

Recommended Posts

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

  • 2 weeks later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...
  • 2 weeks later...

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...