Summary of the invention
In view of the above problems, it is proposed that the present invention is to provide one to overcome the problems referred to above or at least partly
Ground solves the method and apparatus utilizing WORD Program Generating list of the problems referred to above.
According to one aspect of the present invention, it is provided that a kind of method utilizing WORD Program Generating list,
Including:
To the one or more lists in a WORD document, in head and the portion of each list
Cha Ru beginning label and end mark;
One or more control is inserted in described WORD document, and while inserting each control,
Insert the bookmark corresponding with this control at same position and the attribute information of this control is recorded as one
The data of XML format;The ID of the most each bookmark is identical with the ID of corresponding control;
Described WORD document is saved as a html file;
One or more lists are extracted according to beginning label and end mark from described html file
The data of each list are stored in independent html file by data respectively;
To each independent html file, position the bookmark in this html file, according to bookmark ID
The control property information corresponding with this bookmark is obtained, according to this attribute information from the data of XML format
This bookmark replaces with corresponding ASP.net control, and the stem at this html file adds page elements
After, this html file is saved as the list of preset format.
Alternatively, the method farther includes:
The event of opening of monitoring WORD document and preservation event;
When monitoring when opening event of WORD document, from the preset table of database obtain one or
The binary stream of multiple lists, and it is read as the content of described WORD document;
Described described WORD document is saved as a html file include: when monitoring WORD
During the preservation event of document, the binary stream of described WORD document is exported in described preset table;
Load from described preset table in binary stream to the html file of described WORD document.
Alternatively, the method farther includes:
The attribute information of all controls is spliced into a final XML data;By described final
XML data exports in the preset table in database;
Described from the data of XML format, obtain corresponding with this bookmark control property letter according to bookmark ID
Breath includes: inquire about the final XML data in described preset table according to bookmark ID, obtains and this bookmark
Corresponding control property information.
Alternatively, the method farther includes:
When monitoring when opening event of WORD document, read URL file, according to this URL literary composition
Part obtains the binary stream of one or more list from the preset table of database;
The binary stream of described WORD document is exported described preset table include:
URL interface according to this URL file, calculates corresponding webservice address, by this
The binary stream data of WORD document are exported described presetting by webservice interface corresponding to address
In table.
Alternatively, the method farther includes:
Webbrowser plug-in unit is added in the program of list to be applied;
Webbrowser plug-in unit is utilized to load the list of preset format.
According to another aspect of the present invention, it is provided that a kind of device utilizing WORD Program Generating list,
Including:
Mark inserts unit, for the one or more lists in a WORD document, each
The head of list and afterbody insert beginning label and end mark respectively;
Control inserts unit, for inserting one or more control in described WORD document, and
While inserting each control, insert the bookmark corresponding with this control and by the genus of this control at same position
Property information is recorded as the data of an XML format;The ID of the ID of the most each bookmark and corresponding control
Identical;
Data conversion storage unit, for saving as a html file by described WORD document;
List extraction unit, for extracting according to beginning label and end mark from described html file
The data of each list are stored in independent html file by the data of one or more lists respectively;
List signal generating unit, for each independent html file, positions in this html file
Bookmark, from the data of XML format, obtain corresponding with this bookmark control property letter according to bookmark ID
Breath, replaces with corresponding ASP.net control according to this attribute information by this bookmark, at this html file
Stem add after page elements, this html file is saved as the list of preset format.
Alternatively, this device farther includes:
Monitoring means and data capture unit;
Described monitoring means, for monitoring event of opening and the preservation event of WORD document;
Described data capture unit, is further used for when monitoring when opening event of WORD document,
From the preset table of database, obtain the binary stream of one or more list, and be read as described WORD
The content of document;
Described data conversion storage unit, for when monitoring the preservation event of WORD document, by described
The binary stream of WORD document exports in described preset table;Load described from described preset table
In the binary stream of WORD document to html file.
Alternatively, described data conversion storage unit, it is further used for being spliced into the attribute information of all controls
Article one, final XML data;Described final XML data is exported in the preset table in database;
Described list signal generating unit, for inquiring about the final XML in described preset table according to bookmark ID
Data, obtain the control property information corresponding with this bookmark.
Alternatively, described data capture unit, it is used for when monitoring when opening event of WORD document,
Read URL file, from the preset table of database, obtain one or more list according to this URL file
Binary stream;
Described data conversion storage unit, for the URL interface according to this URL file, calculates corresponding
Webservice address, by webservice interface corresponding to this address by the binary system of WORD document
Flow data exports in described preset table.
Alternatively, this device farther includes:
List loading unit, for adding webbrowser plug-in unit in the program of list to be applied;Utilize
Webbrowser plug-in unit loads the list of preset format.
From the foregoing, technical scheme, one or more in a WORD document
List, inserts beginning label and end mark respectively at the head of each list and afterbody, and according to demand,
In WORD document, one or more controls are inserted in suitable position, and are inserting the same of each control
Time, insert the bookmark corresponding with this control at same position and the attribute information of this control is recorded as one
The data of XML format, have been achieved in that the design to list in WORD program, next will
WORD document saves as a html file, according to beginning label and end from html file
Mark extracts the data of one or more lists, and the data of each list are stored in independent HTML respectively
In file, to each independent html file, position the bookmark in this html file, according to book
Sign ID and from the data of XML format, obtain the control property information corresponding with this bookmark, according to this attribute
This bookmark is replaced with corresponding ASP.net control by information, and the stem at this html file adds the page
After element, this HTML is saved as the list of preset format.This technical scheme utilizes easy-operating
WORD programming list pattern, and utilize the bookmark function of WORD, by another for WORD document
The most useful style content can be extracted after saving as html file and edited, ultimately generating corresponding
Forms pages, it is not necessary to complicated programming technique, it is easy to implement, substantially increase list formation efficiency.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the skill of the present invention
Art means, and can being practiced according to the content of specification, and in order to allow, the present invention's is above and other
Objects, features and advantages can become apparent, below especially exemplified by the detailed description of the invention of the present invention.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing shows
The exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure and not
Should be limited by embodiments set forth here.On the contrary, it is provided that these embodiments are able to more thoroughly
Understand the disclosure, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Fig. 1 shows a kind of WORD Program Generating list of utilizing
The flow chart of method, as it is shown in figure 1, the method includes:
Step S110, to the one or more lists in a WORD document, at the head of each list
Portion and afterbody insert beginning label and end mark respectively.
Step S120, inserts one or more control in WORD document, and is inserting each control
While, insert the bookmark corresponding with this control at same position and the attribute information of this control is recorded as
Article one, the data of XML format, the ID of the most each bookmark is identical with the ID of corresponding control.Each
The attribute of control can be adjusted according to user's request, such as height, width etc., when preserving repairing of user
Also can the corresponding attribute information revised in corresponding XML data when changing.
A WORD plug-in unit can be designed to perform above-mentioned steps S110 and step S120.Such as, adopt
With DotNet development support WORD2007 and the plug-in unit of above version, the program bag after exploitation is vsto
Form, can be started by double-click and be installed in WORD program by this plug-in unit simply.Fig. 2-a and figure
2-b respectively illustrates WORD plug-in unit boundary in WORD program according to an embodiment of the invention
Face schematic diagram.As shown in Fig. 2-a and Fig. 2-b, this plug-in unit can be shown as toolbar in WORD program
On corresponding function menu item.Fig. 2-c shows and utilizes this plug-in unit to perform in step S110 at list head
Portion inserts beginning label, and inserts the effect schematic diagram after multiple control in WORD document.As
Shown in figure, the ash bid inviter of end word, address, contact person etc. are the control of insertion.These controls are permissible
Attribute can be adjusted according to user's request, such as, Fig. 2-d show utilize this plug-in unit adjust control
The interface schematic diagram of part attribute.
Step S130, saves as a html file by WORD document.WORD document can not
The list directly used directly as mis system etc., the most also needs to be further processed.
Step S140, extracts one or more according to beginning label and end mark from html file
The data of each list are stored in independent html file by the data of list respectively.
In html file now, there is pattern and the bookmark of insertion that substantial amounts of WORD carries,
So html file needs to process, extract the data of or list.Shown below is one
The example of extraction form data:
First with regular expression:<body>[ s S] *?</body>find out the body in html file
Partly;
Recycling beginning label and end mark extract the data of each list respectively.Such as, the mark of employing
It is designated as:<--content conditions selects beginning label-->and<--content conditions to select end mark-->, then utilize
Matching regular expressions: <--content conditions select beginning label [ s S] *?-->and<--content conditions select knot
Bundle mark [ s S] *?-->.Content between both is replaced and taken out.
Step S150, to each independent html file, positions the bookmark in this html file,
From the data of XML format, the control property information corresponding with this bookmark is obtained according to bookmark ID, according to
This bookmark is replaced with corresponding ASP.net control by this attribute information, and the stem at this html file adds
After adding page elements, this html file is saved as the list of preset format.
Such as, bookmark is all to express with one section of span in html file, therefore can utilize
Regular expression, positioning book mark.Such as: utilize regular expression: < a name=" EB "+id+
"><span[\s\S]*?</span></a>, take out bookmark ID, then according to bookmark ID from XML format
Data obtain the control property information corresponding with this bookmark, finds corresponding control type information, will
Bookmark in HTML replaces to corresponding ASP.net control, if button is that<asp:button id=" "/>is defeated
Entering frame is<asp:Input id="/>.Finally, the stem at the page increases necessary page elements, such as:
< %@Page Language=" C# " MasterPageFile=" fixed page " AutoEventWireup=" true "
Inherits=" commonPage " ValidateRequest=" false " % >.Finally, by this HTML literary composition
Part saves as the list of the preset format such as aspx.
Visible, the method shown in Fig. 1, utilize easy-operating WORD programming list pattern, and
Utilize the bookmark function of WORD, can be extracted it after WORD document is saved as html file
In useful style content being edited, ultimately generate corresponding forms pages, it is not necessary to complicated volume
Journey technology, it is easy to implement, substantially increase list formation efficiency.
In one embodiment of the invention, the method shown in Fig. 1 farther includes: monitoring WORD
The event of opening of document and preservation event;When monitoring when opening event of WORD document, from data
The preset table in storehouse obtains the binary stream of one or more list, and is read as the interior of WORD document
Hold;WORD document saves as a html file include: as the guarantor monitoring WORD document
When depositing event, the binary stream of WORD document is exported in preset table;Load from preset table
In the binary stream of WORD document to html file.
It is likewise possible to write the step that a WORD add-in comes in the present embodiment.Such as, profit
By one engineering of VirtualStudio too development, in engineering, define list class
Rb_EpointBookmark;Whole engineering is loaded by ThisAddIn.cs class, specifically, and carry respectively
Opening and preservation event of WORD document.In the present embodiment, it is contemplated that list associates with database
Property, therefore, from the preset table of database, obtain the binary stream of one or more list, and be read as
The content of WORD document.Equally, utilize this preset table design Storage complete list pattern, i.e. insert and adjust
The binary stream of the WORD document after whole good each control, and when needs generate list, then from presetting
Table loads in binary stream to the html file of WORD document.
In one embodiment of the invention, said method farther includes: believed by the attribute of all controls
Breath is spliced into a final XML data;Final XML data is exported presetting in database
In table;From the data of XML format, the control property information corresponding with this bookmark is obtained according to bookmark ID
Including: inquire about preset table according to bookmark ID, obtain the control property information corresponding with this bookmark.
Specifically, first when inserting bookmark, the attribute information of corresponding control can be spliced into an XML
Data, recorded in the tag attribute of this control, such as < Control id='XXXX'DBFiled='@word
Section ' sysTableName=' table ' sysFieldName='Name'ControlType=' control type '
Prop=' control property ' Mark="/>;It is final that the tag attribute of all controls is read in circulation when stored,
The attribute information of all controls is spliced into a final XML data, such as
<Controls>
< Control id='XXXX'DBFiled='@field ' sysTableName=' table '
SysFieldName='Name'ControlType=' control type ' Prop=' control property ' Mark="/>
< Control id='XXXX'DBFiled='@field ' sysTableName=' table '
SysFieldName='Name'ControlType=' control type ' Prop=' control property ' Mark="/>
< Control id='XXXX'DBFiled='@field ' sysTableName=' table '
SysFieldName='Name'ControlType=' control type ' Prop=' control property ' Mark="/>
< Control id='XXXX'DBFiled='@field ' sysTableName=' table '
SysFieldName='Name'ControlType=' control type ' Prop=' control property ' Mark="/>
</Controls>
Likewise it is possible to final XML data is stored in the preset table in database.
Table 1 shows the WORD binary stream of preservation list and the table of the preset table of final XML data
Structure:
Table 1 (table name: Frame_EpointForm)
Field name |
Type |
Explanation |
FormID |
Varchar(50) |
List identifies |
ReportContent |
Binary |
List WORD text (binary stream) |
DSContent |
Binary |
Final XML data (binary stream) |
Name |
nVarchar(50) |
List name |
In one embodiment of the invention, preset table is utilized, it is also possible to completed list is repaiied
Change.Such as monitoring when opening event of document, read from preset table WORD binary stream and
Final XML data, is opened for WORD document, now contains multiple control in document content, often
The attribute information of individual control is already recorded in tag attribute.Now can according to demand list be repaiied
Change, after amendment, perform such as the operation in previous embodiment, obtain new WORD binary stream with final
XML data is also stored in preset table.
In one embodiment of the invention, said method farther includes: when monitoring WORD literary composition
When opening event of shelves, reads URL file, obtains according to this URL file from the preset table of database
Take the binary stream of one or more list;The binary stream of WORD document is exported in preset table
Including: according to the URL interface of this URL file, calculate corresponding webservice address, pass through
The binary stream data of WORD document are exported preset table by webservice interface corresponding to this address
In.
Provide binary stream concrete obtaining one or more list from preset table in the present embodiment
Mode, i.e. by reading URL file, reads from database according to the related urls in URL file
List binary stream, opens for WORD program.After utilizing WORD program to be completed by form design,
When pressing WORD save button, calculate accordingly according to the URL interface of this URL file
Webservice address, then pushes the binary stream of WORD document in webservice interface.This
Outward, it is also possible in webservice interface, push final XML data in this way.
In one embodiment of the invention, the method shown in Fig. 1 farther includes: at list to be applied
Program in add webbrowser plug-in unit;Webbrowser plug-in unit is utilized to load the list of preset format.
As a example by Database Systems, the list of the specific format that the method shown in Fig. 1 generates, such as aspx lattice
The list of formula also needs to be associated the process of background class before use, in data system, can have one
The individual logical background process class added, according to the control in user interface, and final in configuration database
XML data, can load corresponding data, on a user interface lower save button from database,
Can be by data retrography to database.So, a dynamic web page comprising generation list just may be used
To employ.
But in standalone version program, it is impossible to directly apply the list of this specific format.Therefore this enforcement
Example provide a kind of in the program of list to be applied add webbrowser plug-in unit scheme, so,
In the system of list to be applied, use the internal mode loaded, use the webclient assembly of .net, grab
Take such as the static elements of aspx form list, then save as HTML form, thus obtain one quiet
The state page.Then webbrowser control is used to load this page in the interface of standalone version program.At this
By webbrower.document object in control, the value of certain control can be obtained, it is also possible to arrange
The value of certain control, such that it is able to the information on operation list, reaches to show and the function of typing.
Fig. 3 shows the structural representation of a kind of device utilizing WORD Program Generating list, such as Fig. 3
Shown in, utilize the device 300 of WORD Program Generating list to include:
Mark inserts unit 310, for the one or more lists in a WORD document, often
The head of individual list and afterbody insert beginning label and end mark respectively.
Control inserts unit 320, for inserting one or more control in WORD document, and is inserting
While entering each control, insert the bookmark corresponding with this control and by the attribute of this control at same position
Information is recorded as the data of an XML format.The ID of the ID of the most each bookmark and corresponding control
Identical.
Data conversion storage unit 330, for saving as a html file by WORD document.
List extraction unit 340, for extracting according to beginning label and end mark from html file
The data of each list are stored in independent html file by the data of one or more lists respectively.
List signal generating unit 350, for each independent html file, positions this html file
In bookmark, from the data of XML format, obtain the control property corresponding with this bookmark according to bookmark ID
Information, replaces with corresponding ASP.net control according to this attribute information by this bookmark, at this HTML literary composition
After the stem of part adds page elements, this HTML is saved as the list of preset format.
Visible, the device shown in Fig. 3, cooperating by each unit, utilize easy-operating WORD
Programming list pattern, and utilize the bookmark function of WORD, WORD document is being saved as
The most useful style content can be extracted after html file and edited, ultimately generating corresponding table
Single-page, it is not necessary to complicated programming technique, it is easy to implement, substantially increase list formation efficiency.
In one embodiment of the invention, the device shown in Fig. 1 farther includes: monitoring means sum
According to acquiring unit;Monitoring means, for monitoring event of opening and the preservation event of WORD document;Number
According to acquiring unit, it is further used for when monitoring when opening event of WORD document, from database
Preset table obtains the binary stream of one or more list, and is read as the content of WORD document;
Data conversion storage unit, for when monitoring the preservation event of WORD document, by WORD document
Binary stream exports in preset table;The binary stream to one of WORD document is loaded from preset table
In html file.
In one embodiment of the invention, in said apparatus, data conversion storage unit, be further used for by
The attribute information of all controls is spliced into a final XML data;By final XML data output
In preset table in database;List signal generating unit, for inquiring about preset table according to bookmark ID, obtains
Take the control property information corresponding with this bookmark.
In one embodiment of the invention, in said apparatus, data capture unit, for when monitoring
When opening event of WORD document, reads URL file, according to pre-from database of this URL file
If table obtains the binary stream of one or more list;Data conversion storage unit, for according to this URL
The URL interface of file, calculates corresponding webservice address, corresponding by this address
The binary stream data of WORD document are exported in preset table by webservice interface.
In one embodiment of the invention, the device shown in Fig. 1 farther includes: list loading unit,
Webbrowser plug-in unit is added in the program at list to be applied;Webbrowser plug-in unit is utilized to add
Carry the list of preset format.
It should be noted that the detailed description of the invention of above-mentioned each device embodiment is implemented with aforementioned corresponding method
The detailed description of the invention of example is identical, does not repeats them here.
In sum, technical scheme, to the one or more tables in a WORD document
Single, insert beginning label and end mark respectively at the head of each list and afterbody, and according to demand,
In WORD document, one or more controls are inserted in suitable position, and are inserting the same of each control
Time, insert the bookmark corresponding with this control at same position and the attribute information of this control is recorded as one
The data of XML format, have been achieved in that the design to list in WORD program, next will
WORD document saves as a html file, according to beginning label and end from html file
Mark extracts the data of one or more lists, and the data of each list are stored in independent HTML respectively
In file, to each independent html file, position the bookmark in this html file, according to book
Sign ID and from the data of XML format, obtain the control property information corresponding with this bookmark, according to this attribute
This bookmark is replaced with corresponding ASP.net control by information, and the stem at this html file adds the page
After element, this HTML is saved as the list of preset format.This technical scheme utilizes easy-operating
WORD programming list pattern, and utilize the bookmark function of WORD, by another for WORD document
The most useful style content can be extracted after saving as html file and edited, ultimately generating corresponding
Forms pages, it is not necessary to complicated programming technique, it is easy to implement, substantially increase list formation efficiency.
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the protection model of the present invention
Enclose.All any modification, equivalent substitution and improvement etc. made within the spirit and principles in the present invention, all
Comprise within the scope of the present invention.
It should be understood that
Algorithm and display be not solid with any certain computer, virtual bench or miscellaneous equipment provided herein
Have relevant.Various fexible units can also be used together with based on teaching in this.As described above,
Construct the structure required by this kind of device to be apparent from.Additionally, the present invention is also not for any specific
Programming language.It is understood that, it is possible to use various programming languages realize the content of invention described herein,
And the description done language-specific above is the preferred forms in order to disclose the present invention.
In specification mentioned herein, illustrate a large amount of detail.It is to be appreciated, however, that this
Inventive embodiment can be put into practice in the case of not having these details.In some instances, not
It is shown specifically known method, structure and technology, in order to do not obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand in each inventive aspect one
Or multiple, above in the description of the exemplary embodiment of the present invention, each feature of the present invention is sometimes
It is grouped together in single embodiment, figure or descriptions thereof.But, should be by the disclosure
Method be construed to reflect an intention that i.e. the present invention for required protection require ratio in each claim
The middle more feature of feature be expressly recited.More precisely, as the following claims reflect
As, inventive aspect is all features less than single embodiment disclosed above.Therefore, it then follows
Claims of detailed description of the invention are thus expressly incorporated in this detailed description of the invention, the most each right
Requirement itself is all as the independent embodiment of the present invention.
Those skilled in the art are appreciated that and can carry out the module in the equipment in embodiment certainly
Change adaptively and they are arranged in one or more equipment different from this embodiment.Permissible
Module in embodiment or unit or assembly are combined into a module or unit or assembly, and in addition may be used
To put them into multiple submodule or subelement or sub-component.Except such feature and/or process or
Outside at least some in unit excludes each other, can use any combination that (this specification is included companion
With claim, summary and accompanying drawing) disclosed in all features and so disclosed any method or
All processes of person's equipment or unit are combined.Unless expressly stated otherwise, this specification (includes companion
With claim, summary and accompanying drawing) disclosed in each feature can by provide identical, equivalent or phase
Replace like the alternative features of purpose.
Although additionally, it will be appreciated by those of skill in the art that embodiments more described herein include it
Some feature included in its embodiment rather than further feature, but the group of the feature of different embodiment
Close and mean to be within the scope of the present invention and formed different embodiments.Such as, in following power
In profit claim, one of arbitrarily can mode making in any combination of embodiment required for protection
With.
The all parts embodiment of the present invention can realize with hardware, or to process at one or more
The software module run on device realizes, or realizes with combinations thereof.Those skilled in the art should
Understand, microprocessor or digital signal processor (DSP) can be used in practice to realize basis
Some or all parts in the device utilizing WORD Program Generating list of the embodiment of the present invention
Some or all functions.The present invention is also implemented as performing method as described herein
Point or whole equipment or device program (such as, computer program and computer program).
The program of such present invention of realization can store on a computer-readable medium, or can have one
Or the form of multiple signals.Such signal can be downloaded from internet website and obtain, or carrying
There is provided on body signal, or provide with any other form.
The present invention will be described rather than limits the invention to it should be noted above-described embodiment,
And those skilled in the art can design replacement in fact without departing from the scope of the appended claims
Execute example.In the claims, should not will be located in any reference symbol between bracket to be configured to right is wanted
The restriction asked.Word " comprises " and does not excludes the presence of the element or step not arranged in the claims.It is positioned at
Word "a" or "an" before element does not excludes the presence of multiple such element.The present invention is permissible
By means of including the hardware of some different elements and realizing by means of properly programmed computer.?
If listing in the unit claim of equipment for drying, several in these devices can be by same
Hardware branch specifically embodies.Word first, second and third use do not indicate that any order.
Can be title by these word explanations.