This tutorial covers assigning multiple database connections in a grid and populating a grid with data from multiple database connections with formulas.
Approximately 30 minutes
This tutorial covers the following topics:
When you add a grid to a report, you specify its database connection. You can also populate the grid with data from multiple database connections. After defining the grid’s initial database connection, dimension layout, and members, you can change the database connection of data rows or data columns to retrieve data from another database connection.
When you change the database connection of data rows or data columns, the dimension names for the new database connection may be different from the grid’s initial database connection. You maintain the integrity of the data structure by mapping the dimensions from the initial database connection to the new database connection. If the structure of the new database connection differs from that of the grid’s initial database connection, the report cannot repopulate.
Limitations for multiple database connections in a grid:
In a grid, you can also retrieve data from multiple database connections with formulas. You add multiple grids to a report, where each grid retrieves data from a different database connection. In one grid, you can then display data from another grid with formulas.
In Reporting Studio, you add a grid in the report to retrieve data from a database connection. You add data rows and data columns to the grid. You also add rows to the grid that retrieve data from a different database connection. The multiple database connections in the grid must be of the same type and should have a similar structure.
To demonstrate a better way to retrieve data from multiple database connections in a grid, you add a second grid to the report. The second grid retrieves data from a different database connection. In the first grid, you then reference the data from the second grid with formulas. You use text functions to display the correct member names for the formulas and you hide the display of the second grid in the report.
Given the limitations of multiple database connections within one grid, the second solution with multiple grids is recommended.
Before starting this tutorial, you should:
In Reporting Studio, you add a grid in the report to retrieve data from a database connection. You add data rows and data columns to the grid. You also add rows to the grid that retrieve data from a different database connection.
Limitations for multiple database connections in a grid:
To populate a grid with data from multiple database connections, perform these steps:
By default, row 6 retrieves data from the Sample:Basic database connection.
You do not map dimensions that are in the Point of View.
For Sample:Basic, select these user POV members:
Dimension | Member |
---|---|
Year | Year |
Measures | Profit |
Scenario | Actual |
For Demo:Basic, select these user POV members:
Dimension | Member |
---|---|
Year | Year |
Measures | Profit |
Scenario | Actual |
To demonstrate a better way to retrieve data from multiple database connections in a grid, you add a second grid to the report. The second grid retrieves data from a different database connection. In the first grid, you reference the data from the second grid with formulas. You use text functions to display the correct member names for the formulas and you hide the display of the second grid in the report.
To populate a grid with data from another grid by using formulas, perform these steps:
In row 6, enter the formula Grid2.row[1] to retrieve the data from row 1 of Grid2.
In row 7, enter the formula Grid2.row[2] to retrieve the data from row 2 of Grid2.
Select the heading for row 6. On the Heading Row Properties sheet, select Custom Heading. In the Custom Heading box, enter the MemberName function to retrieve the member name from row 1 of Grid2. The function syntax is <<MemberName("Grid2", 1, "Product")>>. The dimension name must be spelled exactly as it is in the database.
Repeat this step for row 7 to retrieve the member name from row 2 of Grid2. The function syntax is <<MemberName("Grid2", 2, "Product")>>.
In the first 4 rows, the report displays data from the Sample:Basic database connection. In the last 2 rows, the report displays data from the Demo:Basic database connection.
In this tutorial, you've learned how to: