Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping by parameter 1

Status
Not open for further replies.

ekta22

IS-IT--Management
May 3, 2004
359
US
Hi,

I have 2 parameter fields in my report - Region and Sector. I want to add 2 groups to my report based on the above parameters entered by the user. But when I go to Insert Group it does not show me the parameter field in the list. How can I group my report by these parameters?

Thanks,
Ekta
 
In the subreport linking screen add the parameter from the main report and then in the bottom left corner use the dropdown to find the subreport parameter {?startdate} (NOT {?pm-?start}. Repeat for {?enddate}.

-LB
 
woo-hoo.. that seems to be working..:) thanks so much for your help. I just need to clean up couple of things. I would really appreciate your help on that too.

1. The titles for the fields in the subreport are in the report header. Because of that it prints them just once on the first page. But the detail records go on to other pages and I want to see the field headers on every page of the subreport. Is there a way to do that?

2. On my page header, I have the report title, region, sector, intervals, start date, end date displayed as entered by the users. This is where I want to display the grouping I did on the subreport by {@grpname}. And this should be displayed in the page header only when the report prints the subreport and not for other report pages. How to do that?

Thanks so much for your patience with me.
 
To create a faux page header in the subreport, create a formula {@all} in the subreport that includes all records:

whilereadingrecords;
1

Insert a group on this and check "Repeat group header on each page". Then remove the group name and use this as your page header.

On the second issue, you haven't created {@grpname} in the main report, so it would only be available by sharing the field from the subreport, and even then, it would have to be placed below the subreport, not above it. Why not insert another group header (on {@all}) section_a section in the subreport and try placing {@grpname} there? Then use a group header_b section for your column labels.

-LB
 
Thanks, I got the first part working just fine.

I am not sure if I followed the second part. Didn't understand "insert another group header (on {@all}) section_a section in the subreport"
Right now {@grpname} is displayed in the subreport as a group header. I want to move it to the page header and display it there.
 
In the subreport, you have inserted a group on {@All} in order to create a group header that can act as a page header. I am suggesting that you insert another group header section_a to on which you can display {@grpname} within the subreport--which I'm not sure you can do in the main report. You can insert another section by clicking on the gray area to the left of the report where it says GH1 and select "Insert section below".

-LB
 
What I don't understand is how is it going to help. I already have the {@grpname} as the group header when I grouped the subreport by {@grpname}. If I create another group header(section_a) it does the same thing. Can't I somehow move the {@grpname} group header from subreport to the page header of the main report?
 
This could really slow your report, but you could save the subreport (file->save subreport as->new name). Then choose insert ->subreport ->choose a subreport->browse->new name. Insert the subreport in the page header section, and then in the subreport, suppress all sections except the group header ({@grpname}). Make sure the links are exactly like the other subreport.

-LB
 
hmmnn.. Performance is really important so I am not sure if this will be a good idea.
 
Is it possible to use shared variables?
 
I have already explained that shared variables only work below the section in which the subreport is located. Did you try adding the subreport to see how if affected performance? It might be okay.

-LB
 
When I do it, I get the message

The page size was not large enough to format the contents of an object in the report.

I supressed all the sections in the subreport except the {@grpname} header.
 
I second that. He's been really helpful and patient with me. Thanks so much!
 
Did you create all the links for the subreport as you did for the first one?

-LB
 
Yea.. I checked all the links for the subreport and they are exactly the same as the other subreport.
 
lbass, I think I am going to leave {@grpname} in the subreport.

One last thing..:)

Right now I have my grouping on area and the area's found are displayed on the page header. But when the report displays the subreport with the records for all the areas together under that particular region, sector, interval it displays the last found area in the page header. I want that when it displays the subreport, the area field in the page header should be supressed.

Thanks
 
This assumes that the subreport is in the Interval group footer and that the footer is formatted to "new page before". Create two formulas:

//{@false} to be placed in the Report Header, the Interval Group Header
//and the Section Group Footer:
whileprintingrecords;
booleanvar flag := false;

//{@true} to be placed in the section where your subreport is located
//(Interval GF):
whileprintingrecords;
booleanvar flag := true;

Then use right click on the area field in the page header->format field->common->suppress->x+2 and enter:

whileprintingrecords;
booleanvar flag;
flag = true; //Note: no colon here.

-LB

 
My subreport is in the interval group footer but it's not formatted to "new page before". Do I just need to check this option in section expert or do I need some formula?

You said above that I need to place {@false} in the Section Group Footer. Which section group footer? Didn't understand that.
 
Yes, just check it. You have a group on Section. In the section expert, if you have more than on group section (e.g., a,b,c,etc.), then put it in section a.

-LB
 
I don't have a group on section. I have group on sector. Probably that's what you mean. It works without it too. Thanks..:) [2thumbsup]
This thread has been really long. If I need any further help I will probably start a new thread. Thanks for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top