The realization of modifying trace reservation of office automation document in Web environment

Source: Internet
Author: User
Tags format bool functions html page window
The realization of modifying trace reservation of office automation document in Web Web environment

The present situation and thinking of trace reservation

With the government agencies and many enterprises and institutions network construction gradually completed, for how to use the network, how to show the advantages of the network, users are most likely to think of, but also the most easy to produce effects of the application, is the Office automation system (OA). In the current software development practice, the B/S mode (browser/server mode) can be developed using three-tier structure, front-end service layer, intermediate business layer, background database. Because of its good expansibility, high data security and no need to consider the compatibility of clients, it solves many limitations of C/S mode two-layer structure, so it has been widely used in office automation system.

Modification traces of the reservation is a difficult office automation system, many based on B/s mode of OA system processing method is: Word file is simply as a form of attachment, in need of use when called up to operate. However, the disadvantage of this approach is that there is no control over the Word document. The format required by the official document needs to be processed by the Secretary or relevant personnel after the process has been completed, and the official document will be generated, and the state's request for the official document format cannot be met when printing. Another approach is to use a rich text field instead of word, but this is done at the expense of the user's habits and word processing functions, and the effect is often not ideal.

At present, modify traces of the retention of a better way to deal with two kinds, one is to redesign the special editor, the other is to call the MS Office word processing software, through the programming of word, to achieve the reservation of modified traces. From the theoretical and practical point of view, the first approach is better, the use of embedded in the HTML page of the special graphics and text control, we can easily enhance the client's display and processing functions, reduce the development workload, improve software quality.

Introduction to third-party controls

The Office Star Control (Ostarocx) is a document-processing control (similar to Word's control) that is based on the graphic mix of the Smart Island software company. Office Star Control (Ostarocx) fully encapsulates the Office star text, graphics, tables, charts and other functions, providing hundreds of programming interfaces; CRM, HR, OA and other systems, the development of a very difficult document processing, statistics, reports and other output functions can be easily realized by the Office Star Control (Ostarocx), which is the result of the results of the same as in reality. The Office Star Control (Ostarocx) is a standard OCX control that is suitable for various development tools (such as Vb,vc,delphi, C+builder, PB, Java, etc.) for the Windows environment, and is optimized for the Web development environment.

Iii. the concrete realization of trace reservation

The application of the third party control in the Office Automation program under the Web environment greatly enriches the function and application scope of the Office automation program. To use the Office Star Control in a Web environment, you must first add the control to the Web programming environment, and then we can use the various interfaces of the Office star Control.

1. The Office Star Control Correlation interface method explanation

Method BSTR Getcuruser () returns the current user name
Method Setcuruser (LPCTSTR strName) sets the current user name
Method Setemendstate (BOOL bemend) sets the revision status. B is true when the revision status is false and is not a revision state
Method BOOL Getemendstate () returns the revision status. B is true when the revision state is false and is not a revised state
Method Showemenddlg () displays the Accept or Reject Revision dialog box
Method Prevfindemend () to find tracked changes
Method Nextfindemend () Forward lookup revision
Method Acceptemend () accepts a single revision
Method Acceptallemend () Accept all revisions
Method Refuseemend () rejects a single revision
Method Refuseallemend () rejects all revisions

2. Set the user who corrects the document

The user who modifies the document by default is the Super Administrator (Admin), and we usually set the user who corrects the action before the document is manipulated. Cases:

Ostar.setcuruser ("John")

The above code (JavaScript script) sets the operator for the current document to "John". In the code above, "Ostar" (The following code) is the only name in the program that identifies the Office star Control, which is set by ID when the control is inserted.

3. To achieve the modification of the left mark

Make a button in the Web document to control the modification of the remaining marks. The button implements the functional source program (JavaScript script) as:

if (Ostar.getemendstate ()) {
Ostar.setemendstate (0);
Window.status= "";
}else{
Ostar.setemendstate (1);
window.status= "revision of ...";
}

The button is a switch button, which can switch between the mark and the normal editing state.

4. View Modifications

Each operation button function and implementation code is as follows:

function Prevfindemend () {
Ostar.prevfindemend ()//Previous revision
}

function Nextfindemend () {
Ostar.nextfindemend ()//Next revision
}

5. Accept or Reject Changes

Each operation button function and implementation code is as follows:

function Acceptemend () {
Ostar.acceptemend ()//Accept Revision
}

function Refuseemend () {
Ostar.refuseemend ()//Reject revision
}

function Acceptallemend () {
Ostar.acceptallemend ()/All Accepted
}

function Refuseallemend () {
ostar.refuseallemend;//all refused
}

Four, the mark preserves realizes the effect

Through the above programming, realizes the OA and the picture and text mixed row document Seamless integration, guaranteed all to revise the mark the malicious operation to be unable through the system approval, guaranteed corrects the personnel's modification intention not to be distorted or misunderstood, guaranteed the information exchange security. At the same time, can make full use of Office Star Control powerful editing function, at any time to check the main points of the leadership modification and annotation, but also to avoid the written after the existence of a written version and printed text discrepancies between the loopholes, you can clarify the responsibilities of each link. The effect of the trace reservation implementation is shown below:



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.