Jump to content
Changes to the Jaspersoft community edition download ×

dynamically creating a report with statictext


2005 IR Help

Recommended Posts

By: JotaJotin - irracional79

dynamically creating a report with statictext

2004-11-16 03:23

Hi all!

 

I need to create dinamically a report. I have the settings of the

report stored in a java value object and a list of elements in it.

 

The data in this classes is this:

 

import java.util.ArrayList;

import java.util.Collection;

import org.guasaj.common.vo.GuasajVO;

 

/**

*

* @author euplajjlop

*/

public class ConfiguracionAlbaranVO implements GuasajVO{

private int idCfgAlbaran; //id in the DB

private String nombre; //name of the settings of the report

private int tamX; //height of the report

private int tamY; //width of the report

private int leftMargin; //left margin of the report

private int rightMargin; //right margin of the report

private int topMargin; //top margin in the report

private int bottomMargin; //bottom margin of the report

private int codConfiguracion; //internal code of the report

 

private Collection elementosConfiguracion; //list of the elements

of the report

/** Creates a new instance of ConfiguracionAlbaranVO */

public ConfiguracionAlbaranVO() {

elementosConfiguracion = new ArrayList();

}

 

the code of the elements of the reports is this:

 

import org.guasaj.common.vo.GuasajVO;

 

/**

*

* @author euplajjlop

*/

public class ElementoConfiguracionAlbaranVO implements GuasajVO{

private int idElementosCfgAlbaranes;

private int cfgAlbaranesIdCfgAlbaranes;

private String tabla;

private String campo;

private int estilo; //font stile

private int tamanoFuente; //font size

private int longitudCaracteres; //character lenght

private int posicionX; //x possition

private int posicionY; // y possition

private String tipoCampo;

private String valorTextoFijo;

private int ancho; //elementheight

private int alto; // element width

private String nombreFuente; //font name

 

private int estadoElemento;

 

private String displayName; //text to print

/** Creates a new instance of ElementoConfiguracionAlbaranVO */

public ElementoConfiguracionAlbaranVO() {

nombreFuente="Arial";

tamanoFuente = 13;

longitudCaracteres = 10;

ancho = 149;

alto = 10;

}

 

So i want to create a report ussing the settings of the

ConfiguracionAlbaranVO class and

a list of statictext elements each one with it?s settings. And send it

tho the printer.

 

I think you need to somehow create a JasperDesign object and then pass it to JasperCompileManager to get it compiled dynamically to return a JasperReport which you can then use with JasperFillManager to populate!

 

Cheers!

 

Anyone can help me? Thanks all.

 

Sorry for my english :S

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