当前位置:跳过导航链接计算机毕业设计首页 : C#计算机毕业设计 : 详细内容

C#商品进销存销售管理系统(程序下载)(11)

来源:xiaoniu168.com 作者:本站原创 添加时间:2014-12-04 点击数:44481

计算机毕业设计介绍:

7.5报表模块设计
终于写到了本系统最重要的模块,销售报表查询是本系统的主要功能,可以按照员工销售的业绩、商品销售类型、商品销售区域和商品销售季度进行查询,此外本系统还能通过报表对员工信息和往来单位信息进行查询,并能将查询到的报表信息导出到Word或Excel打印。
由于篇幅有限且各查询模块的功能相近,所以此处只列出报表设计模块的员工销售业绩分析报表。
7.5.3后台代码
系统报表设计模块下的员工销售业绩分析报表界面设计后台代码:
namespace ERP之商品进销存销售报表系统.ReportsDesign
{
    public partial class EmployeeSellResult : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
//如果CheckBox未被选中
                if (CheckBox1.Checked == false)
                {
//数据库连接字符串
                    string str = "Server=(local);database=ERP之进销存销售报表;Integrated Security=SSPI";
                    SqlConnection myConn = new SqlConnection(str);
                    //根据查询条件显示查询结果
                    SqlDataAdapter myda = new SqlDataAdapter("select 销售单号,商品名称,商品类型,销售日期,员工ID,员工姓名,客户编码,销售数量,进货单价,销售单价,应收金额,实收金额,备注 from 销售信息表 where (商品名称='" + this.TextBox2.Text + "' or 员工姓名='" + this.TextBox1.Text + "' or 员工ID='" + this.TextBox5.Text + "')", myConn);
                    DataSet myds = new DataSet();
                    myConn.Open();
                    myda.Fill(myds);
                    myConn.Close();
                    //显示报表控件
                    ReportViewer1.Visible = true;//显示报表中的内容
                    ReportDataSource rds = new ReportDataSource("商品销售类型DataSet_销售信息表", myds.Tables[0]);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                }
//如果CheckBox被选中
                else
                {
//数据库连接字符串
                    string str = "Server=(local);database=ERP之进销存销售报表;Integrated Security=SSPI";
                    SqlConnection myConn = new SqlConnection(str);
                   
//根据查询条件显示相应的查询结果
                    SqlDataAdapter myda = new SqlDataAdapter("select 销售单号,商品名称,商品类型,销售日期,员工ID,员工姓名,客户编码,销售数量,进货单价,销售单价,应收金额,实收金额,备注 from 销售信息表 where (销售日期='"+this.DropDownList1.Text+"'or 商品类型='"+this.DropDownList2.Text+"' or 商品名称='" + this.TextBox2.Text + "' or 员工姓名='" + this.TextBox1.Text + "' or 员工ID='" + this.TextBox5.Text + "')", myConn);
                    DataSet myds = new DataSet();
                    myConn.Open();
                    myda.Fill(myds);
                    myConn.Close();
                    //显示报表控件
                    ReportViewer1.Visible = true;//显示报表中的内容
                    ReportDataSource rds = new ReportDataSource("商品销售类型DataSet_销售信息表", myds.Tables[0]);
                    ReportViewer1.LocalReport.DataSources.Clear();
                    ReportViewer1.LocalReport.DataSources.Add(rds);
                    ReportViewer1.LocalReport.Refresh();
                }}

〖资料来源:计算机毕业论文 www.xiaoniu168.com

第12页为计算机毕业论文部分......

【联系方式】

【本站信誉】

用心做计算机毕业设计论文网