Dzwebs.Net

撰写电脑技术杂文十余年

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

Admin | 2009-6-8 11:30:13 | 被阅次数 | 6857

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

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的窗体布局窗口为什么找不到窗体的Form1小图标

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

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计