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

Which class obj to use in writing layout xml?


Recommended Posts

By: Ade Panko - adepanko

Which class obj to use in writing layout xml?

2002-08-29 16:20

Hi fellow JR compatriots.

 

Teodor, you're doing a great job and greater service to the development community!! :--)

 

-------------------------------------------------------------------------

My situation calls for creating my report layout template XML without the GUI designer. Initially, I was going to write my own JDOM classes against the DTD to create the report XML file; however, after pouring through many JR classes, it seems to make more logical sense to use them in accomplishing these tasks since the classes for performing such are already in place and tested. Yes, no?

 

Basically, what need to do is create an instance of a class (sounds like JRReport.class - or possiby JasperDesign.class - is the right candidate), add my fields[] (addField(JRField field)), add my groups[] (addGroup(JRDesignGroup group)), etc. Once all my sets are complete, then, pass that object instance to JRXmlWriter.class (or XMLWriter.class) to write out to the report.xml. I'm more fuzzy at this intersection than the previous one.

 

I’m certain that there is a single (controller) class that contains instances of the other class objects I need which I could use to accomplish this task. If so, what is its name?

 

I would really appreciate confirmation, correction and any other comments regarding how best I could accomplish my objective.

-------------------------------------------------------------------------

 

Thanx in advance for any and all responses.

 

Ade Panko

 

 

 

By: Teodor Danciu - teodord

RE: Which class obj to use in writing layout xml?

2002-08-30 00:04

 

Hi,

 

Thank you very much for your appreciation

of my work.

 

I can only confirm that in order to create report

templates at runtime, without having to write the

XML file, you can use the classes found in

the "dori.jasper.engine.design" package.

 

As you said, you instantiate a JasperDesign object

and you add to it all the elements you need.

You can check the JasperDesign object for

consistency using the JRVerifier class, but this is

automatically done when you will try to compile it.

 

You don't have to generate the XML using the

JRXmlWriter, because you can call JRCompiler

directly on you JasperDesign object.

 

If you encouter problems, tell me, but I think now

is the moment for me to provide a sample for this.

 

Thank you,

Teodor

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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...