Keywords

1 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 [35]. In general, report document formats are relatively fixed [3, 6], 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 [7].

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 multi-indicator 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.

2 Materials and Methods

2.1 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 Fig. 1.

Fig. 1.
figure 1

The structure of evaluation report generation module

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) Database: Database contains static data and dynamic data tables (3) Report generation: According to user-submitted templates, the report is product by replacing the labels designed in word to specify the content.

2.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 user-selected criteria from the database to retrieve the corresponding data, and graphically displayed. Data-processing 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 [8], 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 [9].

2.3 Report 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.

2.3.1 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. (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. (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. (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. (4)

    The role of social and poverty alleviation indicator includes per capita income, Engel’s coefficient, increase in employment and social support degree.

2.3.2 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 (Fig. 2).

Fig. 2.
figure 2

The partial of the evaluation report template

2.4 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 [10], 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.

3 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 (Fig. 3).

Fig. 3.
figure 3

WO control flow diagram

4 Conclusions

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.