Jump to content
Changes to the Jaspersoft community edition download ×

Sub-Report Problem - HELP


ktrinad

Recommended Posts

By: srinivas reddy - srinivasreddy13

Sub-Report Problem - HELP

2003-02-24 05:09

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-03-02 21:32

You just have to delete your Query in master report compiling window, I am not sure why SQL Query has to be deleted.

 

I am sure it will work

 

Have you tried the example posted by Giulio ? It contains step by step instructions.

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