CN102446164A - Analytic method, device and operation system of report formula - Google Patents

Analytic method, device and operation system of report formula Download PDF

Info

Publication number
CN102446164A
CN102446164A CN2010105044898A CN201010504489A CN102446164A CN 102446164 A CN102446164 A CN 102446164A CN 2010105044898 A CN2010105044898 A CN 2010105044898A CN 201010504489 A CN201010504489 A CN 201010504489A CN 102446164 A CN102446164 A CN 102446164A
Authority
CN
China
Prior art keywords
temporary variable
formula
report form
expression
form formula
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
Application number
CN2010105044898A
Other languages
Chinese (zh)
Inventor
黄勇
乔昕明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kingdee Software China Co Ltd
Original Assignee
Kingdee Software China Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Kingdee Software China Co Ltd filed Critical Kingdee Software China Co Ltd
Priority to CN2010105044898A priority Critical patent/CN102446164A/en
Publication of CN102446164A publication Critical patent/CN102446164A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention is suitable for the filed of computer software, and provides an analytic method, a device and an operation system of report formula. The method includes that analyzing the report formula, establishing a temporary variable when the temporary variable is used for showing expression in analysis of the report formula, enabling the value of the expression to be stored in the temporary variable, and reading the value of the temporary variable when the temporary variable is quoted in the analysis of the report formula. The method uses the temporary variable to show the expression in the report formula, thereby avoiding repeated reference and repeated calculation of the same formula code in the report formula, improving execution efficiency, and being convenient to maintain. The action range of the temporary variable is only the current report formula.

Description

A kind of analytic method of report form formula, device and operation system
Technical field
The invention belongs to computer software fields, relate in particular to a kind of analytic method, device and operation system of report form formula.
Background technology
Traditional report tool is to carry out gathering, adding up of data through modes such as coding code, storing processs mostly.The advanced report tool of prior art is supported in mostly to be write formula and gathers, add up in the report form template, when carrying out form, by Report Engine resolve, the execution formula.Owing to write formula and can in report form tool, carry out, it writes the difficulty ratio, and to write code low, also is easy to safeguard, dispose, and become a kind of way of main flow at present.But under many circumstances, in order to realize the function of some relative complex, formula also often need be write longly, more complicated, the formula code that often duplicates, and make: formula becomes long, the readable reduction; When revising the code of repeating part, revise many places, maintainability is lower; Report Engine is when parsing, processing formula, and every place duplicated code all need repeatedly be handled, thereby efficient is carried out in influence.And the report tool that has is supported in defining named object in the report form template, but because its reach is a whole form, various complicated formulas are difficult to safeguard more for a long time in form.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of analytic method of report form formula, is intended to solve the problem of same equation code repeated citing in the report form formula.
The embodiment of the invention is achieved in that a kind of analytic method of report form formula, it is characterized in that, said method comprising the steps of:
Resolve report form formula;
When in being resolved to said report form formula, using the temporary variable expression, create said temporary variable, and the value of said expression formula is stored to said temporary variable;
When in being resolved to said report form formula, having quoted said temporary variable, then read the value of said temporary variable.
Another purpose of the embodiment of the invention is to provide a kind of resolver of report form formula, and said device comprises:
The Formula Parsing unit is used to resolve report form formula;
The variable calculating storaging unit is used in said Formula Parsing unit resolves creating said temporary variable, and the value of said expression formula being stored to said temporary variable when said report form formula uses the temporary variable expression;
The variate-value reading unit is used in said Formula Parsing unit resolves then reading the value of said temporary variable when said report form formula has been quoted said temporary variable.
Another purpose of the embodiment of the invention is to provide a kind of operation system, and said operation system comprises the resolver of said report form formula.
In embodiments of the present invention, through in report form formula, using the temporary variable expression, avoid the repeated citing of same equation code in the report form formula, shortened formula length, increased readability and dirigibility.When report form formula is resolved; Create this temporary variable when occur using the temporary variable expression first and the value of said expression formula is stored in the temporary variable; When this temporary variable appears in report form formula further part again, then directly call the value of the temporary variable of storage before this.Avoided the double counting of same equation code, improved execution efficient, and the reach of said temporary variable only is current report form formula, easy to maintenance.
Description of drawings
Fig. 1 is the process flow diagram of the analytic method of the report form formula that provides of the embodiment of the invention;
Fig. 2 is the synoptic diagram of the report form formula resolver that provides of the embodiment of the invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
The embodiment of the invention is represented the expression formula in the report form formula through in report form formula, using temporary variable.When said report form formula is resolved; When occur using temporary variable to represent in the said form publicity expression formula first; Be stored in the temporary variable after creating the value of this temporary variable and calculation expression, then directly call the value of the temporary variable of storage before this when this temporary variable appears in report form formula further part again.Avoided the repeated citing of same equation code in the report form formula.
The invention provides a kind of data management system and data association querying method and device:
Said method comprises:
Resolve report form formula;
When in being resolved to said report form formula, using the temporary variable expression, create said temporary variable, and the value of said expression formula is stored to said temporary variable;
When in being resolved to said report form formula, having quoted said temporary variable, then read the value of said temporary variable.
Said device comprises:
The Formula Parsing unit is used to resolve report form formula;
The variable calculating storaging unit is used in said Formula Parsing unit resolves creating said temporary variable, and the value of said expression formula being stored to said temporary variable when said report form formula uses the temporary variable expression;
The variate-value reading unit is used in said Formula Parsing unit resolves then reading the value of said temporary variable when said report form formula has been quoted said temporary variable.
For technical scheme of the present invention is described, describe through specific embodiment below.
Embodiment one:
Fig. 1 shows the realization flow of the parsing report form formula that the embodiment of the invention provides, and details are as follows:
In step S101, resolve report form formula;
In step S102, judge and whether used temporary variable to represent the expression formula in the said report form formula in the said report form formula, be execution in step S103 then, otherwise execution in step S104.
In embodiments of the present invention, the method for using the temporary variable expression as the embodiment of the invention provide like minor function:
Function is: (varID{ exp}), representes the expression formula in the said report form formula through temporary variable of this function definition to V.
Wherein:
Parameter varID is the identifier of said temporary variable, and span can be an integer, also can be the English character string, in a formula, can define one or more temporary variables arbitrarily;
Parameter exp is the expression formula in the report form formula of representing with said temporary variable.
When rreturn value is two parameters, return the execution result of exp, simultaneously execution result is deposited in the position of the temporary variable of varID appointment;
When rreturn value is a parameter, return the temporary variable of varID assigned address.
To specify for example below.For example, following report form formula is arranged:
The report form formula of prior art: if (and (sum (a1:a100)<100, sum (a1:a100)>0), 100,0);
The report form formula that the embodiment of the invention provides: if (and (V (1, sum (a1:a100))<100, V (1)>0), 100,0);
By on can know that in function V (1, sum (a1:a100)), this is first temporary variable that is provided with for 1 expression, said temporary variable is in order to expression sum (a1:a100).When expression formula sum (a1:a100) appears in report form formula further part again, quote temporary variable V (1) expression.
In step S103, create said temporary variable, calculate the value of said expression formula and be stored in the said temporary variable.After executing this step, return execution in step S101.
In embodiments of the present invention, temporary variable occurring for the first time, is to represent the expression formula in the report form formula with this temporary variable.When in report form formula, being resolved to when using the temporary variable expression, create said temporary variable, and the expression formula represented according to temporary variable, calculate the value of said expression formula, the value of this expression formula is stored in the temporary variable.After being finished, continue to resolve said report form formula.
Example shown in above-mentioned step can be known, in function V (1, sum (a1:a100)), with a temporary variable V (1) expression sum (a1:a100).Then this moment, create this temporary variable V (1), the value of calculation expression sum (a1:a100), and this value is stored in the temporary variable.
In step S104, judge and whether quoted said temporary variable in the said report form formula, be execution in step S105 then, otherwise execution in step S106.
In embodiments of the present invention,, be not resolved to when using the temporary variable expression, then continue analysis judgment and whether quoted said temporary variable when when resolving report form formula.
In step S105, read the value of said temporary variable.After accomplishing this step, return execution in step S101.
In embodiments of the present invention, when the report form formula further part is quoted said temporary variable, directly read the value of said temporary variable, avoided the double counting of same equation code.After being finished, continue to resolve said report form formula.
By above-mentioned example, can know that then directly read the value of the temporary variable V (1) of storage if quote V (1) this moment.
In step S106, judge whether said report form formula resolves completion, be execution in step S107 then, otherwise execution in step S101.
In embodiments of the present invention, when resolving report form formula, not only be not resolved to and used the temporary variable expression but also be not resolved to when quoting said temporary variable, and then continued the said report form formula of analysis judgment and whether resolve completion.
In embodiments of the present invention, do not accomplish, then return step S101 and continue to resolve said report form formula if said report form formula is also resolved.
In step S107, finish to resolve said report form formula.
Embodiment two:
Fig. 2 shows the structure of the report form formula resolver that the embodiment of the invention provides, and for the ease of explanation, only shows the part relevant with the embodiment of the invention.This report form formula resolver can be to be built in the unit that software unit, hardware cell or software and hardware in the operation system combine, and perhaps is integrated in the application system of operation system or operation system as suspension member independently.Wherein:
Formula Parsing unit 1 is used to resolve report form formula.
Variable calculating storaging unit 2 is used in said Formula Parsing unit resolves creating said temporary variable, and the value of said expression formula being stored to said temporary variable when said report form formula uses the temporary variable expression.
In embodiments of the present invention, use the temporary variable expression as the embodiment of the invention provide like minor function:
Function is: (varID{ exp}), representes the expression formula in the said report form formula through temporary variable of this function definition to V.
Wherein:
Parameter varID is the identifier of said temporary variable, and span can be an integer, also can be the English character string, in a formula, can define one or more temporary variables arbitrarily;
Parameter exp is the expression formula in the report form formula of representing with said temporary variable.
Variate-value reading unit 3 is used in said Formula Parsing unit resolves then reading the value of said temporary variable when said report form formula has been quoted said temporary variable.
In embodiments of the present invention, through in report form formula, using the temporary variable expression, avoid the repeated citing of same equation code in the report form formula, shortened formula length, increased readability and dirigibility.When report form formula is resolved; Create this temporary variable when occur using the temporary variable expression first and the value of said expression formula is stored in the temporary variable; When this temporary variable appears in report form formula further part again, then directly call the value of the temporary variable of storage before this.Avoided the double counting of same equation code, improved execution efficient, and the reach of said temporary variable only is current report form formula, easy to maintenance.
The above is merely preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of within spirit of the present invention and principle, being done, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.

Claims (5)

1. the analytic method of a report form formula is characterized in that, said method comprises the steps:
Resolve report form formula;
When in being resolved to said report form formula, using the temporary variable expression, create said temporary variable, and the value of said expression formula is stored to said temporary variable;
When in being resolved to said report form formula, having quoted said temporary variable, then read the value of said temporary variable.
2. the method for claim 1 is characterized in that, the said method of temporary variable expression of in said report form formula, using comprises:
Through function V (varID{, exp}) definition temporary variable represent the expression formula in the said report form formula, wherein:
Parameter varID is the identifier of said temporary variable,
Parameter exp is the expression formula in the report form formula of representing with said temporary variable.
3. the resolver of a report form formula is characterized in that, said device comprises:
The Formula Parsing unit is used to resolve report form formula;
The variable calculating storaging unit is used in said Formula Parsing unit resolves creating said temporary variable, and the value of said expression formula being stored to said temporary variable when said report form formula uses the temporary variable expression;
The variate-value reading unit is used in said Formula Parsing unit resolves then reading the value of said temporary variable when said report form formula has been quoted said temporary variable.
4. device as claimed in claim 3 is characterized in that, uses the temporary variable expression to comprise in the described report form formula:
Through function V (varID{, exp}) definition temporary variable represent the expression formula in the said report form formula, wherein:
Parameter varID is the identifier of said temporary variable,
Parameter exp is the expression formula in the report form formula of representing with said temporary variable.
5. an operation system is characterized in that, said system comprises the resolver of the described report form formula of the arbitrary claim of claim 3 to 4.
CN2010105044898A 2010-10-12 2010-10-12 Analytic method, device and operation system of report formula Pending CN102446164A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010105044898A CN102446164A (en) 2010-10-12 2010-10-12 Analytic method, device and operation system of report formula

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010105044898A CN102446164A (en) 2010-10-12 2010-10-12 Analytic method, device and operation system of report formula

Publications (1)

Publication Number Publication Date
CN102446164A true CN102446164A (en) 2012-05-09

Family

ID=46008668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010105044898A Pending CN102446164A (en) 2010-10-12 2010-10-12 Analytic method, device and operation system of report formula

Country Status (1)

Country Link
CN (1) CN102446164A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019728A (en) * 2012-12-20 2013-04-03 厦门亿力吉奥信息科技有限公司 Effective complex report parsing engine and parsing method thereof
CN108268437A (en) * 2016-12-30 2018-07-10 航天信息股份有限公司 The method and device of formula manipulation
CN108959571A (en) * 2018-07-04 2018-12-07 上海达梦数据库有限公司 Operation method, device, terminal device and the storage medium of SQL statement
CN109727144A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Insure Incidence calculus method, apparatus, equipment and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060085386A1 (en) * 2004-10-19 2006-04-20 Microsoft Corporation Two pass calculation to optimize formula calculations for a spreadsheet
CN101556579A (en) * 2009-05-08 2009-10-14 用友软件股份有限公司 Formula processing system used for dynamic report areas and method thereof
CN101599067A (en) * 2009-06-02 2009-12-09 广东金宇恒科技有限公司 A kind of method of self-customizing report forms

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060085386A1 (en) * 2004-10-19 2006-04-20 Microsoft Corporation Two pass calculation to optimize formula calculations for a spreadsheet
CN101556579A (en) * 2009-05-08 2009-10-14 用友软件股份有限公司 Formula processing system used for dynamic report areas and method thereof
CN101599067A (en) * 2009-06-02 2009-12-09 广东金宇恒科技有限公司 A kind of method of self-customizing report forms

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019728A (en) * 2012-12-20 2013-04-03 厦门亿力吉奥信息科技有限公司 Effective complex report parsing engine and parsing method thereof
CN103019728B (en) * 2012-12-20 2015-07-15 厦门亿力吉奥信息科技有限公司 Effective complex report parsing engine and parsing method thereof
CN108268437A (en) * 2016-12-30 2018-07-10 航天信息股份有限公司 The method and device of formula manipulation
CN109727144A (en) * 2018-05-31 2019-05-07 中国平安人寿保险股份有限公司 Insure Incidence calculus method, apparatus, equipment and computer readable storage medium
CN109727144B (en) * 2018-05-31 2023-06-27 中国平安人寿保险股份有限公司 Insurance occurrence rate calculation method, apparatus, device and computer readable storage medium
CN108959571A (en) * 2018-07-04 2018-12-07 上海达梦数据库有限公司 Operation method, device, terminal device and the storage medium of SQL statement
CN108959571B (en) * 2018-07-04 2020-12-04 上海达梦数据库有限公司 SQL statement operation method and device, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107577483B (en) Method, storage medium, equipment and the system of component engineering calling main works code
CN103049251B (en) A kind of data base persistence layer device and database operation method
CN101788906B (en) Resource management method and system thereof
CN104035754A (en) XML (Extensible Markup Language)-based custom code generation method and generator
CN101354759A (en) Method and system of work process flow defining conversion based on element model
CN106600700B (en) Three-dimensional model data processing system
CN104216961A (en) Method and device for data processing
CN103593456A (en) Form user-defined design method and device
CN102810184A (en) Method and device for dynamically executing workflow and enterprise system
CN103927385A (en) Unifying method and device of data model
CN102446164A (en) Analytic method, device and operation system of report formula
CN109783802A (en) A kind of business rule processing method, server and computer readable storage medium
CN105279269A (en) SQL generating method and system for supporting table free association
CN104391991A (en) Method for converting AutoCAD data into GIS spatial data
CN106126564A (en) A kind of method rendered based on dynamic template language
CN105975489A (en) Metadata-based online SQL code completion method
CN103399735A (en) Method for developing intermediate layer of remote function call interface
CN107526746A (en) The method and apparatus of management document index
CN101710273A (en) Method and device for analyzing multi-dimensional query sentence in online analysis processing server
CN108228168A (en) A kind of revocation, the abstract method of recovery operation
CN102929853A (en) DCS (Data Communication System) project data generating system and method based on Excel sheet association
CN113094039B (en) Automatic code generation system based on database table
CN104572666A (en) Method for analyzing and importing Excel into database in batch based on Jxl
CN105260266A (en) Snapshot volume writing method and dependent snapshot system
CN101894024B (en) Model bank-based model element consistency ensuring method

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

Application publication date: 20120509