reportsum.cs

来自「财务凭证管理系统,主要是从事公司或部门的财务方面的管理。此系统给会计人员带来很大」· CS 代码 · 共 80 行

CS
80
字号
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CrystalDecisions.CrystalReports.Engine;
using property.control.Subject;
using property.model.GetConnection;
namespace property.view.HinderInfo
{
    public partial class reportSum : Form
    {
        public reportSum()
        {
            InitializeComponent();
        }
        public reportSum(int P_int_id)
        {
            InitializeComponent();
            P_int_select = P_int_id;
        }
        public reportSum(int P_int_id,string P_string_WId)
        {
            InitializeComponent();
            P_int_select = P_int_id;
            P_str_select = P_string_WId;
        }
        public int P_int_select;
        public string P_str_select;
        private void reportSum_Load(object sender, EventArgs e)
        {
            GetSubject gs = new GetSubject();
            //科目编号
            if (P_int_select != 0 && P_str_select == "SubjectID")
            {
                string reportPath = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0,
                 Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
                reportPath += @"\view\hinderInfo\repSumSubject.rpt";
                ReportDocument rd = new ReportDocument();
                rd.Load(reportPath);
                rd.SetDataSource(gs.getds(P_int_select, "subjectid").Tables[0].DefaultView);
                this.crystalReportViewer1.ReportSource = rd;
                return;
            }// end block
            //凭证编号
            if (P_int_select != 0 && P_str_select == "warrId")
            {

                string reportPath = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0,
              Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
                reportPath += @"\view\hinderInfo\repSumSubject.rpt";
                ReportDocument rd = new ReportDocument();
                rd.Load(reportPath);
                rd.SetDataSource(gs.getds(P_int_select, "WarId").Tables[0].DefaultView);
                this.crystalReportViewer1.ReportSource = rd;
                return;
            }
           //全部信息
            if (P_str_select != null)
            {
                string reportPath = Application.StartupPath.Substring(0, Application.StartupPath.Substring(0,
       Application.StartupPath.LastIndexOf("\\")).LastIndexOf("\\"));
                reportPath += @"\view\hinderInfo\repSumSubject.rpt";
                ReportDocument rd = new ReportDocument();
                rd.Load(reportPath);
                rd.SetDataSource(gs.getds(1, "one").Tables[0].DefaultView);
                this.crystalReportViewer1.ReportSource = rd;
                return;
            }





        }// end block 
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?