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

Yingyi Chen, Jiani Xue, Huihui Yu, Jing Xu, Zhumi Zhen, Xingyue Tu, Zhijie

Ma, Yun Zhao, Yanzhong Liu

► To cite this version:

Yingyi Chen, Jiani Xue, Huihui Yu, Jing Xu, Zhumi Zhen, et al. Quick and Automatic Generation Method for the Evaluation Report of the Small Hydropower Substitute Fuel Project. 9th International Conference on Computer and Computing Technologies in Agriculture (CCTA), Sep 2015, Beijing, China. pp.64-71, 10.1007/978-3-319-48357-3_7. hal-01557831

HAL Id: hal-01557831

https://inria.hal.science/hal-01557831

Submitted on 6 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Quick and Automatic Generation Method for the Evaluation Report of the
Small Hydropower Substitute Fuel Project

Yingyi Chen<sup>1,2,3,4</sup>, Jiani Xue<sup>1,2,3,4</sup>, Huihui Yu<sup>1,3</sup>, Jing Xu<sup>1,3</sup>, Zhumi Zhen<sup>1,3</sup>, Xingyue Tu<sup>1,2,3,4</sup>, Zhijie Ma<sup>5</sup>, Yun Zhao<sup>5</sup>, Yanzhong Liu<sup>6,*</sup>

(1.College of information and Electrical Engineering, China Agricultural University, Beijing
100083, P.R. China

2. Key Laboratory of Agricultural Information Acquisition Technology, Ministry of Agriculture,
   Beijing 100083, P.R. China

3. Beijing Engineering and Technology Research Center of Internet of Things In Agriculture,
   Beijing 100083, P.R. China

4. Key Laboratory of Modern Precision Agriculture System Integration, Ministry of Education,
   P.O. Box 121, Beijing, 100083, P.R. China

5. Engineering Design and Research Center, IWHR, Beijing 100044, China

6. Institute of Information for Agriculture, Shandong Academy of Agricultural Sciences, Jinan,
   250100, P.R. China)

**Abstract:** The small hydropower substitute fuel (SHSF) project is a common weal 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.

**Keywords:** small hydropower substitute fuel (SHSF); multi-indicator evaluation report template; quick and automatic generation method

# 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

* Corresponding author: Liu Yanzhong, Email: lyz1228@163.com
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-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 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 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) Database:
Database contains static data and dynamic data tables. (3) Report generation: According to user-submitted templates, the report is produced by replacing the labels designed in word to specify the content.

<figure><img src="image_2.png" /><figcaption>Figure 1 The structure of Evaluation report generation module</figcaption></figure>

## 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[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.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 make 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.

### 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.
<figure><img src="image_3.png" /><figcaption>Figure 2 The Partial of the evaluation report template</figcaption></figure>

## 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 [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 intoHtml forms.(5) Using regular expressions to remove comments and style information in theHtml file, and add the Aspx pages such as Js andcss information. (6) Through the template engine, using Aspx data components (such as TextBox, PictureBox and GridView) replacing data placeholders in yourHtml 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.

<figure><img src="image_4.png" /><figcaption>Figure 3 WO control flow diagram</figcaption></figure>

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.

## Acknowledgements

We acknowledge the financial assistance provided by the Key Program for International S&T Cooperation Projects of China (2012DFA60830).

## [References]

[1] Chen Huizhou, Li Rufang. 2003. Relevant Issues at Project Planning of Using Small hydropower Replacing Woody Fuel for Ecological Protection [J].China Water Resources, 13:37-41.

[2] Sun Tingrong, Fei Liangjun, Li Hong, et al. 2006. Estimation of the rural electric power consumption in the ecological protection areas with implementing the project of small hydropower for fuel [J].Transactions of the CSAE, 22(3):112-115. (In Chinese with English abstract)

[3] Using Delphi Creates the Word Report and the Dynamical Structured Form. Computer Applications and Software, 2007, 4(3):180-183.

[4] Zhang Weixiang, Wu Xin, Liu Wenhong. 2007. A Research on and Realization of Output of Structured Documents [J].Journal of Spacecraft TT&C Technology, 26(6): 91-94.

[5] Gao Hui. 2008.The Design and Realize of Physical Report Generation System [D].Dalian: Dalian University of Technology.

[6] Ge Fen, Wu Ning. 2007. A Platform for Automatically Producing Word Document Based on Multiple techniques[J].Journal of University of Electronic Science and Technology of China, 36(2): 263-266.

[7] Lu Baoyu, Yang Xinfang. 2007. Using Delphi Creates the Word Report and the Dynamical Structured Form [J].Computer Applications and Software,4(3): 180-183.

[8] Xiong Yurong, Chai Yi, Wang Shujuan, et al, 2010 Word Document Automatically Generated Technology Based on VC [J]. Computer Era, 1: 52-54.

[9] Troelsen A. 2011. Pro C# 2010 and the .Net 4.0 Platform [M]. Beijing: Posts & Telecom Press.

[10] Sharp J. 2010. Microsoft Visual C# 2010 Step by Step [M]. Translated by Zhou Jing. Beijing: Tsinghua University Press.

[11] LIU Peng, QIN Wei, ZHOU Yong-hui, GUO Yi-qi. 2012. Automatic Generation Method of Word Report Based on Dynamic Web Page [J].Computer Engineering, 38(5):279-284.