📄 reportform.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using Sun188.iSBus.Common;
using Sun188.iSBus.DataAccess;
using CrystalDecisions.CrystalReports.Engine;
namespace Sun188.iSBus.WinUI
{
/// <summary>
/// ReportForm 的摘要说明。
/// </summary>
public class ReportForm : System.Windows.Forms.Form
{
#region 控件定义===============================================
private System.Windows.Forms.Panel panel5;
private System.Windows.Forms.Panel panel4;
private System.Windows.Forms.StatusBar statusBar1;
private System.Windows.Forms.StatusBarPanel statusBarPanel1;
private System.Windows.Forms.StatusBarPanel statusBarPanel2;
private System.Windows.Forms.StatusBarPanel statusBarPanel3;
private System.Windows.Forms.ToolBarButton tbtnHelp;
private System.Windows.Forms.ImageList imageList2;
private System.Windows.Forms.ToolBarButton tbtnAbout;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Label lbTitle;
private System.Windows.Forms.Timer tmClock;
private System.Windows.Forms.ToolBarButton tbtnClose;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.Panel plRight;
private System.Windows.Forms.PictureBox pictureBox9;
private System.Windows.Forms.Panel plTop;
private System.Windows.Forms.PictureBox btnClose;
private System.Windows.Forms.PictureBox btnMax;
private System.Windows.Forms.PictureBox btnMin;
private System.Windows.Forms.PictureBox pictureBox7;
private System.Windows.Forms.PictureBox pictureBox6;
private System.Windows.Forms.PictureBox pictureBox5;
private System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.PictureBox pictureBox3;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel plLeft;
private System.Windows.Forms.PictureBox pictureBox8;
private System.Windows.Forms.Panel plBotton;
private System.Windows.Forms.PictureBox pictureBox12;
private System.Windows.Forms.PictureBox pictureBox11;
private System.Windows.Forms.PictureBox pictureBox10;
private System.Windows.Forms.ImageList imageList3;
private System.Windows.Forms.Panel panel6;
private CrystalDecisions.Windows.Forms.CrystalReportViewer reportView;
private System.Windows.Forms.ImageList imageList1;
private System.ComponentModel.IContainer components;
#endregion
#region 字段定义===============================================
/// <summary>
/// 鼠标的位置
/// </summary>
private int xPos,yPos;
/// <summary>
/// 鼠标偏移坐标
/// </summary>
private Point m_pOffset;
/// <summary>
/// 窗体的位置
/// </summary>
private Point locationMain = new Point(0,0);
/// <summary>
/// 最小按钮图片
/// </summary>
private Bitmap btnMinBmp;
/// <summary>
/// 关闭按钮图片
/// </summary>
private Bitmap btnCloseBmp;
/// <summary>
/// 最小按钮是否是MouseOver事件
/// </summary>
private bool btnMinMouseOver = false;
/// <summary>
/// 最小按钮是否是MouseDown事件
/// </summary>
private bool btnMinMouseDown = false;
/// <summary>
/// 关闭按钮是否是MouseOver事件
/// </summary>
private bool btnCloseMouseOver = false;
/// <summary>
/// 关闭按钮是否是MouseDown事件
/// </summary>
private bool btnCloseMouseDown = false;
/// <summary>
/// BusTable
/// </summary>
private DataTable dtBus;
/// <summary>
/// StopTable
/// </summary>
private DataTable dtStop;
/// <summary>
/// BusID
/// </summary>
private int busID;
/// <summary>
/// 汽车详细列表
/// </summary>
private BusList mBusListReport = new BusList();
/// <summary>
/// BusDataSet
/// </summary>
private BusDataList mBusListData = new BusDataList();
/// <summary>
/// 报表编号
/// </summary>
public int reportNo;
public string cityName,statrStopName,endStopName;
#endregion
#region 窗体加载事件处理=======================================
private void ReportForm_Load(object sender, System.EventArgs e)
{
//取动计时器
this.tmClock.Enabled = true;
//状态栏处理
this.StatusBar();
//设置最小化关闭按钮
this.DrawButton(1);
this.DrawButton(2);
//设置BusID
this.busID = MainForm.busID;
//设置数据源
this.SetDataBase();
//打印报表
this.ReportProcess();
}
#endregion
#region 清理资源===============================================
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#endregion
#region 构造函数===============================================
public ReportForm()
{
InitializeComponent();
}
#endregion
#region Windows Form Designer generated code===================
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ReportForm));
this.panel5 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.statusBar1 = new System.Windows.Forms.StatusBar();
this.statusBarPanel1 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel2 = new System.Windows.Forms.StatusBarPanel();
this.statusBarPanel3 = new System.Windows.Forms.StatusBarPanel();
this.tbtnHelp = new System.Windows.Forms.ToolBarButton();
this.imageList2 = new System.Windows.Forms.ImageList(this.components);
this.tbtnAbout = new System.Windows.Forms.ToolBarButton();
this.panel2 = new System.Windows.Forms.Panel();
this.lbTitle = new System.Windows.Forms.Label();
this.tmClock = new System.Windows.Forms.Timer(this.components);
this.tbtnClose = new System.Windows.Forms.ToolBarButton();
this.panel1 = new System.Windows.Forms.Panel();
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.plRight = new System.Windows.Forms.Panel();
this.pictureBox9 = new System.Windows.Forms.PictureBox();
this.plTop = new System.Windows.Forms.Panel();
this.btnClose = new System.Windows.Forms.PictureBox();
this.btnMax = new System.Windows.Forms.PictureBox();
this.btnMin = new System.Windows.Forms.PictureBox();
this.pictureBox7 = new System.Windows.Forms.PictureBox();
this.pictureBox6 = new System.Windows.Forms.PictureBox();
this.pictureBox5 = new System.Windows.Forms.PictureBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.plLeft = new System.Windows.Forms.Panel();
this.pictureBox8 = new System.Windows.Forms.PictureBox();
this.plBotton = new System.Windows.Forms.Panel();
this.pictureBox12 = new System.Windows.Forms.PictureBox();
this.pictureBox11 = new System.Windows.Forms.PictureBox();
this.pictureBox10 = new System.Windows.Forms.PictureBox();
this.imageList3 = new System.Windows.Forms.ImageList(this.components);
this.panel6 = new System.Windows.Forms.Panel();
this.reportView = new CrystalDecisions.Windows.Forms.CrystalReportViewer();
this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.statusBarPanel3)).BeginInit();
this.panel2.SuspendLayout();
this.panel1.SuspendLayout();
this.plRight.SuspendLayout();
this.plTop.SuspendLayout();
this.plLeft.SuspendLayout();
this.plBotton.SuspendLayout();
this.panel6.SuspendLayout();
this.SuspendLayout();
//
// panel5
//
this.panel5.Dock = System.Windows.Forms.DockStyle.Top;
this.panel5.Location = new System.Drawing.Point(4, 76);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(792, 2);
this.panel5.TabIndex = 29;
//
// panel4
//
this.panel4.Controls.AddRange(new System.Windows.Forms.Control[] {
this.statusBar1});
this.panel4.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel4.Location = new System.Drawing.Point(4, 574);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(792, 22);
this.panel4.TabIndex = 28;
//
// statusBar1
//
this.statusBar1.Name = "statusBar1";
this.statusBar1.Panels.AddRange(new System.Windows.Forms.StatusBarPanel[] {
this.statusBarPanel1,
this.statusBarPanel2,
this.statusBarPanel3});
this.statusBar1.ShowPanels = true;
this.statusBar1.Size = new System.Drawing.Size(792, 22);
this.statusBar1.TabIndex = 2;
//
// statusBarPanel1
//
this.statusBarPanel1.Icon = ((System.Drawing.Icon)(resources.GetObject("statusBarPanel1.Icon")));
this.statusBarPanel1.Width = 160;
//
// statusBarPanel2
//
this.statusBarPanel2.Icon = ((System.Drawing.Icon)(resources.GetObject("statusBarPanel2.Icon")));
this.statusBarPanel2.Width = 200;
//
// statusBarPanel3
//
this.statusBarPanel3.Width = 240;
//
// tbtnHelp
//
this.tbtnHelp.ImageIndex = 1;
this.tbtnHelp.Text = "使用帮助";
this.tbtnHelp.ToolTipText = "使用帮助";
//
// imageList2
//
this.imageList2.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this.imageList2.ImageSize = new System.Drawing.Size(16, 16);
this.imageList2.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList2.ImageStream")));
this.imageList2.TransparentColor = System.Drawing.Color.Transparent;
//
// tbtnAbout
//
this.tbtnAbout.ImageIndex = 0;
this.tbtnAbout.Text = "说明文档";
this.tbtnAbout.ToolTipText = "说明文档";
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.lbTitle});
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(4, 52);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(792, 24);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -