How do I group multiple result sets in a report?

I am using ActiveReports with ASP.NET, but I think any similar reporting component would do.

I have two sets of results to combine and display in one report, for example:

Table 1:

Name Job              Start End
Jack Some service     1992  1997
Jack Some Sales Exp   1998  2007
Jane Some programming 2000  2003

Table 2:

Name Training
Jack Shiny French Certificate
Jane Crappy database certificate
Jane Some courses in management

      

And the report should look like this:

Jack
  Job History:
    Some Corp, 1992-1997
    Some Sales Exp, 1998-2007
  Training History:
    Shiny French Certificate
Jane
  Job History:
    Some programming, 2000-2003
  Training History:
    Crappy database certificate
    Some courses in management

      

How do I concatenate the two tables and how do I create a layout to achieve the report in this example?

Update:

As you can see, I am not trying to do this with a single selection. I have two data sources as a source and I can combine them manually to get one data source. I am trying to use grouping, but I need two groups for each employee. One for work and one for training. How can I use the group or sub-report functionality to bind this type of data (and how should I handle the data if needed)?

+1


source to share


3 answers


Use Subreports ... Create a main report with two subheadings. One subheading for work history and one subheading for learning history. The main report will require a query that will return a list of people. Then, for each Person in the main report details, set a parameter in each child division that will refine the query in those two to display the assignment history or training history for only the current person displayed in the parent report.



A detailed step-by-step guide that explains how to do this step by step is on the Data Dynamics website here . Some overview information is also here

+2


source


In general, you cannot do this in a single SELECT statement. Most reporting tools offer some sort of "subordinate" or "internal section" that is executed on a different SQL question and has some parameters passed from the main report. You can use two sub reports and one main report.



+1


source


You have to select two tables with "left-join", create a "GroupHeader / Footer" section in the report and set "DataField" under "GroupHeader" to the field that should be used as grouping.

Look at the samples from ActiveReports, they probably have a sample to group together.

0


source







All Articles