前往Shuct.Net首页

Shudepb PB反编译专家长时间以来,为业内同类软件事实上的唯一选择.细节,彰显专业.态度,决定品质.

关于PowerBuilder的搜索

The use of automation technology in the PowerBuilder call processing and print Excel tables - Computer Application papers - Computer papers - Research Papers Center Language: Simplified Chinese English German Traditional Chinese Home Management Education Economics Engineering Marketing Medicine Computer Culture Science Literature Political Business Legal English Work Summary Work Plan Fiscal Levy Financial Management Accounting Practical Philosophy Securities Finance Public Management Location:Research Papers Center > Computer papers > Computer Application papers > papers The use of automation technology in the PowerBuilder call processing and print Excel tables Papers Category:Computer Papers - Computer Application Papers Post Time:2005-12-23 10:55:00 Summary of Microsoft's Office productivity software is a professional in the Excel spreadsheet-processing software, Microsoft's Office software suite to its offer of support for automation technology, so that other high-level programming languages can call the Office software family , using its sophisticated and reliable technology and functionality to easily achieve specific functions. In this article, through automation technology, to achieve in PowerBuilder to call Excel to achieve the output of the form and print. Keywords automation Excel PowerBuilder Forms One of the problem For the design of electronic maps of an enterprise document management systems, user request, to be able to quickly export of certain spreadsheets. Before without the use of automation technology, the enterprise using AutoCad software to produce a one-time multiple tables into a DWG file, and then plotter plot. Advantage of this approach is that companies can effectively save costs, one-time generated a large number of forms. However, the disadvantages are also obvious: it is the lack of flexibility, in the event the output only when a small number of forms, practices, too complicated. That such an approach is very suitable for large-volume output of the table, rather than a separate output for the individual tables. It is in this context, we have proposed the use of Excel spreadsheet-processing software to deal with the problem of the enterprise form the output. Excel Software is designed to deal with all kinds of electronic forms are designed, it can be very efficient and professional handling of all kinds of forms, and very critical: it has the form on the calculation of aggregate function, at this point, AutoCad software can not be compared to . Another reason, in the present enterprise, the increasing popularity of the use of the printer, print speed is also increasingly faster, when multiple users need to print at the same time, you can high-speed network printer for easy, at this point, the use of Excel also has certain advantages. 2 Automation Technology Microsoft Corporation provides automation technology, simply, is to a certain application functionality (which may be a part of) as a series of objects to other applications exposed to the external (Expose), the external applications can use these object, this process is called automation (Automation). For example, Excel, we can most of its functions as a series of objects to be exposed, and then in the other application using these objects, which is to use automation object to invoke Excel to complete the assigned function key. An application can access an object called the object model (Object Model), if we can use automation to manipulate a program's object model means that components can be reused. For example, the use of automation, the use of Excel, have been a good code to write and test complex mathematical calculations, which eliminates the need for programmers to write and debug complex hands-on code of trouble. Exposure to the object program is called the server (Servers), the use of these objects are called client programs (Clients). Here, we have Excel as the Automation server, our PowerBuilder application as a client, so that you can through automation technology to achieve specific forms generation and printing functions. In most of the Office software contains an Application object, Excel is no exception, this object is Excel object model to the basic object, which contains many members (Member), but here, we only need to use to part of it. 3, the use of automation technology in the PowerBuilder PowerBuider yes, Sybase introduced a high-level database application development environment, in this environment to develop database applications, using its patented technology - DataWindow, you can easily develop a highly specialized database applications. In addition, PowerBuilder also supports a variety of databases, can be very easy with the current popular MS SQL Server, Oracle and other enterprise-level database to establish a connection to deal with a variety of matters. PowerBuilder programming language is called in the script (Script), in fact, programs written using the PowerBuilder is also event-driven, the interface design is completely done, "WYSIWYG", and is fully object-oriented programming thinking, it also provides OLE, DDE, Automation and other technical support, Here's to illustrate how to use PowerBuilder automation technology. First of all, declare an OLE object, as follows: OLEObject OLE_MyExcel Next, create the OLE object, as follows: OLE_MyExcel = Create OLEObject Then, using PowerBuilder in ConnectToNewObject function to create a new OLE object, and connect to the object, as follows: OLE_MyExcel. ConnectToNewObject ( "excel.Application") Call the function, if successful, the return value is 0, otherwise, it means call failed. To this, automated preparation work has been completed, the following is a specific course of action. 4 dealing with and print forms Calling Excel, first need to solve a problem is whether to allow Excel visible, that is, whether the background operation. This problem can simply be controlled by setting the Visible property, if you want Excel running in the background, you can simply write the following statement: OLE_MyExcel.visible = false XLS and then open the specified file, a specific statement is as follows: OLE_MyExcel.Application.Workbooks.Open ( "d: \ excel-example.xls") To manipulate the data in the list of data unit, it must be ActiveCell object manipulation, the object is a property of Application object. Entering data into a data unit consists of two steps: first is to select a data unit, and the second is the data passed to it. Select a data unit by calling the Range object's Select () method can be completed, Range object is used to select one or more data units. Select () method requires the initial number of rows, columns, and the end of the number of rows, columns to identify the selected data unit. If you choose only a single data unit, you can ignore the end of the row, column number. When the range is set after the data passed to the ActiveCell object (reference to the Range object has been specified data unit) of the FormulaR1C1 properties. Are as follows: OLE_MyExcel.Range ( "c10"). Select () OLE_MyExcel.ActiveCell.FormulaR1C1 = sle_2.text / / Sle_2 as a static text box control OLE_MyExcel.Range ( "J10"). Select () ... ... If you want to get a range of values and, you need to first use Select () method to specify the required sum of the Cell scope, and then specify the location of storage and the Cell and finally you can call the SUM method, as follows: OLE_MyExcel.Range ( "A1: D1"). Select () OLE_MyExcel.Range ( "E1"). Activate () OLE_MyExcel.ActiveCell.FormulaR1C1 = "= SUM (RC [-4]: RC [-1])" Of course, other aspects can also be set, for example, the font set to bold (Bold), you can write the following code: OLE_MyExcel.Range ( "A1: E1"). Select () OLE_MyExcel.Selection.Font.Bold = True As for the other settings can refer to the books. As for the printing of forms, it is a simple call PrintOut () method can be, but need to first specify the print range, as is the print called "Sheet1" of the WorkSheet code: OLE_MyExcel.Worksheets ( "sheet1"). Activate () OLE_MyExcel.ActiveSheet.PrintOut () The next is about a change to the XLS file after the close of the document the need for a warning to the user. This problem requires only a simple set of OLE_MyExcel.Application.DisplayAlerts property can be, in order to True when the pop-up warning box, in order to False without pop-up warning box, and save your changes. The final step, after making all the work finished and needs to close automation objects to remove and automated connection to the server, destruction OLE objects, since the use of automated processes, in particular the Office such as Word or Excel program, the consumption of system resources is very large Therefore, each work is completed, the need to release this part of the system resources. Are as follows: OLE_MyExcel.Application.quit () OLE_MyExcel.DisConnectObject () destroy OLE_MyExcel 5 Conclusion In the use of automation technology, the satisfactory solution of the original form processing problems, can be very convenient to carry out small quantities of various forms processing and printing, very flexible. If we can integrate with enterprise databases, through the external program input data in batches will also solve the issue of high-volume data output may well be a good solution. In practical application, combined with the enterprise database, use this method automatically fill in data that contains a large number of XLS files, and you can print it out. Reposted elsewhere in the paper for free download http://eng.hi138.com References [1] James Foxall "Teaching yourself Visual Basic. NET in 24 hours" Sams 11/2001 [2] LIANG Ke Shan, Xiao-Jun Xu, Liu Tao, "a company's PDM system design book" [3] PowerBuilder Help file reposted elsewhere in the paper for free download http://eng.hi138.com RELATED TOPICS Mathematics Education Secondary Mathematics Education Higher Mathematics Brand Development Strategy Game Theory Mathematical Economic Shandong Strategic Communication Theory Electricity Demand Inland Shipping Marketing Theory Brand Marketing Brand Management Warehouse Management Landscape Management Mathematical Statistics Statistical Theory Mathematics Teaching Application Of Mathematics Mathematics Research Mathematics Learning Mathematics Thinking Dissertation Mathematics Interest Primary Mathematics Junior High School Mathematics High School Mathematics Computer Application Papers Journal of the brand Web site Construction The digital age characteristics of the Korean publishing industry The country's national informatization index system and the international comparative study of c JAVA class file protection analysis and research Warehouse management system to achieve VISAUL FOXPRO Inventory Management System Wage Management System How do I remove the dual system menu bar Zi Bianzi guide garbage collection To achieve the class teacher to work with the VB electronic Add Favorite Set Homepage Sitemap.xml Rss Subscription Category Terms & Conditions Contact Us Our Services Custom Writing Advertise on hi138.com About Us F.A.Q. Latest papers Search Papers Submit Your Link Disclaimer: eng.hi138.com produces only sample papers for you to get an insight into academic writing. Under no circumstances should they be submitted to educational institutions as your own works. Copyright ? 2009-2013. All Rights Reserved . Your personal library of Research papers