Quick and Automatic Generation Method for the Evaluation Report of the Small Hydropower Substitute Fuel Project

: The small hydropower substitute fuel (SHSF) project is a commonweal project, give prominence to the ecology benefit. The manager of SHSF need a full and specification report for the evaluation results, rather than a database or a simple data of the result. So, based on the characteristics of the management and evaluation system of SHSF project, this paper presents a multi-indicator comprehensive evaluation module and report template, which includes environmental impacts on climate change, conversion of cropland to forest and natural forest protection project, greenhouse gas emission and the role of social and poverty alleviation. In order to achieve automated building of the comprehensive evaluation report of the small hydropower replacing firewood project, a quick and automatic generation method is constructed for the evaluation report based on C#.Net development environment. It produces evaluation report by reading, traversing and replacing the corresponding position data placeholder of customized multi-indicator evaluation report template. The results showed that the quick and automatic generation method meets the requirements of the management and evaluation system of the small hydropower replacing firewood project successfully, and can be referenced in study and practical application.


Introduction
The small hydropower substitute fuel (SHSF) project is a public welfare project that consolidate the achievements of returning farming land to forestry, and solve the problem of fuel for rural life.It gives prominence to the ecology benefit and was named as "projects lightening the hope of mountain area "by local people.From 2009 to 2015, and there are 1022 small hydropower for fuel ecological protection projects in construction in fragile areas.Different from conventional construction of small hydropower energy issues, the small hydropower replacing fuel small hydropower project is to use firewood instead of rural life, so as to achieve the purpose of protecting the forest [1][2] .At present, the experiment unit work of the small hydropower replacing firewood project is just start, with China's great efforts to developing the small hydropower replacing firewood projects, a large number of project data in urgent need of regulation and evaluation.As an important part of project evaluation and management, efficient and rapid method to generate standardized project evaluation reports is critical.
In order to facilitate the management of the documents generated for further processing and reuse, Word is used as the report output of the application tools can further extend the application's functionality, improve utilization and shareability of data [3][4][5] .In general, report document formats are relatively fixed [6][7] , so in the most of these reports generated methods, report template is often designed well in advance and the label, or specific keywords are insert into the specific location where need to be filled in by the program.And then the reports are generated by replacing the label, or specific keyword in the build process.The benefit of this approach that the report is product by the program document style is to be designed outside has the advantage of reducing the amount of code, improved implementation efficiency [8] .
Facing great development need of small hydropower for fuel ecological protection projects, drawing on the domestic and international water energy management experience as well as the sustainable development of small hydropower management structure, this paper presents a multiindicator comprehensive evaluation module based on the study of eco-benefit evaluation methods and overall framework of the management and evaluation system of the small hydropower project, it produces evaluation report by using default evaluation report template, which includes environmental impacts on climate change, conversion of cropland to forest and natural forest protection project, greenhouse gas emission and the role of social and poverty alleviation.In order to achieve automated building of the comprehensive evaluation report of the small hydropower project, we construct a quick and automatic generation method for the evaluation report based on C#.Net development environment.It produces evaluation report by reading, traversing and replacing the corresponding position data placeholder of customized multi-indicator evaluation report template .The quick and automatic generation method for the evaluation report of the small hydropower project can provide technical support for benefit analysis of ecological environment.

The structure of Evaluation report generation module
The development objective of the comprehensive evaluation module based on Microsoft Visual Studio integrated development environment and .Net Framework 4.5 platform is to generate Evaluation report quickly and automatically according to the user requirement.The structure of Evaluation report generation module is shown in Figure 1.
The evaluation module design includes three parts: document template customization part, database and report generation part: (1) Document template customization: Document template customization is a tool that runs on a client for the administrator to use for making report document template according to their requirement.Document templates, including fixed and replaceable parts.The replaceable parts is specified using the designated (For example, label in word).( 2

Encapsulating data processing method and establishing label
Word report including data recording method and data processing method of data query.( 1) the main methods of data entry manual entry of text information.( 2) data querying method based on userselected criteria from the database to retrieve the corresponding data, and graphically displayed.Dataprocessing methods, including methods and method body, method header indicates the method name, method calls the conditions and method return value type, including method return value type into text strings, images, and tables, one for each input class methods and query class method.Features in each data processing method using the C# language adds a description only shows that it features, the format is a text string [9] , and finally through the compiler to encapsulate the data processing method for the dynamic-link library (DLL) files.Technical data processing methods using reflection file description of the analytic methods, sorting packages for labels, and configured service interfaces using Web Service technology release.Labels include tags categories, tags and the corresponding data source [10] .

2.3Report template customization
Report template customization is a tool that runs on a client for the administrator to use for making report document template according to their requirement.Report templates, including fixed and replaceable parts, which is specified using the designated (For example, label in word), are stored in database.

Evaluating indicator of the small hydropower replacing firewood project
Report templates makes up of multiple evaluation, which is environmental impacts on climate change, conversion of cropland to forest and natural forest protection project, greenhouse gas emission and the role of social and poverty alleviation.
(1) Environmental impacts on climate change indicators include eco-environment, energy saving and emission reduction, new dam construction technology and capacity to respond to climate change.
(2) Conversion of cropland to forest and natural forest protection project indicator includes the absorption of water conservation, soil conservation, nutrients accumulation, the atmosphere and environment purification, biological diversity protection.
(3) Greenhouse gas emission indicator includes greenhouse gas emissions of the small hydropower replacing firewood station and greenhouse gas emissions of returning farmland to forest.
(4) The role of social and poverty alleviation indicator includes per capita income, Engel's coefficient, increase in employment and social support degree.

Customization of the multi-indicator comprehensive evaluation report template
After establishing the corresponding position label is accomplished, the report template can be customize.The steps of creating a custom template as follows: (1) creates a new, blank Word document, in accordance with the changes to the normal document methodology and demand, add reports to be automatically generated by content in the document including fixed static text, header, footer, header, separator(such as symbols) and dynamic text.Among them, the placeholder for dynamic text with the corresponding logo.If the report needs to insert a table, where the paragraph you want to set the Insert table, and then inserts a page break in the next paragraph, make your spreadsheet into a region.If multiple sets of graphs and charts is needed, the appropriate place to insert a text box in Word document template for each size format, such as a text box, and then inserts a placeholder inside a text box.In order to distinguish data placeholders from normal text, you can set a special style for it.(2) Save the word document that contains placeholders for data as a report template.
Figure 2 The Partial of the evaluation report template

Conversation of dynamic web pages
Using report templates to create a report in Word format directly, does not have a function that interacts with a database query based on a condition [11], you also need to convert a Word report templates in the form of dynamic Web pages, follow these steps: (1) The way to traverse the bookmark lookup data placeholders in a template and read the corresponding value, and data processing method of descriptive information.(2) Through reflection technology, according to the description corresponds to the one by one the relationship between information and data processing methods to find data processing methods.(3) the ASPX data display controls is determined depend on the value type of data processing method Reflected .(4)The Word report templates are transformed into Html forms.(5) Using regular expressions to remove comments and style information in the Html file, and add the Aspx pages such as Js and css information.( 6) Through the template engine, using Aspx data components (such as TextBox, PictureBox and GridView) replacing data placeholders in your Html to generate dynamic pages.

Evaluation report generation
The variety of information in static and dynamic data in the database tables is the input section of the evaluation report, and the evaluation report of the small hydropower replacing fuel project as the output.The generation process of the small hydropower replacing firewood evaluation report is as follows.User finished editing the evaluation report on client under through the data operation of query and inserts by visiting a web page dynamically controls.The Placeholder data and data processing method is one to one in database.The server calls data processing method corresponding to the data placeholders of multi-indicator evaluation report template customized for reading data, and binding Data display components in Dynamic pages.Page structure is similar to final report.In page, queries and modifications operations repeatedly are allowed, and temporarily saved is supported.Then, the contents of all controls are serialized in backed server, and stored to the database.
When the user selects the generating reports Operation, backed server traverse the each data placeholder of multi-indicator evaluation report template customized.At the same time, the corresponding position data placeholder of multi-indicator evaluation report template customized is replaced by the content of the corresponding control that pass through the page.All data placeholders in the template are replaced, and product the word document .Then convert WORD to PDF, and save it as the final evaluation report.

Create a Word document
The original document is Exist?
Read the evaluation report template The build process cancelled?
Stop the build process and all word process Based on the characteristics of the management and evaluation system of the small hydropower project, in this paper, a quick and automatic generation method based on Microsoft Visual Studio integrated development environment and C#.Net Framework 4.5 platform is proposed .The application results show that this report generation method based on C#.Net language is efficient and rapid, and meets the requirements of the management and evaluation system of the small hydropower replacing firewood project successfully, and can improve the availability and shareability of the material of the management and evaluation system.

Figure 1
Figure 1 The structure of Evaluation report generation module Figure 3 WO control flow diagram