Implementing Reports data storage sub-libraries

Report project, there will be cases often come from different database report source data, that is, a report might read the same data from multiple business systems. For example: employee information taken from the HR system, sales data is removed from sale system. Of course, there is a possibility, the same database application system load is too large, forced into multiple databases, such as: sales system data into the current library and historical library.

In terms of the type of database, reporting tools may be connected to the same type of database, such as DB2, or are oracle; may also be of different types.

Reports have applications for the solution of this sub-library of data stored in two ways: 1, the construction of a dedicated data warehouse; 2, using the cross-database access technology.

Construction and management of specialized data warehouse is more complex, if a large amount of data is inefficient, but also continues to synchronize data ETL various application systems. Meanwhile, the use of a data warehouse is actually a traditional database technology, when faced with a large load will be faced with further sub-library. Data Warehouse schematic configuration as follows:

imagepng

If you use cross-database access technologies, such as Oracle transparent gateway, DB2 joint inquiry, we will encounter a lot of limitations. Relatively common question is: 1, the configuration is too much trouble, and often need to write database permissions; 2, to configure an alias for a table across the library; 3, when the data types are different types of databases, more intractable. 4, sql statement is limited, more difficult to achieve complex calculations. In this manner the following structural diagram:

imagepng

Now, with the first three kinds of solutions, that is, using the Run Dry statements (in conjunction with the calculator set to achieve). Its built-in set of calculation engine can be connected to multiple databases, unified data calculated after taking a few, so that it can better solve the problem of reporting data from different databases. Run Dry statements structure diagram of sub-library solve storage problems are as follows:

imagepng

By following "Sales sales report" Run Dry statements illustrate the process of resolving the problem of data storage and warehouses. Reports in the following figure:

imagepng

db2 database sales order data in the report comes from the sales system, employee information from the database db2 HR system. Run Dry statements developed using this report is as follows:

1, the configuration data source

Are respectively disposed two data sources, the sales system database "db2sales", HR database "db2HR" Dry Run Report in the vessel operator and the current collector.

2, scripting

You define a grid solver parameters set in the state, and write the calculation script:

  A
1 >salesdb=connect(“db2sales”)
2 >hrdb=connect(“db2HR”)
3 =salesdb.query(“select * from sales”)
4 =hrdb.query(“select * from employee”)
5 = A3.run (SELLERID=A4.select@1 (EID: A3.SELLERID))
6 =A5.select(SELLERID.STATE==state)
7 =A6.new(ORDERID,CLIENT,SELLERID.NAME:SELLERNAME,AMOUNT,ORDERDATE)
8 >salesdb.close()
9 >hrdb.close()
10 result A7

Code Description:

A1: db2sales connected preconfigured data source.

A2: db2HR connected preconfigured data source.

A3, A4: reading each sales employee table and a sequence table sequence from two data sources.

A5: the object's reference count set using the mechanism, and the sales employee sequence tables sequence tables by sellerid = eid association.

A6: according to the parameter state = "California" filtered sequence tables.

A7: generate a new sequence tables give the required fields.

A8,9: Close the database connection.

A10: report back to the set count.

3, configuration data set

Argstate parameters defined in the report designer, the operator sets the configuration data set:

imagepng

4, design the report as follows:

imagepng

After the calculated input parameters, can be obtained in front of the desired report.

Guess you like

Origin www.cnblogs.com/xiaohuihui-11/p/12097068.html