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

📄 treereportexportfrm.cs

📁 树形逻辑报表程序源码,能根居元数据定义拖拉开发新的报表.
💻 CS
📖 第 1 页 / 共 2 页
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;
using DataDynamics.ActiveReports;
using DataDynamics.ActiveReports.Document;
using ArExports = DataDynamics.ActiveReports.Export;

namespace TreeReportApp
{
	/// <summary>
	/// ExportForm - 把一个RDF报表文档输出为文件格式: PDF/HTML/Excel/RTF/TIFF/Text
	/// </summary>
	public class ExportForm : System.Windows.Forms.Form
	{
		private System.Windows.Forms.ComboBox cboExportFormat;
		private System.Windows.Forms.Label lblExportFormat;
		private System.Windows.Forms.Button btnOK;
		private System.Windows.Forms.Button btnCancel;

		private DataDynamics.ActiveReports.Document.Document reportdocument;
		
		/// <summary>
		/// 所需变量
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.Label lblPDFFilename;
		private System.Windows.Forms.TextBox txtPDFFilename;

		// 文档输出对象(通用),是ActiveReports Export Component的实例,如PDF, HTML, excel等文档输出组件
		private object _exportComponent = null;

		//打开输出窗体的交窗体
		private TreeReportDesignFrm _Parent = null;
		public TreeReportDesignFrm ParentFormHolder
		{
			get
			{
				return this._Parent;
			}
			set
			{
				this._Parent = value;
				reportdocument = this._Parent.ReportDoc;
			}
		}

		public DataDynamics.ActiveReports.Document.Document documentforexport
		{
			get
			{
				return reportdocument;
			}
			set
			{
				reportdocument = value;
			}
		}

		private System.Windows.Forms.TextBox txtHTMLFolder;
		private System.Windows.Forms.Label lblHTMLFolder;
		private System.Windows.Forms.Button btnHTMLFolder;
		private System.Windows.Forms.TextBox txtHTMLTitle;
		private System.Windows.Forms.Label lblHTMLTitle;
		private System.Windows.Forms.Label lblHTMLCharset;
		private System.Windows.Forms.CheckBox chkCreateFrames;
		private System.Windows.Forms.Panel pBanner;
		private System.Windows.Forms.Button btnPDFFileName;
		private System.Windows.Forms.ComboBox cboHTMLCharSet;
		private System.Windows.Forms.CheckBox chkMultiPageOutput;
		private System.Windows.Forms.ComboBox cboHTMLBookMark;
		private System.Windows.Forms.Label lblHTMLBookMArk;
		private System.Windows.Forms.CheckBox chkHTMLIncludeHtmlHeader;
		private System.Windows.Forms.CheckBox chkHTMLIncludePageMargins;
		private System.Windows.Forms.CheckBox chkHTMLRemoveVerticalSpace;
		private System.Windows.Forms.ComboBox cboPDFVersion;
		private System.Windows.Forms.Label lblPDFVersion;
		private System.Windows.Forms.CheckBox chkPDFShowBookmarks;
		private System.Windows.Forms.CheckBox chkExportBookmarks;
		private System.Windows.Forms.SaveFileDialog dlgSaveFile;
		private System.Windows.Forms.PictureBox pictureBox1;
		private System.Windows.Forms.PictureBox pictureBox2;
		private System.Windows.Forms.PictureBox pictureBox3;
		private System.Windows.Forms.GroupBox groupBox1;
		private System.Windows.Forms.PropertyGrid pgExport;
		private System.Windows.Forms.PictureBox pictureBox4;
		private System.Windows.Forms.CheckedListBox lstFonts;
        
		
		public ExportForm()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ExportForm));
			this.pBanner = new System.Windows.Forms.Panel();
			this.cboExportFormat = new System.Windows.Forms.ComboBox();
			this.lblExportFormat = new System.Windows.Forms.Label();
			this.dlgSaveFile = new System.Windows.Forms.SaveFileDialog();
			this.btnOK = new System.Windows.Forms.Button();
			this.btnCancel = new System.Windows.Forms.Button();
			this.chkExportBookmarks = new System.Windows.Forms.CheckBox();
			this.chkPDFShowBookmarks = new System.Windows.Forms.CheckBox();
			this.lstFonts = new System.Windows.Forms.CheckedListBox();
			this.cboPDFVersion = new System.Windows.Forms.ComboBox();
			this.lblPDFVersion = new System.Windows.Forms.Label();
			this.lblPDFFilename = new System.Windows.Forms.Label();
			this.btnPDFFileName = new System.Windows.Forms.Button();
			this.txtPDFFilename = new System.Windows.Forms.TextBox();
			this.chkHTMLRemoveVerticalSpace = new System.Windows.Forms.CheckBox();
			this.chkMultiPageOutput = new System.Windows.Forms.CheckBox();
			this.chkHTMLIncludePageMargins = new System.Windows.Forms.CheckBox();
			this.chkCreateFrames = new System.Windows.Forms.CheckBox();
			this.chkHTMLIncludeHtmlHeader = new System.Windows.Forms.CheckBox();
			this.cboHTMLBookMark = new System.Windows.Forms.ComboBox();
			this.lblHTMLBookMArk = new System.Windows.Forms.Label();
			this.cboHTMLCharSet = new System.Windows.Forms.ComboBox();
			this.lblHTMLCharset = new System.Windows.Forms.Label();
			this.txtHTMLTitle = new System.Windows.Forms.TextBox();
			this.lblHTMLTitle = new System.Windows.Forms.Label();
			this.btnHTMLFolder = new System.Windows.Forms.Button();
			this.lblHTMLFolder = new System.Windows.Forms.Label();
			this.txtHTMLFolder = new System.Windows.Forms.TextBox();
			this.pictureBox1 = new System.Windows.Forms.PictureBox();
			this.pictureBox2 = new System.Windows.Forms.PictureBox();
			this.pictureBox3 = new System.Windows.Forms.PictureBox();
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.pgExport = new System.Windows.Forms.PropertyGrid();
			this.pictureBox4 = new System.Windows.Forms.PictureBox();
			this.pBanner.SuspendLayout();
			this.groupBox1.SuspendLayout();
			this.SuspendLayout();
			// 
			// pBanner
			// 
			this.pBanner.BackColor = System.Drawing.Color.Blue;
			this.pBanner.Controls.Add(this.pictureBox4);
			this.pBanner.Controls.Add(this.pictureBox3);
			this.pBanner.Controls.Add(this.pictureBox2);
			this.pBanner.Controls.Add(this.pictureBox1);
			this.pBanner.Location = new System.Drawing.Point(0, 0);
			this.pBanner.Name = "pBanner";
			this.pBanner.Size = new System.Drawing.Size(490, 72);
			this.pBanner.TabIndex = 0;
			// 
			// cboExportFormat
			// 
			this.cboExportFormat.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cboExportFormat.Items.AddRange(new object[] {
																 "Portable Document Format (PDF)",
																 "ActiveReport Document Format (RDF)",
																 "Rich Text Format (RTF)",
																 "HTML",
																 "Microsoft Excel WorkSheet (XLS)",
																 "Tagged Image File Format (TIFF)",
																 "Text"});
			this.cboExportFormat.Location = new System.Drawing.Point(119, 78);
			this.cboExportFormat.Name = "cboExportFormat";
			this.cboExportFormat.Size = new System.Drawing.Size(319, 20);
			this.cboExportFormat.TabIndex = 1;
			this.cboExportFormat.SelectedIndexChanged += new System.EventHandler(this.cboExportFormat_SelectedIndexChanged);
			// 
			// lblExportFormat
			// 
			this.lblExportFormat.Image = ((System.Drawing.Image)(resources.GetObject("lblExportFormat.Image")));
			this.lblExportFormat.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.lblExportFormat.Location = new System.Drawing.Point(9, 81);
			this.lblExportFormat.Name = "lblExportFormat";
			this.lblExportFormat.Size = new System.Drawing.Size(105, 17);
			this.lblExportFormat.TabIndex = 2;
			this.lblExportFormat.Text = "输出文件格式:";
			this.lblExportFormat.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// dlgSaveFile
			// 
			this.dlgSaveFile.FileName = "ReportExport";
			// 
			// btnOK
			// 
			this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.btnOK.Image = ((System.Drawing.Image)(resources.GetObject("btnOK.Image")));
			this.btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnOK.Location = new System.Drawing.Point(96, 379);
			this.btnOK.Name = "btnOK";
			this.btnOK.Size = new System.Drawing.Size(87, 26);
			this.btnOK.TabIndex = 5;
			this.btnOK.Text = "确  认";
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// btnCancel
			// 
			this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image")));
			this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
			this.btnCancel.Location = new System.Drawing.Point(258, 379);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(87, 26);
			this.btnCancel.TabIndex = 6;
			this.btnCancel.Text = "取 消";
			this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
			// 
			// chkExportBookmarks
			// 
			this.chkExportBookmarks.Location = new System.Drawing.Point(0, 0);
			this.chkExportBookmarks.Name = "chkExportBookmarks";
			this.chkExportBookmarks.TabIndex = 0;
			// 
			// chkPDFShowBookmarks
			// 
			this.chkPDFShowBookmarks.Location = new System.Drawing.Point(0, 0);
			this.chkPDFShowBookmarks.Name = "chkPDFShowBookmarks";
			this.chkPDFShowBookmarks.TabIndex = 0;
			// 
			// lstFonts
			// 
			this.lstFonts.Location = new System.Drawing.Point(0, 0);
			this.lstFonts.Name = "lstFonts";
			this.lstFonts.TabIndex = 0;
			// 
			// cboPDFVersion
			// 
			this.cboPDFVersion.Location = new System.Drawing.Point(0, 0);
			this.cboPDFVersion.Name = "cboPDFVersion";
			this.cboPDFVersion.TabIndex = 0;
			// 
			// lblPDFVersion
			// 
			this.lblPDFVersion.Location = new System.Drawing.Point(0, 0);
			this.lblPDFVersion.Name = "lblPDFVersion";
			this.lblPDFVersion.TabIndex = 0;
			// 
			// lblPDFFilename
			// 
			this.lblPDFFilename.Location = new System.Drawing.Point(0, 0);
			this.lblPDFFilename.Name = "lblPDFFilename";
			this.lblPDFFilename.TabIndex = 0;
			// 
			// btnPDFFileName
			// 
			this.btnPDFFileName.Location = new System.Drawing.Point(0, 0);
			this.btnPDFFileName.Name = "btnPDFFileName";
			this.btnPDFFileName.TabIndex = 0;
			// 
			// txtPDFFilename
			// 
			this.txtPDFFilename.Location = new System.Drawing.Point(0, 0);
			this.txtPDFFilename.Name = "txtPDFFilename";
			this.txtPDFFilename.TabIndex = 0;
			this.txtPDFFilename.Text = "";
			// 
			// chkHTMLRemoveVerticalSpace
			// 
			this.chkHTMLRemoveVerticalSpace.Location = new System.Drawing.Point(0, 0);
			this.chkHTMLRemoveVerticalSpace.Name = "chkHTMLRemoveVerticalSpace";
			this.chkHTMLRemoveVerticalSpace.TabIndex = 0;
			// 
			// chkMultiPageOutput
			// 
			this.chkMultiPageOutput.Location = new System.Drawing.Point(0, 0);
			this.chkMultiPageOutput.Name = "chkMultiPageOutput";
			this.chkMultiPageOutput.TabIndex = 0;
			// 
			// chkHTMLIncludePageMargins
			// 
			this.chkHTMLIncludePageMargins.Location = new System.Drawing.Point(0, 0);
			this.chkHTMLIncludePageMargins.Name = "chkHTMLIncludePageMargins";
			this.chkHTMLIncludePageMargins.TabIndex = 0;
			// 
			// chkCreateFrames
			// 
			this.chkCreateFrames.Location = new System.Drawing.Point(0, 0);
			this.chkCreateFrames.Name = "chkCreateFrames";
			this.chkCreateFrames.TabIndex = 0;
			// 
			// chkHTMLIncludeHtmlHeader
			// 
			this.chkHTMLIncludeHtmlHeader.Location = new System.Drawing.Point(0, 0);
			this.chkHTMLIncludeHtmlHeader.Name = "chkHTMLIncludeHtmlHeader";
			this.chkHTMLIncludeHtmlHeader.TabIndex = 0;
			// 
			// cboHTMLBookMark
			// 
			this.cboHTMLBookMark.Location = new System.Drawing.Point(0, 0);
			this.cboHTMLBookMark.Name = "cboHTMLBookMark";
			this.cboHTMLBookMark.TabIndex = 0;
			// 
			// lblHTMLBookMArk
			// 
			this.lblHTMLBookMArk.Location = new System.Drawing.Point(0, 0);
			this.lblHTMLBookMArk.Name = "lblHTMLBookMArk";
			this.lblHTMLBookMArk.TabIndex = 0;
			// 
			// cboHTMLCharSet
			// 
			this.cboHTMLCharSet.Location = new System.Drawing.Point(0, 0);
			this.cboHTMLCharSet.Name = "cboHTMLCharSet";
			this.cboHTMLCharSet.TabIndex = 0;
			// 
			// lblHTMLCharset
			// 
			this.lblHTMLCharset.Location = new System.Drawing.Point(0, 0);
			this.lblHTMLCharset.Name = "lblHTMLCharset";
			this.lblHTMLCharset.TabIndex = 0;
			// 
			// txtHTMLTitle
			// 
			this.txtHTMLTitle.Location = new System.Drawing.Point(0, 0);
			this.txtHTMLTitle.Name = "txtHTMLTitle";
			this.txtHTMLTitle.TabIndex = 0;
			this.txtHTMLTitle.Text = "";
			// 

⌨️ 快捷键说明

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