subreport values based on the main report group
I have a main report with 1 group. I have a subreport placed on the group footer. The main report group is based on Company and displays the values related to the company. The subreport shows some related values belonging to all the companies. I need to control the subreport results based on the value of the group only. For example, only Company A records should display in Company A group and only Company B records in Company B group etc. I can not pass any parameters because main report runs for all records with out any parameters. Example: Current result - Main report - Company A, 123 Main Street, Some City, State 11111...... Sub Report - Bill # 1, 2, 3, 4, 5, 6, 7, 8...... Expected result - Main report - Company A, 123 Main Street, Some City, State 11111...... Sub Report - Bill # 1, 2, 3 (rest of the bills belong to other companies and should display in their appropriate groups) Is it possible. If so how can I achieve this. Thx in advance.
August 17th, 2008 5:14pm

Hello Christal, You can do this using subreport. In the sub report query write a where condition like where company name = @company name In the main report add a sub report, right click the sub report and select properties. Give the sub report, and in the parameter tab add a parameter, company name and select the company name in the value filed. Hope this helps
Free Windows Admin Tool Kit Click here and download it now
August 18th, 2008 3:25am

I have the parameter on the sub report already. I am seeing all the bill #s on the first record. Sorry I forgot to mention them. My problem is to get only those belonging toeach particular company separately under each group.
August 18th, 2008 9:26pm

Hi Christal, If you already have the reportparameter on the subreport, please make surethe available values of the parameterare fromthe company field. If you want to show the specific company in the subreport, you also need to add the "where" clause to the query stringfor the dataset, such as where <company_field>=@company. The query parameter "@company" will automatically tied to the report parameter. In the main report, it is necessary to pass the company field to the subreport parameter. If there are any more questions, please let me know. Thanks.
Free Windows Admin Tool Kit Click here and download it now
August 19th, 2008 10:39pm

As its on the same subject, thought I'd ask a followup question here: Suppose the parameter values were a multi-part param, i.e. suppose the report example above could be created for multiple companies? In other words, user can select Company A AND Company B, with bills 1,2,3,7,8,9 on the subreport?I have this issue now, where I'm trying to use a report / subreport combination (main report brings a list of transaction ids that are used to filter the subreport data for just those ids).Vista Home Premium 32 bit, 2GB RAM, Intel Core Duo
August 31st, 2009 3:56pm

i kno wthis is old but did you ever get a solution for this followup..i have the same exact circumstance. i wasnt to use the parameter from a mullti bu tjust use one at a time for the subreport base on the group id
Free Windows Admin Tool Kit Click here and download it now
June 5th, 2012 11:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics