⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mycrystalreport.h

📁 Visual C++.net数据库开发经典案例
💻 H
字号:
#pragma once

using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;


namespace My
{
	/// <summary> 
	/// MyCrystalReport 摘要
	///
	/// 警告: 如果您更改该类的名称,则将需要更改 
	///          与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的 
	///          “资源文件名”属性。  否则,
	///          设计器将不能与此窗体关联的
	///          本地化资源正确交互。
	/// </summary>
	public __gc class MyCrystalReport : public System::Windows::Forms::Form
	{
	public: 
		MyCrystalReport(void)
		{
			InitializeComponent();
		}
        
	protected: 
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}
	private: CrystalDecisions::Windows::Forms::CrystalReportViewer *  crystalReportViewer1;
	private: System::Data::SqlClient::SqlDataAdapter *  sqlDataAdapter1;
	private: System::Data::SqlClient::SqlCommand *  sqlSelectCommand1;
	private: System::Data::SqlClient::SqlConnection *  sqlConnection1;
	private: My::ReportDataSet *  reportDataSet1;

	private:
		/// <summary>
		/// 必需的设计器变量。
		/// </summary>
		System::ComponentModel::Container* components;

		/// <summary>
		/// 设计器支持所需的方法 - 不要使用代码编辑器修改
		/// 此方法的内容。
		/// </summary>
		void InitializeComponent(void)
		{
			this->crystalReportViewer1 = new CrystalDecisions::Windows::Forms::CrystalReportViewer();
			this->sqlDataAdapter1 = new System::Data::SqlClient::SqlDataAdapter();
			this->sqlSelectCommand1 = new System::Data::SqlClient::SqlCommand();
			this->sqlConnection1 = new System::Data::SqlClient::SqlConnection();
			this->reportDataSet1 = new My::ReportDataSet();
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->reportDataSet1))->BeginInit();
			this->SuspendLayout();
			// 
			// crystalReportViewer1
			// 
			this->crystalReportViewer1->ActiveViewIndex = -1;
			this->crystalReportViewer1->DisplayGroupTree = false;
			this->crystalReportViewer1->Dock = System::Windows::Forms::DockStyle::Fill;
			this->crystalReportViewer1->Location = System::Drawing::Point(0, 0);
			this->crystalReportViewer1->Name = S"crystalReportViewer1";
			this->crystalReportViewer1->ReportSource = __box(0);
			this->crystalReportViewer1->Size = System::Drawing::Size(680, 365);
			this->crystalReportViewer1->TabIndex = 0;
			// 
			// sqlDataAdapter1
			// 
			this->sqlDataAdapter1->SelectCommand = this->sqlSelectCommand1;
			System::Data::Common::DataTableMapping* __mcTemp__1[] = new System::Data::Common::DataTableMapping*[1];
			System::Data::Common::DataColumnMapping* __mcTemp__2[] = new System::Data::Common::DataColumnMapping*[15];
			__mcTemp__2[0] = new System::Data::Common::DataColumnMapping(S"供货商号", S"StockerID");
			__mcTemp__2[1] = new System::Data::Common::DataColumnMapping(S"货号", S"WareID");
			__mcTemp__2[2] = new System::Data::Common::DataColumnMapping(S"进货日期", S"ImportDate");
			__mcTemp__2[3] = new System::Data::Common::DataColumnMapping(S"业务员", S"Operator");
			__mcTemp__2[4] = new System::Data::Common::DataColumnMapping(S"制单人", S"Creater");
			__mcTemp__2[5] = new System::Data::Common::DataColumnMapping(S"进货数量", S"ImportQuantity");
			__mcTemp__2[6] = new System::Data::Common::DataColumnMapping(S"进价", S"ImportPrice");
			__mcTemp__2[7] = new System::Data::Common::DataColumnMapping(S"税价合计", S"Total");
			__mcTemp__2[8] = new System::Data::Common::DataColumnMapping(S"税率", S"TaxRate");
			__mcTemp__2[9] = new System::Data::Common::DataColumnMapping(S"不含税价", S"TotalNoTax");
			__mcTemp__2[10] = new System::Data::Common::DataColumnMapping(S"税额", S"Tax");
			__mcTemp__2[11] = new System::Data::Common::DataColumnMapping(S"名称", S"Name");
			__mcTemp__2[12] = new System::Data::Common::DataColumnMapping(S"品名", S"WareName");
			__mcTemp__2[13] = new System::Data::Common::DataColumnMapping(S"仓库", S"StorageID");
			__mcTemp__2[14] = new System::Data::Common::DataColumnMapping(S"单位", S"Unit");
			__mcTemp__1[0] = new System::Data::Common::DataTableMapping(S"Table", S"ImportTable", __mcTemp__2);
			this->sqlDataAdapter1->TableMappings->AddRange(__mcTemp__1);
			// 
			// sqlSelectCommand1
			// 
			this->sqlSelectCommand1->CommandText = S"SELECT a.供货商号, b.货号, a.进货日期, a.业务员, a.制单人, b.进货数量, b.进价, b.税价合计, b.税率, b.不含税价, b." 
				S"税额, c.名称, d.品名, b.仓库, d.单位 FROM 进货单 a INNER JOIN 进货单明细 b ON a.编号 = b.进货单号 INNER " 
				S"JOIN 供货商清单 c ON a.供货商号 = c.供货商号 INNER JOIN 商品清单 d ON b.货号 = d.货号";
			this->sqlSelectCommand1->Connection = this->sqlConnection1;
			// 
			// sqlConnection1
			// 
			this->sqlConnection1->ConnectionString = S"workstation id=localhost;packet size=4096;integrated security=SSPI;initial catalo" 
				S"g=JxcBook;persist security info=False";
			// 
			// reportDataSet1
			// 
			this->reportDataSet1->DataSetName = S"ReportDataSet";
			this->reportDataSet1->Locale = new System::Globalization::CultureInfo(S"zh-CN");
			// 
			// MyCrystalReport
			// 
			this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
			this->ClientSize = System::Drawing::Size(680, 365);
			this->Controls->Add(this->crystalReportViewer1);
			this->Name = S"MyCrystalReport";
			this->Text = S"MyCrystalReport";
			(__try_cast<System::ComponentModel::ISupportInitialize *  >(this->reportDataSet1))->EndInit();
			this->ResumeLayout(false);

		}		
	};
}

⌨️ 快捷键说明

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