views:

369

answers:

1

Hello All!

I have a query with grouping on one of the fields in Crystal Reports. My question is - is there a way to pass that value into a subreport?

I.e. if there are three values in that field, there will be three groups in report. I want a subreport in every group to have that value as its parameter.

Is that possible to accomplish with CR 2008?

A: 

So, you have a field in your main report and you want to pass it to your subreport? Not a problem.

  1. Right-click on your subreport. Go to the Change Subreport Links submenu.
  2. Drag your field from the left menu to the right.
  3. Unselect the Select data in subreport based on field: option.
  4. Go into your subreport. Your field will appear in there as a parameter field.

So many ways to describe and answer a question. Does this help?

PowerUser
Actually I think I am doing something wrong. I already have a subreport with parameters which I use to query database in subreport.I try to do as you advised, I change subreport links, select that particular field, uncheck "select data in subreport...".But when I try to see a print preview, I enter data needed for report parameters and then I get error while querying database.The error is caused by the parameter which is being passed into subreport, and for some reason it is a symbol with 01 code. Not a digit '1' which is supposed to be there.
DarkDeny
Another problem I have - if I create an empty subreport, then change subreport links, pass field as a parameter into it, then in preview I can see single row of data return from database (as expected) but shown 5 times. And still I have no clue what was done wrong...
DarkDeny
Seems I found a problem - actually data is returned by DB is 5 rows =). So recreating subreport from scratch and adding a parameter via "change subreport links" to it helped.
DarkDeny
Now I have problems with passing report parameters into subreport. Are there any conventions which I'm not awared of?
DarkDeny
(I was out yesterday. Glad to see you answered one of your own questions). Crystal can have be finnicky with null values. Do any of these parameters have null values? There are also "Convert NULL values to default" options in Crystal as well.
PowerUser
Also, since your new question is different from the original, you may want to make a new post.
PowerUser