Jump to content
Changes to the Jaspersoft community edition download ×

sub-report problem HELP!!!!


Recommended Posts

By: srinivas reddy - srinivasreddy13

sub-report problem HELP!!!!

2003-02-24 05:08

I have created a main report which shows simple data frm the DB. It has one ID and Name field from products table. And then I have created a subreport file(subreport1) which should show description of these products. here my query was "select description from prod_desc where pid = ${ID}". and i have also created a parameter Field name=ID, Class type=java.lang.Integer, Is for prompting=true.

Now How should i compile it? When i complie it with specifing connection it gives error as it couldnt recognise what is $P{ID}. And when i compile it without connection it runs perfectly and displays the report (.pdf) with data as Null.

And, Next i create a mainreport file (mainreport) where I have the query as "select id as pid, name from products". I place these fields in detail section and also created a parameter by the name subreport1, dori.jasper.engine.JasperReport, true(this i saw in jasperreports demo files). Then I palced the subreport in detail band and set the following properties:

Common tab-> checked remove line when blank and print repeated values

subreport1->connection/datasource expression: use connection expression --

$P{REPORT_CONNECTION}

subreport2->subreport expression:

dori.jasper.engine.JasperReport

subreport parameters : name=ID and Expression: $F{pid}.

Now when i compiles the mainreport file it gets compiled with connection and displayes only the records of my mainreport without displaying any records in my subreport.... i am not sure whether its running fine or not. I am also not sure whether i followed right steps.... please guide me asap... its urgent.... i want complete steps for creating a simple subreports....

regds,

Sri

 

 

 

By: Mohan Joshi - mohanjoshi1

RE: sub-report problem HELP!!!!

2003-02-28 02:42

Hi,

 

I am also having same problem, Can any experts have tried to run the Jasperreports subreport example & found success ?

 

Regards

Mohan

 

 

By: tone zalokar - tonez0

RE: sub-report problem HELP!!!!

2003-02-28 05:30

Compile reports and subreports without connection. Then use iCompiler without filling query statement in icompiler window! If it exists delete it from iCompiler window!

 

tz

 

 

By: kags - wakabiro

RE: sub-report problem HELP!!!!

2004-04-13 16:51

I had a problem like the first one you listed and I use $P{ID} instead of ${ID} and it worked. Hope this helps.

 

Kags

 

 

By: just - justjasper

RE: sub-report problem HELP!!!!

2004-04-13 23:11

I had the same problem,u can solve it by replace ${ID} with $P{ID}.good luck.

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