The present subject matter relates to the field of computing, and more particularly, to databases, although databases are merely an exemplary and non-limiting field of the presently disclosed subject matter.
A database may contain a myriad of entities. Such entities may have various attributes, and may be related in numerous ways, such that aggregations can be performed on them. Sometimes, reports may be desired for such entities, describing a particular entity or its relation to other entities. For example, in a typical warehouse database, one entity may correspond to products, and another entity may correspond to the customers who have purchased those products from the warehouse. The products entity may have attributes such as product identification, product model, product color, and so on; and, the customer entity may have attributes such as first name, last name, phone number, residence, and so on.
If a report is to be generated on what products a particular customer has bought, such a report could detail, for example, the customer's name and all the corresponding product model numbers. Additionally, this report could detail the total sales of all the products—i.e. the aggregate of all the sales of the products. The problem with providing such reports, at least when first deploying a database application, is that it is impractical to custom define reports for each entity—simply because of the vast number of entities (and their corresponding relationships to other entities) in a typical database. Therefore, it would be advantageous to provide mechanisms for auto-generating a report based on information that is already provided with entities, such as metadata.
Mechanisms are provided herein for auto-generating a report based on metadata. In one exemplary and non-limiting aspect of the present disclosure, at least one report is provided, where the at least one report comprises of any combination of an identifying information, an attribute information, and an aggregate information. The identifying information can identify an entity, the attribute information can correspond to attributes of the entity (or any related entities), and the aggregate information can correspond to aggregates associated with related entities.
Moreover, at least one metadata associated with the at least one report is provided, where the at least one metadata provides descriptive information about the entity. The at least one metadata can comprise of information relating the entity to at least one other entity. The at least one report is generated automatically and dynamically (at runtime) based on the at least one metadata, where the at least one report can also be configured to be customized by a customization mechanism.
Furthermore, the at least one report can be a single instance-type report that is generated when only one or a small number of instances of the entity will be displayed, or, alternatively, the at least one report can be a multi-instance-type report that is generated when many instances of the entity will be displayed. Interestingly, a user can customize the at least one report using the customization mechanism, or, alternatively, a computing device can customize the at least one report using the customization mechanism.
It should be noted that this Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
The foregoing Summary, as well as the following Detailed Description, is better understood when read in conjunction with the appended drawings. In order to illustrate the present disclosure, various aspects of the disclosure are shown. However, the disclosure is not limited to the specific aspects discussed. The following figures are included:
Aspects of Auto-Generating a Report Based on Metadata
The terminology used in the presently disclosed subject matter is well known to those of skill in the art. Thus, terms such as “entity,” “attribute,” “aggregation,” “role,” and so on, do not have to be expounded upon, other than to say that an “entity” may be a type or class of information that can be a subject of a query or other database functionality. The entity may have “attributes” (properties) and may be subject to “aggregations” (mathematical manipulations). A join may be the relationship between entities, and a “role” may be the direction of a “join,” and so on. This Detailed Description envisions all kinds of aspects of the subject matter relating to these terms, and those of skill in the art will readily recognize them.
A report 112 can be created for any particular entity (or a plurality of entities, for that matter). The report can detail not only interesting information for entity X 102, but information for the related entities, as mentioned. This may give the report a type of linking ability to link entity X 102 to the other entities. Thus, various relationships may be displayed in the report 112 that would otherwise not be apparent. This report 112, moreover, can be generated automatically so that no human intervention may be necessary—whether from developers or users. Furthermore, this report 112 can be generated dynamically at runtime, which may obviate the need for provided pre-manufactured reports. As entities change over time, so can their corresponding reports.
Next,
Moreover, the report 112 can also list attribute information 204 for entity X 102. This attribute information 204 may provide links to other entities (and hence to the corresponding identification and attribute information). A subset of all the available information may present to a user only the most relevant or apposite content available in the database. As those of skill in the art will readily appreciate, the attribute information 204 may designate, for example, if entity X 102 is a product, the color information, stock information, manufacture information, warranty information, and so on.
Lastly, the report 112 can contain aggregate information 206 for entity X 102. Aggregation information can consist of sums of data, maximum of data, minimum of data, and so on—just about any kind of functionality imaginable in a database. Interestingly, aggregation information may not only be limited to the entity X 102 itself, but may extend to any other related entities in the database. For example, if entity X 102 is a product, then the total sales, total warranties paid, total advertising expenditures, may be aggregated to come up with a final profit for the product.
Next,
Interestingly, the direction of drilling 314 which determines the cardinality of the target entity relative to an instance of the source entity may directly impact the generation 318 of a report associated with entity X 302. Because the cardinality of the target entity relative to an instance of the source entity in
In contrast,
The multi-type report 412 may focus, for example, on all the identification information of all the instances of entity X 402, not so much on the attributes of those instances—since focusing on the attributes of many instances of entity X 402 may deluge the multi-type report 412 to the point that it become unintelligible or uninformative. In contrast, the single-type report 312 of
The multi-type report 412 might focus on aggregation data on all the instances of entity X 402, whether that data may refer to total sales, total model numbers, and so on. In contrast, the single-type report 312 of
In short, a report that is generated for any entity, may depend on the traversal of a role and the cardinality expressed in that role. A single-type report 312 may focus on a single instance of an entity and from there relate any other entities and relevant aggregates. A multi-type report 412, on the other hand, may focus on multiple-instances of an entity of interest, including information such as identification information and any minimal attribute and relevant aggregate information. This much, however, is merely an exemplary summary of the subject matter discussed with reference to
Lastly,
Aspects of a General Implementation in Block Diagram Form
At block 602, metadata is obtained, where the metadata is associated with the entity. The metadata provides information about the various attributes of the entity and its relationships to other entities. Then, at block 604, the report is automatically and dynamically generated based on the metadata, where the report comprises of information relating to some combination of (a) the identification of the entity, (b) at least one attribute of the entity, and (c) aggregation of related entities to the entity.
As the report is about to be generated, its appearance and contents may depend on how roles between entities are being traversed. Thus, at block 606, if a role is traversed along a decreasing cardinality (i.e to a single-instance or few-instances entity), then at block 608 a single-type report (as explained above) is generated. Conversely, if a role is traversed along an increasing cardinality (i.e. to a multi-instance entity), then at block 610 a multi-type report (again, as explained above) is generated.
In either case, whether a single-type report is created, at block 608, or whether a multi-type report is created, at block 610, a decision is made, at block 612, whether an auto-generated report should be overridden—for example, in order to customize the report according to some particular need or standard. If the decision at block 612 is to customize the report, a customized report is generated. Customization can be of two sorts: 1) on the front-end where non-default templates are used to generate reports (as discussed with reference to
The various systems, methods, and techniques described herein may be implemented with hardware or software or, where appropriate, with a combination of both. Thus, the methods and apparatus of the present subject matter, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as floppy diskettes, CD-ROMs, hard drives, or any other machine-readable storage medium, wherein, when the program code is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the subject matter. In the case of program code execution on programmable computers, the computer will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. One or more programs are preferably implemented in a high level procedural or object oriented programming language to communicate with a computer system. However, the program(s) can be implemented in assembly or machine language, if desired. In any case, the language may be a compiled or interpreted language, and combined with hardware implementations.
The methods and apparatus of the present subject matter may also be embodied in the form of program code that is transmitted over some transmission medium, such as over electrical wiring or cabling, through fiber optics, or via any other form of transmission, wherein, when the program code is received and loaded into and executed by a machine, such as an EPROM, a gate array, a programmable logic device (PLD), a client computer, such as that shown in the figure below, a video recorder or the like, the machine becomes an apparatus for practicing the present subject matter. When implemented on a general-purpose processor, the program code combines with the processor to provide a unique apparatus that operates to perform the indexing functionality of the present subject matter.
Lastly, while the present disclosure has been described in connection with the preferred aspects, as illustrated in the various figures, it is understood that other similar aspects may be used or modifications and additions may be made to the described aspects for performing the same function of the present disclosure without deviating therefrom. For example, in various aspects of the disclosure, auto-generation of reports based on metadata was discussed. However, other equivalent mechanisms to these described aspects are also contemplated by the teachings herein. Therefore, the present disclosure should not be limited to any single aspect, but rather construed in breadth and scope in accordance with the appended claims.
The present application is related to application Ser. No. ______, filed _, entitled “Drill Through In Any Arbitrary Ad-hoc Report” [Attorney Docket No. MSFT-5575].