Design------Realization of Web Report Tool

Source: Internet
Author: User
Tags format define definition comparison implement interface connect xsl
Design and design of web|

--------------------------------------------------------------------------------



Brief introduction

This paper introduces the realization and solution of Web Report design tool, which can be connected with database, let the user design the report, the data of the report is obtained from the database, and the user's modified data can be saved back to the database. The tool can implement any form (regular, irregular) report design, not only as the final product submitted to the user, for developers, can also be used as a report and database design tools to develop their own products. One purpose: Let the developer (at least I) stop doing "report Coolie".

Foreword and the issue of the proposal

I am in the C/s structure and/b structure of the software development process, encountered a large number of design report work. Users have a large variety of reports need to be implemented, and after the system acceptance users will have some reports to implement. In the development of C/S structure report using Pb,excel,formula One tool buried in the drawing table, in the development of B/s organization of the report using asp,xml/xsl, such as a grid generation table; finished the report style design, thought you can take a break, but not yet, You also need to design a database, design a method function that produces a report, also design to modify the interface of the report, save the data function; Each report has to be completed by the developer in person, and the user is not very easy to submit the test, users said: So-and-so table format is not correct, so the size of the table is not correct, to help add a few new tables ... ... Make people faint head up brain, just have a little sense of achievement, a bit relaxed again by sighing, alas sound to rush away ... If only you could let the user do the dirt seven or eight bad thing!

Just received a financial system of the Web Office System project, to achieve the report has a thick pile, this is still only preliminary needs, simply, to design a "report design tool", hoping to liberate the future report work; Of course, it is implemented on the Web.

Do report design tools, I used to do when the C/s structure of the system has been done, but also realized (with PB6), the user is also very good. But there are disadvantages: one is not easy to use on the Web, the second is to display only reports, can not modify the data in the report, of course, can not add data. How does it work on the Web?

Way to achieve

To make a Web report design tool, you must first know what the report is. How is it produced and realized? First, the idea of a reason.

What is the report? The point is to put some data in a fixed-format fixed position table. Since it is a table, then there is a "table" with "lattice", first of all, a "lattice" to "spell" a "row" or a "column", and then a "Row (column)" One "Row (column)" To "spell" a "table".

Although the same is by the lattice "spell" out, but some tables are good to draw, some bad painting, as shown in Figure 1 and figure 2 below:



Figure 1



Figure 2

Obviously the report shown in map 1 is better than the report shown in Figure 2, and we call the table 1 type "structured report", and the report of type 2 is called "Irregular report."

Said a long time nonsense, then the report is how to produce and achieve it? I think there are only two ways: "Painting" and "filling".

"Draw a table" is to produce a grid at the same time also put the data in the grid, is the format of the data produced at the same time, so that the entire table is finished, the table data also have, the report is generated. This is a good way to generate regular reports, so that the report can be drawn line by row or column by point. The advantage of this approach is to generate reports quickly (batch processing data), the process is simple (a circular statement on it).

"Fill out" and "draw" is completely different, he must first have a table format, and then fill the specified data in the specified table location. This approach is both suitable for generating irregular reports and for generating regular reports. The advantage of this approach is of course a wide range of applications, but the disadvantage is that the speed is slow, because it must first get the sample, and then one by one to take out the data, one by one to fill in the grid.

So what kind of implementation should we take? There are two kinds of solutions:

1. Separate processing: Let the user in the design of the report to determine whether the report is regular (this is very simple thing), if the regular let the report to use the "Draw Table" way, otherwise use "Fill in form" way to produce.

2. Unified Treatment: The full use of "fill in the form" method produced.

I think the speed of the computer is still speeding up, the hardware "fast" can eliminate the software "slow", but mainly to simplify the design and processing of software, using a second way to achieve: fill in the form.

Decided the way to implement, and began to consider some details and technical things: To implement this web report design tool, what needs to be considered, what needs to solve some of the problems?

Issues that need to be addressed

Now it's time to think about how to do it. At first, a little thought, do not solve these problems:

1. How to draw a table is how to produce a sample? Must be in the browser to implement Yo!

-Simple: Use DHTML on the line, combined with xml/xsl.

2. How do I save a table sample?

--Simple: all exist in the text field of the database

3. How do I connect to the database?

--Simple: Define a property specifically to represent the

4. How do I display data?

-Simple: Using DHTML technology, combined with XML/XSL can be implemented

5. How do I modify data?

--Simple: Detection of events can not be it!

6. How do I save data?

--Simple: write in the database on the line.

Think carefully, only to find a lot of problems in this area:

7. How do I draw a table? What's the painting? In particular, it must be implemented in the browser.

8. How do I design a table style? Style design actions such as bold, underline, italic, decimal number, merge table, delete table, and so on.

9. How do I save a sample? Save in what format? Where does it exist?

10. How does the location of the data display be defined? How to define? How is the result of the definition saved? Where does it exist? And how to fill in the data?

11. How is the format of a single data display defined? How to define? How is the result of the definition saved? Where does it exist?

12. How does the report connect to the database? How do I get report data? How do you define the criteria for getting the data? How to define? How is the result of the definition saved? Where does it exist?

13. Users want to add a report, and there is no ready-made database table corresponding, how to let users to design the database? How should the database be designed?

14. How does a user know what a database definition means? How do I know which field a grid should take from a database table, and which record?

15. How do I know that the user modifies (adds) the report data? How does this data correspond to fields in a database table? How do you know which data in a grid fits together as a complete record in a database table? How can you know that the data that the user entered is sufficient to form a complete record? How do you save the data for these changes (additions)?

16. How do you save data that you don't need to create a separate database table to keep?

17. Data balance relationship design for reports? And how to define it? How is the result of the definition saved? Where does it exist?

18. How does an automatic calculation of formulas implement? And how to define it? How is the result of the definition saved? Where does it exist?

19. How can I extract data from other reports to produce a new report? How to define? How is the result of the definition saved? Where does it exist?

20. How do I define a summary of a report (data from the branch office that produces the general organization's figures)? How is the result of the definition saved? Where does it exist?

21. How to implement data escalation----that is, data format conversion? How does the converter design? How do I save it? Where does it exist?

......

The more you think about the problem, the more you feel the trouble, simply give up--coolie to do coolie, like me, such as slow people, perhaps design the time of this tool, a large pile of statements have been done.

Take a look back to the design of this report tool to write notes and collected information, the heart is unwilling to weigh the weight of the report, too heavy and too much-do you always do coolie? No way! For their own future now a little bit of trouble also worth! But so many problems need to be solved, a mess, how to start? What are the key issues?

The key to the problem

Look out of the window of the scenery, wait until calm down, and then look at these lists of problems, a problem one measurement and comparison, only to find that the first problem to be solved is "Table sample design Tool" how to achieve. Because the report design, display, modify, save and so on all operations are implemented in the tool environment, the database connection, the preservation of the table sample and so on work must revolve around the tool's manifestation and the interface form to realize and adjust.

Now that you've got a clue to the job, start designing! Don't be busy, the "tools" of the design is not decided yet!

Comparison of several schemes

There are a number of options to implement a sample design on the Web:

1. Using xml/xsl/dhtml/html technology to implement

2. Using IE's WebBrowser ActiveX control to implement

3. Write your own ActiveX control

4. Write your own Java applet to implement

5. Use a ready-made third-party control to implement

So what kind of scheme is better for me?

To understand the characteristics of each scenario, list the results as follows:



If you can get free third-party software, it is undoubtedly the 5th option is the best. Look for it. It's also true that the Sheetspace controls in the Microsoft Office Web components are not free (they have to be supported by Ms Office2000+), but they use MS Office, not only the cost of development, The user is also accustomed to the operation, he chose to--microsoft the Sheetspace control in the Office Web components.

Way to solve

Now that the key problem has been solved, the others will be well done, and the following collation lists the solutions to the related problems:

1. How to draw a table is how to produce a sample? Must be in the browser to implement Yo!

-Design a sample within the Sheetspace control in the Microsoft Office Web Components, or design a sample in MS Excel, and then import it into the Microsoft Office Web Components in the Sheetspace control, and design a program to import MS Excel. Data display formats, pagination, fixed header, font size, color, and so on are all designed in the sample.

2. How do I save a table sample? Save in what format? Where does it exist?

--the result of the Sheetspace control in the Microsoft Office Web components exists in the text field of the database. The format of the sample is in the HTML format of MS EXCEL and can be directly obtained by the Sheetspace control in the Microsoft Office Web components.

3. How do I connect to the database?

--specifically define a field property to represent the database table (table) for that report

4. How do I display data?

--The report data is extracted from the database and saved in XML format on the client, displayed in the Sheetspace control in the Microsoft Office Web components, and the retrieved report data is filled in the specified cell.

5. How do I know that the user modifies (adds) the report data? How does this data correspond to fields in a database table? How do you know which data in a grid fits together as a complete record in a database table? How can you know that the data that the user entered is sufficient to form a complete record?

--Detects the change event for the Sheetspace control in the Microsoft Office Web components, compares the current cell's value to the original data, modifies the original data, and then modifies the label. The corresponding relationship between the data and the database field is explained by the formula. This also lets you know which cells are combined in a complete record in a database table. For additional data, specifically design an input tool to prompt the user to enter which data is complete.

6. How do I save data?

--submit data to the server for modified (increased) flags in the XML, and the server processes the data and modifies the corresponding data in the database.

7. How do I design a table style? Style design actions such as bold, underline, italic, decimal number, merge table, delete table, and so on. How is the format of a single data display defined? How to define? How is the result of the definition saved? Where does it exist?

The Sheetspace controls in the--microsoft Office WEB components provide these action functions, which are represented on the page as menus, providing a means of user action. The results of user actions are stored in the sample and stored in the database together when the sample is saved.

8. How does the location of the data display be defined? How to define? How is the result of the definition saved? Where does it exist? And how to fill in the data?

--Design a formula design and interpreter, the data to be displayed in the form of a formula saved in the table, where the formula is the location of the data to display, the formula is in the cell format is the data display format (such as font, color, and so on). The formula is saved with the sample. When the data is displayed, the data is retrieved according to the formula and filled in the cell.

9. How do I get report data? How do you define the criteria for getting the data? How to define? How is the result of the definition saved? Where does it exist?

-Each report defines the query criteria property, which is the property that gets a complete report data content. The query condition directly corresponds to the field of the database, which is saved in the database with the Report table sample.

10. Users want to add a report, and there is no ready-made database table corresponding, how to let users to design the database? How should the database be designed?

--Design a database on the Web page to design a tool, so that users according to their actual needs to design the database structure.

11. How does a user know what a database definition means? How do I know which field a grid should take from a database table, and which record?

--Because of the database design tools, the database structure designed with the tool requires that the title of the field must be filled in, that is, the meaning of the field. When the user defines the formula, the display is not a boring English field name, but the title of the field, which is easy for users to understand.

12. How do you save data that you don't need to create a separate database table to keep?

--we distinguish between reports that do not need to build a separate database, all in a common table (table), which contains both report styles and report data.

13. Data balance relationship design for reports? And how to define it? How is the result of the definition saved? Where does it exist?

--The data balance relation of the report is realized by Excel's calculation formula completely. The formula is saved with the sample. The Sheetspace control in Microsoft Office WEB components can support most of MS Excel's formulas. Formulas are used in exactly the same syntax as MS Excel.

14. How does an automatic calculation of formulas implement? And how to define it? How is the result of the definition saved? Where does it exist?

--Using MS Excel's calculation formula, such as SUM,AVG, and so on, the formula is saved with the sample.

15. How can I extract data from other reports to produce a new report? How to define? How is the result of the definition saved? Where does it exist?

--A report has a property called a "fetch program" that extracts data from another database table (table) into the corresponding database table (table) in the table.

16. How do I define a summary of a report (data from the branch office that produces the general organization's figures)? How is the result of the definition saved? Where does it exist?

--A report has a property called a "rollup" that summarizes data from a report in a subordinate organization to produce report data for this organization.

17. How to implement data escalation----that is, data format conversion? How does the converter design? How do I save it? Where does it exist?

--reporting data is actually a transformation of the data format, which can be easily designed by using XSL. The XSL converter is saved as a text file in a specified directory, and the name of the file corresponds to report one by one. To generate escalation data, the report data is executed as a text file and saved at the user-specified location on the client machine.

A full definition of a report is kept in the data, and the database table is structured as:

 


Table 2: report Definition structure

In order to operate conveniently, also added the batch processing function, lets the user can extract the data, the summary data, simplifies the user the operation.

The whole process of reporting is like this:

1. Designing a Database definition

2. Design Report Styles

3. Insert a formula for taking numbers

4. Set query criteria

5. Design Summary Program

6. Design the procedure of picking up numbers

7. Query report

8. Summary Report

9. Batch Summary Report

10. Extract report data

11. Bulk Extract Report data

12. Generate Escalation File

Design effect

All right, single-handedly. One months, the coding work finally completed, the design of the database interface as shown in Figure 3, the design of the report interface as shown in Figure 4.



Figure 3: Database Design interface



Figure 4: Report Design interface

To the user trial, the effect is good, dozens of of all kinds of reports are easy to solve. Emperor not negative "bitter" heart people. In this way, I have a week's time to design a graphic design tool, the user response is also very good. The chart design interface is shown in Figure 4.



Figure 4: Graphic Design interface

Summarize

This paper discusses a kind of effective web report design tool realization idea, and will realize. It is easy to use for users who require a large number of design reports, especially in report formats and the number of users who are constantly changing. For developers, you can also reduce a lot of work.


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.