楼盘管理系统销售报表模块的设计与实现

时间:2022-04-19 08:47:00

楼盘管理系统销售报表模块的设计与实现

摘要: 楼盘管理系统是一个功能完善的管理系统,由于篇幅的限制,主要介绍了系统中的销售报表模块的设计。系统是基于winform下的GridView控件来实现的,数据可以导出Excel,方便相关人员的二次处理的需求,整体采用了C/S结构及Web Service技术。

Abstract: Intelligent building management system is a perfect management system, because of space limitations, this paper mainly introduced the design of the sales report module in the system. The system is based on GridView control of WinForm, and the data can be exported from Excel, which facilitates the demand of two times treatment of the staff, the overall use is the C/S structure and Web Service technology.

关键词: 楼盘管理系统;销售报表;Web Service

Key words: intelligent building management system;sales reports;Web Service

中图分类号:TP311.5 文献标识码:A 文章编号:1006-4311(2015)04-0227-02

1 功能描述

楼盘管理系统是地产企业作为信息化建设的主要组成部分,其销售报表模块可根据开始日期和截止日期查询楼房销售信息,并具有统计功能,显示在GridView控件中,右键单击GridView控件,则弹出右键菜单,选择导出Excel可导出Excel表,在Excel中选择打印功能即可打印报表。

销售报表模块经常会需要打印销售信息,本论文采用的是将销售信息导出到Excel中,通过程序设置导出样式,在Excel中打印销售报表即可。

2 处理流程

销售报表模块首先根据用户输入的开始日期和截止日期进行查询,得到这一期间段的销售详细情况,并对销售情况进行统计,然后根据用户的选择是否进行导出操作,如是则导出Excel进行打印,否则不进行其它操作。销售报表模块的处理流程如图1所示。

3 数据导出Excel文件

楼房销售管理人员需将某一阶段的销售情况导出Excel文件,通过程序设计好Excel打印样式,可以将销售情况打印出来供上级管理人员查阅,并作为工作人员奖金、提成的依据,同时这些文件也需要备案,因此要打印出来装订成册。楼盘管理系统使用的是通用HSSFWorkbook对象,将网格视图(GridView)控件中的数据保存到Excel中。其主要代码如下:

private void Ex_Click(object sender, EventArgs e)

{ dadaosoft.Public.Excel.ExportToExcel(ref View1);

return;

SaveFileDialog f = new SaveFileDialog( );

f.Filter = "xls files (*.xls)|*.xls";

if (f.ShowDialog( ) == DialogResult.OK)

{ try

{ HSSFWorkbook excel = new HSSFWorkbook( );

DocumentSummaryInformation dsi=

PropertySetFactory.CreateDocumentSummaryInformation( );

pany = "";

excel.Document SummaryInformation=dsi; SummaryInformation si =

PropertySetFactory.CreateSummaryInformation( );

si.Subject = "xxx";

excel.SummaryInformation = si;

int SheetId = 1;

Sheet s1 = excel.CreateSheet(“temp”);

CellStyle styleCenter = excel.CreateCellStyle( );

styleCenter.Alignment =

NPOI.SS.UserModel.HorizontalAlignment.CENTER;

styleCenter.VerticalAlignment = VerticalAlignment.CENTER;

Row row = s1.CreateRow(0);

Cell cell = row.CreateCell(0);

s1.AddMergedRegion(new CellRangeAddress(0, 0, 0, 28));

s1.GetRow(0).GetCell(0).CellStyle = styleCenter;

s1.CreateRow(0).CreateCell(0).SetCellValue(d1.Text+"至"+d2.Text + " 销售报表");

row = s1.CreateRow(1);

row.CreateCell(0).SetCellValue("楼盘信息");

…… //重复省略

s1.AddMergedRegion(new CellRangeAddress(1, 1, 5, 19));

…… //重复省略

s1.GetRow(0).GetCell(0).CellStyle = styleCenter;

…… //重复省略

int rowNumber = 3;

Row r = s1.CreateRow(rowNumber);

for (int i = 1; i <= View1.Columns.Count - 1; i++)

{ r.CreateCell(i - 1).SetCellValue(View1.Columns[i].HeaderText);}

for (int i = 0; i <= View1.Rows.Count - 1; i++)

{ rowNumber = rowNumber + 1;

r = s1.CreateRow(rowNumber);

for (int j = 0; j < View1.Columns.Count - 1; j++)

{ if (View1.Rows[i].Cells[j + 1].Value == null)

{ r.CreateCell(j).SetCellValue("");}

else

{r.CreateCell(j).SetCellValue(View1.Rows[i].Cells[j + 1].Value.ToString( ));

} } }

FileStream file = new FileStream(f.FileName, FileMode.Create);

excel.Write(file);

file.Close( )

} } }

4 小结

楼盘管理系统是一个功能完善的管理系统,本文主要介绍了系统中的销售报表模块的设计。系统是基于winform下的GridView控件来实现的,数据可以导出Excel,方便相关人员的二次处理的需求,整体采用了C/S结构及Web Service技术。

参考文献:

[1]陈国才.基于的教学综合管理系统的设计与实现[D].大连:大连理工大学,2012.

[2]高红艳.Web报表开发中的若干关键技术研究与应用[D].西安.西安电子科技大学,2011.

[3](美)RonPatton著.软件测试[M].张小松,王钰,曹跃,等译.机械工业出版社,2006.

――――――――――――

项目来源:辽宁省教育科学“十二五”规划立项课题《辽宁省高职协调发展机制的建立与研究》,项目编号:JG14EB122。

作者简介:李建光(1978-),男,河北衡水人,实验师,硕士,主要研究领域为计算机应用、计算机网络工程等。

上一篇:浅谈城市轨道交通列车轴承故障的诊断 下一篇:我国货币供给内生性研究