上篇—水晶报表导出为word/excel文件的代码

Admin | 2009-6-8 11:30:13 | TrackRecord: 1586 Times | Tag标签:asp.net 打印本页

您当前所处的位置是:〖首页〗→【文章页】 本站共有16个图文教程栏目,请用心拜读!

本站提供经典的Excel公式函数实例,Word排版技巧,PPT教程;同时更兼有Flash,PowerPoint,数据库等技术文章。

using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using System.IO;
using Ghy.Funds.FundsClassLibrary;
using System.Data.SqlClient;
namespace WebAppTest
{
/// <summary>
/// WebForm1 的摘要说明。
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
   protected CrystalDecisions.Web.CrystalReportViewer CrystalReportViewer1;
   protected System.Web.UI.WebControls.DropDownList DropDownList1;
   protected System.Web.UI.WebControls.Button Btn_Export;
   protected System.Web.UI.WebControls.DropDownList DropDownList2;
   protected System.Web.UI.WebControls.Button btn_Export2;
   ReportDocument reportDoc=new ReportDocument();

   //页面加载
   //SqlConnection myconn = new SqlConnection(ConfigurationSettings.AppSettings["ConnectString"]);
   //SqlConnection myconn1 = new SqlConnection(ConfigurationSettings.AppSettings["ConnectString"]);
   //读取web.config配置文件中的数据库连接字符串,并连接到指定的数据库
 
   private void Page_Load(object sender, System.EventArgs e)
   {
    // Put user code to initialize the page here
    if (!Page.IsPostBack)
    {
     //测试的时候用绑定
              reportDataBind();
    }
  
   }

   #region Web Form Designer generated code
   override protected void OnInit(EventArgs e)
   {
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
    base.OnInit(e);
   }
 
   /// <summary>
   /// Required method for Designer support - do not modify
   /// the contents of this method with the code editor.
   /// </summary>
   private void InitializeComponent()
   {   
    this.btn_Export2.Click += new System.EventHandler(this.btn_Export2_Click);
    this.Load += new System.EventHandler(this.Page_Load);

   }
   #endregion



上一篇:VB的窗体布局窗口为什么找不到窗体的    下一篇:下篇—水晶报表导出为word/excel文件

会员评论列表:
针对本篇文章或本站,请您发表个人的建议或批评!
FreeBoxPc

谷歌搜索 百度搜索 本站仅与内容具备一定的实用价值的原创网站交换友情链接,力争为大众做出更优质的服务!
All Rights Reserved版权所有 本站备案信息:滇ICP备11001339号-2 站长联系方式 Email:dzwebs@126.com