CN101751436A - Method and system for generating reports - Google Patents
Method and system for generating reports Download PDFInfo
- Publication number
- CN101751436A CN101751436A CN200810240332A CN200810240332A CN101751436A CN 101751436 A CN101751436 A CN 101751436A CN 200810240332 A CN200810240332 A CN 200810240332A CN 200810240332 A CN200810240332 A CN 200810240332A CN 101751436 A CN101751436 A CN 101751436A
- Authority
- CN
- China
- Prior art keywords
- data
- report
- main
- database
- querying condition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 238000004321 preservation Methods 0.000 claims 1
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明提供一种生成报表的方法及装置,以解决现有技术中对多个报表的数据查询时操作复杂以及产生数据查询错误的问题。通过实施例阐述了如下方法:对于选取的主报表,设置主报表中的区域与预设的查询条件之间的对应关系,所述查询条件用于从数据库中确定关联报表内的数据;接收用户发出的指定了主报表区域的查询命令,根据所述对应关系得到该查询命令指定的主报表区域对应的查询条件;根据得到的查询条件从数据库中确定关联报表内的数据然后根据该数据生成关联报表。实施例中给出了相应的装置。根据本发明的技术方案,能够简化报表数据查询操作并避免数据查询出现错误。
The invention provides a method and device for generating reports to solve the problems of complex operation and data query errors in the prior art when querying data of multiple reports. The following method is described through the embodiment: for the selected main report, the corresponding relationship between the area in the main report and the preset query condition is set, and the query condition is used to determine the data in the associated report from the database; The query command that specifies the main report area is issued, and the query condition corresponding to the main report area specified by the query command is obtained according to the corresponding relationship; the data in the associated report is determined from the database according to the obtained query condition, and then the associated report is generated according to the data. report. The corresponding devices are given in the examples. According to the technical scheme of the invention, the report data query operation can be simplified and data query errors can be avoided.
Description
技术领域technical field
本发明涉及业务技撑技术领域,特别地涉及一种生成报表的方法及装置。The present invention relates to the technical field of business technical support, in particular to a method and device for generating reports.
背景技术Background technique
目前,有多种生成报表的方法及系统,例如在一篇申请号为CN01139172.3的中国专利申请文件中公开了如下方法:从数据源中攫取报表数据;将数据进行适于表格的结构化描述;按照需要选择报表格式数据项;利用进程间通信技术调用通用表格处理进程,将攫取的报表数据、按照选择的表格数据项内容生产报表文件。At present, there are many methods and systems for generating reports. For example, the following method is disclosed in a Chinese patent application document with the application number CN01139172.3: grab report data from the data source; structure the data suitable for the form Description; select report format data items as required; use inter-process communication technology to call the general form processing process, and generate report files from the captured report data according to the content of the selected form data items.
又如在一篇申请号为CN200710173359.9的中国专利申请文件中公开的通用报表制作装置包括:数据库,存储数据源的数据;数据源定义文件生成模块,定义数据源位置;报表文件生成模块,生成报表文件;报表服务器,存储数据源定义文件和报表文件;登陆模块,供用户登陆报表服务器;验证模块,验证用户身份;参数传递模块,根据登陆用户身份,将数据源定义文件中对应的参数传递给报表文件;读取接口模块,根据参数形成通用性输入控件,接收用户选择;数据源推送模块,根据该用户选择将数据库中存储的数据源数据推送到报表文件中,以生成最终提供给登陆用户的报表文件。Another example is that the general report production device disclosed in a Chinese patent application document with the application number CN200710173359.9 includes: a database for storing data source data; a data source definition file generation module for defining the location of the data source; a report file generation module, Generate report files; report server, store data source definition files and report files; login module, for users to log in to report server; Pass it to the report file; read the interface module, form a general input control according to the parameters, and receive the user's choice; the data source push module pushes the data source data stored in the database to the report file according to the user's choice, so as to generate the final data provided to the report file. Login user's report file.
根据上述专利公开的技术方案,以及现有技术中的其他技术方案,在进行多个报表中的数据查询时,为了从数据库中确定报表内的数据,每次查询之前需设定查询条件,操作较为繁琐,而且可能因为查询条件设定不当而导致不同报表的同类数据查询结果不一致,从而产生数据查询错误。According to the technical solution disclosed in the above-mentioned patent and other technical solutions in the prior art, when performing data query in multiple reports, in order to determine the data in the report from the database, query conditions need to be set before each query, and the operation It is cumbersome, and may cause inconsistencies in the query results of the same type of data in different reports due to improper setting of query conditions, resulting in data query errors.
发明内容Contents of the invention
本发明的主要目的是提供一种生成报表的方法及装置,以解决现有技术中对多个报表的数据查询时操作复杂以及产生数据查询错误的问题。The main purpose of the present invention is to provide a method and device for generating reports, so as to solve the problems of complex operation and data query errors in the prior art when querying data of multiple reports.
为解决上述问题,本发明提供如下的技术方案:In order to solve the above problems, the present invention provides the following technical solutions:
一种生成报表的方法,包括:A method of generating a report comprising:
对于选取的主报表,设置主报表中的区域与预设的查询条件之间的对应关系,所述查询条件用于从数据库中确定关联报表内的数据;For the selected main report, the corresponding relationship between the area in the main report and the preset query condition is set, and the query condition is used to determine the data in the associated report from the database;
接收用户发出的指定了主报表区域的查询命令,根据所述对应关系得到该查询命令指定的主报表区域对应的查询条件;receiving a query command specifying a main report area issued by a user, and obtaining a query condition corresponding to the main report area specified by the query command according to the corresponding relationship;
根据得到的查询条件从数据库中确定关联报表内的数据然后根据该数据生成关联报表。Determine the data in the associated report from the database according to the obtained query conditions, and then generate an associated report based on the data.
一种生成报表的装置,包括:A device for generating reports, comprising:
第一存储模块,用于保存设置的主报表中的区域与预设的查询条件之间的对应关系,所述查询条件用于从数据库中确定关联报表内的数据;The first storage module is used to save the corresponding relationship between the areas in the set main report and the preset query conditions, and the query conditions are used to determine the data in the associated report from the database;
确定模块,用于接收用户发出的指定主报表区域的查询命令,根据所述对应关系得出该查询命令指定的主报表区域对应的查询条件;A determination module, configured to receive a query command for specifying a main report area issued by a user, and obtain a query condition corresponding to the main report area specified by the query command according to the corresponding relationship;
生成模块,用于根据确定的关联报表查询条件从数据库中确定关联报表内的数据然后根据该数据生成关联报表。The generation module is used to determine the data in the associated report from the database according to the determined query condition of the associated report, and then generate the associated report according to the data.
根据本发明的技术方案,在主报表的区域与关联报表查询条件之间建立了对应关系,通过在主报表中选择区域来实现关联报表的数据获取以及关联报表的生成,这样对关联报表的查询能够通过在主报表中进行区域选择来实现,只需呈现主报表即可进行关联报表的数据查询,因此无需在每次查询关联报表时设定查询条件,操作较为简便;并且由于关联报表的查询条件为预先设置,该查询条件能够预先测试确认无误,所以能够保证在进行关联报表的数据查询时给出正确的查询条件,进而保证了数据查询的正确性。According to the technical scheme of the present invention, a corresponding relationship is established between the area of the main report and the query condition of the associated report, and the data acquisition of the associated report and the generation of the associated report are realized by selecting the area in the main report, so that the query of the associated report It can be realized by selecting the area in the main report, and the data query of the associated report can be performed only by presenting the main report, so there is no need to set the query condition every time the associated report is queried, and the operation is relatively simple; and because the query of the associated report The conditions are pre-set, and the query conditions can be pre-tested and confirmed to be correct, so it can ensure that the correct query conditions are given when performing data query of the associated report, thereby ensuring the correctness of the data query.
附图说明Description of drawings
图1为本发明实施例中的方法流程图;Fig. 1 is the method flowchart in the embodiment of the present invention;
图2为本发明实施例中主报表与关联报表示意图;Fig. 2 is a schematic diagram of a main report and an associated report in an embodiment of the present invention;
图3为本发明实施例中的报表生成装置结构示意图。Fig. 3 is a schematic structural diagram of a report generation device in an embodiment of the present invention.
具体实施方式Detailed ways
为了简化对多个报表的数据查询的操作并且避免数据查询错误,在本发明实施例中,根据主报表以及设置的对应关系生成关联报表,具体如图1所示,包含如下步骤:In order to simplify the operation of data query of multiple reports and avoid data query errors, in the embodiment of the present invention, an associated report is generated according to the corresponding relationship between the main report and the settings, as shown in Figure 1 specifically, including the following steps:
步骤11:设置主报表查询条件。Step 11: Set the main report query conditions.
步骤12:根据主报表查询条件从数据库中获取主报表数据。Step 12: Obtain the main report data from the database according to the query conditions of the main report.
在上述两步中,将满足设置的查询条件的数据从数据库中取出,查询条件可以是对数据类别的描述,即属于所描述的数据类别则满足了查询条件,该数据类别根据报表的内容预先加以设定。如图2中,A表21为主报表,例如对数据类别的描述是:“统计周期:2008年1月、区域:东城区、指标名称:用户数;指标值”,则满足该数据类别的数据为:“1,275户”,于是从数据库中获取该数据。In the above two steps, the data that meets the set query conditions are taken out from the database. The query conditions can be a description of the data category, that is, the query conditions are met if the data category belongs to the description. The data category is pre-set according to the content of the report be set. As shown in Figure 2,
步骤13:根据获取的主报表数据生成主报表。Step 13: Generate a main report according to the obtained main report data.
在步骤11中可以设置多项查询条件,并且步骤12中相应地得到多个数据,于是在步骤13中生成的主报表也包含了多项条目,可以根据规定的表格结构输出报表,例如将“统计周期”、“区域”、“用户数”和“指标值”设置为表头,对应的描述以及获取的数据表格作为内容,按这种结构输出的主报表如图2所示的A表21。主报表的界面可以利用已公开的代码或控件实现,如可以利用java EXCEL API等提供类似于EXCEL的表格格式设计界面,并将设计好的表格格式以XML文件等形式保存到报表定义库中,实现所见即所得的报表格式定义及存储功能。Multiple query conditions can be set in
经过上述三个步骤之后得到了主报表,接下来对主报表进行下述步骤的设置,使得能够根据主报表得到关联报表。在应用中也可以选取已有的报表,将其作为主报表然后进行下述步骤的设置。After the above three steps, the main report is obtained, and then the main report is set in the following steps, so that the associated report can be obtained according to the main report. In the application, you can also select an existing report, use it as the main report, and then perform the settings in the following steps.
步骤14:设置关联报表的查询条件。与主报表的查询条件类似,关联报表的查询条件用于从数据库中确定关联报表内的数据。主报表的数据也可以来自于该数据库,即该数据库包含有主报表的数据源。关联报表的查询条件可以是关联报表数据的类别,该类别预先设定。例如B表24为关联报表,数据的类别可以描述为:“统计周期:2008年1月、区域:东城区、财务科目:所有科目、新客户:所有新客户”,则满足该类别的数据为:“201、312......”。Step 14: Set query conditions for associated reports. Similar to the query condition of the main report, the query condition of the associated report is used to determine the data in the associated report from the database. The data of the main report can also come from the database, that is, the database contains the data source of the main report. The query condition of the associated report may be the category of the associated report data, and the category is preset. For example,
步骤15:设置主报表中的区域与关联报表查询条件之间的对应关系。在本步骤中,主报表中的区域可以是主报表的一个或多个单元格。例如可以设置单元格22与关联报表B表24的查询条件相对应,也可以设置多个单元格23与关联报表B表24的查询条件相对应。以设置单元格22与关联报表B表24的查询条件之间的对应关系为例,该对应关系可以描述为:“单元格22--统计周期:2008年1月;区域:东城区;财务科目:所有科目;新客户;老客户”。Step 15: Set the corresponding relationship between the areas in the main report and the query conditions of the associated report. In this step, the range in the main report can be one or more cells of the main report. For example, the
步骤16:确定关联报表查询条件。具体是根据在主报表中选择的区域,按步骤15中设置的对应关系确定关联报表查询条件。本步骤在主报表中选择区域,可以是通过终端设备的操作来进行选择,例如用鼠标点击主报表中设置的区域。为此,应当在主报表中预设可选区域,该区域在步骤15中进一步设置了所述的对应关系,例如将单元格22设置为可选,并且在步骤15中针对该单元格设置了所述的对应关系。则在步骤16中,当点击该单元格即为选中,此时根据单元格22与关联报表B表24的对应关系“单元格22--统计周期:2008年1月;区域:东城区;财务科目:所有科目;新客户;老客户”确定查询条件,具体为:“统计周期:2008年1月;区域:东城区;财务科目:所有科目;新客户;老客户”,即要求查询统计周期为2008年1月、区域为东城区、财务科目为所有科目的新客户及老客户数量。Step 16: Determine the query conditions of the associated report. Specifically, according to the area selected in the main report, the query conditions of the associated report are determined according to the corresponding relationship set in
步骤17:根据确定的关联报表查询条件从数据库中获取关联报表数据。以查询条件“统计周期:2008年1月;区域:东城区;财务科目:所有科目;新客户;老客户”为例,则从数据库中获取统计周期为2008年1月、区域为东城区、财务科目为所有科目的新客户及老客户数量,其数值分别如图2中方框25中的各单元格中所示。关联报表和主报表可以基于同一数据库生成,因此本步骤中的数据库可以是包含了主报表数据源的数据库,在本步骤中从该数据库中获取关联报表数据。Step 17: Obtain associated report data from the database according to the determined associated report query conditions. Taking the query condition "statistical period: January 2008; region: Dongcheng District; financial subjects: all subjects; new customers; old customers" as an example, the statistical period obtained from the database is January 2008, the region is Dongcheng District, The financial subject is the number of new customers and old customers of all subjects, and its values are shown in the cells in
步骤18:根据步骤17中获取的数据生成关联报表。在本步骤中,生成关联报表之前可以先设置关联报表的格式,包括各种表头信息和表格的颜色等,然后将数据填入相应位置的单元格。在本步骤中还可以根据预设的统计规则对数据作进一步统计并加入报表,例如B表24中右端一列26中的各单元格内的数值以及底部一行27中的各单元格内的数值。Step 18: Generate an associated report according to the data obtained in
在完成步骤18之后即获得了关联报表B表24。在应用中可以将B表24保存在数据库中并向其分配一个唯一的报表编号,然后保存A表21中的单元格22与B表24的编号之间的对应关系,当选中A表21中的单元格22时,根据该对应关系确定B表24的编号,然后在数据库中查找具有该编号的报表,得到B表24。After
另外,对于主报表A表21,它的其他单元格也可以如同单元格22一样具有与关联报表之间的对应关系,根据类似于获取关联报表B表24的方法,可以根据单元格28获取单联报表C表29。In addition, for the main report A table 21, its other cells can also have the corresponding relationship with the associated report like the
根据本发明实施例中的方法,相应的生成报表的装置如图3所示。图3中报表生成装置30用于生成报表,其包括第一存储模块31、确定模块32和生成模块33。第一存储模块31用于保存设置的主报表中的区域与预设的查询条件之间的对应关系,该查询条件用于从数据库中确定关联报表内的数据;还可以进一步用于对应于主报表中的每个区域保存设置的该区域与预设的关联报表查询条件之间的对应关系。确定模块32用于接收用户发出的指定主报表区域的查询命令,根据所述对应关系得出该查询命令指定的主报表区域对应的查询条件。生成模块33用于根据确定的关联报表查询条件从数据库中确定关联报表内的数据然后根据该数据生成关联报表。According to the method in the embodiment of the present invention, the corresponding device for generating a report is shown in FIG. 3 . The
第一存储模块31进一步用于保存关联报表数据的类别,这样,确定模块32进一步用于根据关联报表数据的类别,从数据库中确定属于该类别的数据。The
在报表生成装置30的基础上还可以增添第二存储模块,用于保存设置的主报表查询条件,这样,生成模块33进一步用于根据设置的关联报表格式,将关联报表内的数据填入相应的位置得到关联报表。On the basis of the
根据本发明的技术方案,在主报表的区域与关联报表查询条件之间建立了对应关系,通过在主报表中选择区域来实现关联报表的数据获取以及关联报表的生成,这样对关联报表的查询能够通过在主报表中进行区域选择来实现,只需呈现主报表即可进行关联报表的数据查询,因此无需在每次查询关联报表时设定查询条件,操作较为简便;并且由于关联报表的查询条件为预先设置,该查询条件能够预先测试确认无误,所以能够保证在进行关联报表的数据查询时给出正确的查询条件,进而保证了数据查询的正确性。According to the technical scheme of the present invention, a corresponding relationship is established between the area of the main report and the query condition of the associated report, and the data acquisition of the associated report and the generation of the associated report are realized by selecting the area in the main report, so that the query of the associated report It can be realized by selecting the area in the main report, and the data query of the associated report can be performed only by presenting the main report, so there is no need to set the query condition every time the associated report is queried, and the operation is relatively simple; and because the query of the associated report The conditions are pre-set, and the query conditions can be pre-tested and confirmed to be correct, so it can ensure that the correct query conditions are given when performing data query of the associated report, thereby ensuring the correctness of the data query.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810240332A CN101751436A (en) | 2008-12-19 | 2008-12-19 | Method and system for generating reports |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200810240332A CN101751436A (en) | 2008-12-19 | 2008-12-19 | Method and system for generating reports |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101751436A true CN101751436A (en) | 2010-06-23 |
Family
ID=42478427
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN200810240332A Pending CN101751436A (en) | 2008-12-19 | 2008-12-19 | Method and system for generating reports |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101751436A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118264A (en) * | 2010-12-20 | 2011-07-06 | 大唐移动通信设备有限公司 | Method and device for generating performance report |
CN102279951A (en) * | 2011-08-16 | 2011-12-14 | 中国民生银行股份有限公司 | Report information processing method and system |
CN103198071A (en) * | 2012-01-06 | 2013-07-10 | 中国移动通信集团山东有限公司 | Data report generation method and device adopting same |
CN103488692A (en) * | 2013-09-02 | 2014-01-01 | 用友软件股份有限公司 | Data query system and data query method |
CN103793389A (en) * | 2012-10-29 | 2014-05-14 | 金蝶软件(中国)有限公司 | Method and device for processing query data |
CN105069069A (en) * | 2015-07-30 | 2015-11-18 | 成都亿盟恒信科技有限公司 | Method for quickly associating multiple statistical reports |
WO2018161402A1 (en) * | 2017-03-10 | 2018-09-13 | 深圳市科脉技术股份有限公司 | Method and system for processing modular packaged reports |
-
2008
- 2008-12-19 CN CN200810240332A patent/CN101751436A/en active Pending
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102118264A (en) * | 2010-12-20 | 2011-07-06 | 大唐移动通信设备有限公司 | Method and device for generating performance report |
CN102118264B (en) * | 2010-12-20 | 2013-08-21 | 大唐移动通信设备有限公司 | Method and device for generating performance report |
CN102279951A (en) * | 2011-08-16 | 2011-12-14 | 中国民生银行股份有限公司 | Report information processing method and system |
CN103198071A (en) * | 2012-01-06 | 2013-07-10 | 中国移动通信集团山东有限公司 | Data report generation method and device adopting same |
CN103198071B (en) * | 2012-01-06 | 2016-05-25 | 中国移动通信集团山东有限公司 | Datagram table generating method and device thereof |
CN103793389A (en) * | 2012-10-29 | 2014-05-14 | 金蝶软件(中国)有限公司 | Method and device for processing query data |
CN103793389B (en) * | 2012-10-29 | 2017-10-24 | 金蝶软件(中国)有限公司 | Inquire about the treating method and apparatus of data |
CN103488692A (en) * | 2013-09-02 | 2014-01-01 | 用友软件股份有限公司 | Data query system and data query method |
CN105069069A (en) * | 2015-07-30 | 2015-11-18 | 成都亿盟恒信科技有限公司 | Method for quickly associating multiple statistical reports |
WO2018161402A1 (en) * | 2017-03-10 | 2018-09-13 | 深圳市科脉技术股份有限公司 | Method and system for processing modular packaged reports |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CA2819359C (en) | Using text messages to interact with spreadsheets | |
CN101751436A (en) | Method and system for generating reports | |
US20080201338A1 (en) | Rest for entities | |
CN107977396B (en) | Method and device for updating data table of KeyValue database | |
CN103559619A (en) | Response method and system for garment size information | |
CN109615172A (en) | A kind of method and terminal handling examination data | |
CN112817973A (en) | Data processing method, data processing device, data processing equipment and storage medium | |
CN110516220B (en) | Report data input method, system and related equipment | |
CN105868196A (en) | Method for generating industrial data report in server | |
CN110414259A (en) | A kind of method and apparatus for constructing data element, realizing data sharing | |
CN101976394A (en) | Data acquiring and counting system and method | |
CN110737432A (en) | script aided design method and device based on root list | |
CN110362630B (en) | Data management method, device, equipment and computer-readable storage medium | |
CN112650777A (en) | Data warehouse manufacturing method and device, terminal equipment and computer storage medium | |
CN103440197B (en) | A kind of method automatically generating difference test report based on contrast test | |
CN112162951A (en) | Information retrieval method, server and storage medium | |
CN102402616B (en) | Method and system for realizing database cluster | |
CN111026972B (en) | Subscription data pushing method, device, equipment and storage medium in Internet of things | |
CN106445824A (en) | Interface comprehensiveness management system based on character | |
US20210141791A1 (en) | Method and system for generating a hybrid data model | |
CN108984156A (en) | A kind of software auto generating method and system for exempting from code development based on template | |
WO2019080419A1 (en) | Method for building standard knowledge base, electronic device, and storage medium | |
CN110019456B (en) | Data import method, device and system | |
CN110287218A (en) | A kind of matched method of tax revenue sorting code number, system and equipment | |
CN115496044A (en) | Online table data generation method, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Open date: 20100623 |