Jump to content
Changes to the Jaspersoft community edition download ×

fill report from 3 different type of data ??


Recommended Posts

By: brigand silvere - brsilve

fill report from 3 different type of data ??

2003-10-23 08:34

Hello

 

My probleme is not simple.

I need to use JasperReport, but i have to agregate data from 3 sources : a mySql connection, a mainframe connection (simulate by scorp), and data from beans.

 

I think i have to create a Datasource, agregate data in it, and fill reports with this datasource.

 

Is it right ?

And how can i do it ?

 

Perhaps another solution is possible. For example, in this project, it is easy to agregate Data in a Xml stream. Can i fill a report via a Xml ? How can i do it ?

 

Thanks for your help and every clue

 

 

 

 

 

By: dandotkar shashikanth - dshashikanth

RE: fill report from 3 different type of data ??

2003-10-23 16:11

hi ...

its simple if u have data in xml ...

first get the data in xml file..

if u see DataSource its extended from JRDataSource class..

which is abstract...so u need to override next() and

getFieldValue() methods....

so all u need to extend ur datasource with JRDataSouce class.

say for example ur new Datasource is called as

MyDataSource.

u shud pass the dataobjects inside this constructor through its constructor. when u fill the report u have to call this call... why not call this call with some arguments... iam sure this works....now the question is how to retrieve the data form xml..just parse it and get the result tree...n here i advise u that ...u know already what are the fields of ur table...so create a array of objects frm this table.

and these objects are the data objects for the MyDataSource class...

just call this:

JasperManager.fillReport(jrReport,parameterLIst,MyDataSource(objects));

where

JRReport jrReport;

Map parameteList;

Object[][] objects;

 

hope this works

cheers

shashi

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