Jump to content
Changes to the Jaspersoft community edition download ×

Recommended Posts

By: LuisClaudio - luisclaudio

ireport

2006-05-08 11:10

I am new to use ireport and would like an explanation (step by step).

I already created one report with the name report.jrxml that he is in C:reporte

I obtain to open in .pdf this I have reported inside of the IReport without problems.

 

I want to create one class or method that open this report (report.jrxml)in jasperview or .pdf. somebody can give code example to me to make this (Step by Step )?

 

Still I did not bind the necessary database to only know as I open this has reported for class

 

Thanks

 

 

 

By: Kraemer - felipe_kraemer

RE: ireport

2006-05-08 13:55

Hi! Do you speak portuguese? If so, I think I can help you. Try to describe your problem in portuguese, because I couldn't understand it in English. As I am brazilian, if you could explain better in portuguese language I think I can help you.

 

Thanks,

Felipe

 

 

By: LuisClaudio - luisclaudio

RE: ireport

2006-05-08 15:49

Sim, falo portugues ! graças a deus encontrei alguem que fale portugues.

 

é o seguinte, estou a usar a ferramenta ireport agora e ja consegui criar um reporte com nome report.jrxml na directoria c:reportes

 

preciso agora de criar uma class que abre este report no jasperview ou no acrobat. deu para entender ?

por enquanto nao quero configurar ainda nenhuma ligação a base de dados. soo quero saber como vou abrir este reporte que eu criei.

 

dentro do ireport eu abro o report em .pdf bem legal e agora gostaria de abri-lo atraves de uma metodo ou class.

 

Voce pode me ajudar com isso ? estarei muito grato pois ando com o meu projecto parado so por causa desta parte do reporte.

 

Muito obrigado.

 

 

By: Bruno R. Lima - iceboyy

RE: ireport

2006-05-16 15:58

as far as i could understand, you use a translator portuguese -> english :) thats not a good idea... ;)

 

But, lets solve your problem.

Once you've got an JRXML file (that means you create a source-file report), you have 2 options: one is compile this file before use it (you can do it on iReport) and you'll have an JASPER file.

 

If you dont want to compile it before use it, you can also compile at runtime.

Code:
 
JasperReport report = JasperCompileManager.compileReport("c:\report.jrxml"«»);

 

If you do have an JASPER file, you may change the code above to:

 

Code:
[code]
JasperReport report_compiled = (JasperReport)JRLoader.loadObject("c:\report.jasper"«»);

 

Now, with JasperReport object, you just have to fill it with data (if you do have data to fill it up). If dont, just use a JREmptyDataSource.

 

Code:
[code]
JasperPrint print = JasperFillManager.fillReport(report, param, new JREmptyDataSource());

 

then, just use the print object to export (JasperExportManager) or to view at JRViewer.

 

Bruno

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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