C# 开发快速打印按钮 您好,我有一个devexpress网格13.2如何允许用户打印网格?要打印----------或通过导出到excel。

C# 开发快速打印按钮 您好,我有一个devexpress网格13.2如何允许用户打印网格?要打印----------或通过导出到excel。,c#,asp.net,devexpress,C#,Asp.net,Devexpress,//*-------------------------------------------------------------------------- a您应该使用DevXPress提供的ASPxGridViewExporter-特殊组件来支持将ASPxGridView导出为不同格式。它的用法非常清楚,并在以下的在线文档中进行了解释:。要将ASPxGridView导出到Excel,需要使用以下方法中的任何方法: WriteXls,WriteXlsToResponse,WriteXlsx,wr

//*--------------------------------------------------------------------------
a

您应该使用DevXPress提供的ASPxGridViewExporter-特殊组件来支持将ASPxGridView导出为不同格式。它的用法非常清楚,并在以下的在线文档中进行了解释:。要将ASPxGridView导出到Excel,需要使用以下方法中的任何方法:

WriteXls,WriteXlsToResponse,WriteXlsx,writexlsxtorresponse。所有这些都在这里描述:

可能存在的副本
    using DevExpress.Web.ASPxEditors;
using DevExpress.Web.ASPxGridView;
using DevExpress.Web.ASPxTreeView;
using FDB.Base;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//* --------------------------------------------------------------------------
namespace FDB.Views
{
    public partial class Interchange : BasePage
    {
        #region Properties

        public string ID_KEY
        {
            get
            {
                if (hfCommon.Contains("ID_KEY"))
                    return hfCommon.Get("ID_KEY").ToString();
                else
                    return "";
            }
            set
            {
                if (hfCommon.Contains("ID_KEY"))
                    hfCommon.Set("ID_KEY", value);
                else
                    hfCommon.Add("ID_KEY", value);
            }
        }

        public decimal SEQNO
        {
            get
            {
                if (hfCommon.Contains("SEQNO"))
                    return hfCommon.Get("SEQNO").ToDecimal();
                else
                    return 0;
            }
            set
            {
                if (hfCommon.Contains("SEQNO"))
                    hfCommon.Set("SEQNO", value);
                else
                    hfCommon.Add("SEQNO", value);
            }
        }
//* --------------------------------------------------------------------------
        public int STAT
        {
            get
            {
                if (hfCommon.Contains("STAT"))
                    return hfCommon.Get("STAT").ToInt();
                else
                    return 0;
            }
            set
            {
                if (hfCommon.Contains("STAT"))
                    hfCommon.Set("STAT", value);
                else
                    hfCommon.Add("STAT", value);
            }
        }
//* --------------------------------------------------------------------------
        public string NDC
        {
            get
            {
                if (hfCommon.Contains("NDC"))
                    return hfCommon.Get("NDC").ToString();
                else
                    return "";
            }
            set
            {
                if (hfCommon.Contains("NDC"))
                    hfCommon.Set("NDC", value);
                else
                    hfCommon.Add("NDC", value);
            }
        }

        public string Reason
        {
            get
            {
                if (hfCommon.Contains("Reason"))
                    return hfCommon.Get("Reason").ToString();
                else
                    return "";
            }
            set
            {
                if (hfCommon.Contains("Reason"))
                    hfCommon.Set("Reason", value);
                else
                    hfCommon.Add("Reason", value);
            }
        }

        public string ReasonText
        {
            get
            {
                if (hfCommon.Contains("ReasonText"))
                    return hfCommon.Get("ReasonText").ToString();
                else
                    return "";
            }
            set
            {
                if (hfCommon.Contains("ReasonText"))
                    hfCommon.Set("ReasonText", value);
                else
                    hfCommon.Add("ReasonText", value);
            }
        }

        public bool OnClickonShowData
        {
            get
            {
                if (hfCommon.Contains("OnClickonShowData"))
                    return hfCommon.Get("OnClickonShowData").ToBoolean();
                else
                    return false;
            }
            set
            {
                if (hfCommon.Contains("OnClickonShowData"))
                    hfCommon.Set("OnClickonShowData", value);
                else
                    hfCommon.Add("OnClickonShowData", value);
            }
        }



        public bool ShowHideFilter
        {
            get
            {
                if (hfCommon.Contains("ShowHideFilter"))
                    return hfCommon.Get("ShowHideFilter").ToBoolean();
                else
                    return false;
            }
            set
            {
                if (hfCommon.Contains("ShowHideFilter"))
                    hfCommon.Set("ShowHideFilter", value);
                else
                    hfCommon.Add("ShowHideFilter", value);
            }
        }

        #endregion

        #region Events

        protected void Page_Load(object sender, EventArgs e)
        {
            FDB.Enums.UserType userType = (FDB.Enums.UserType)Session["UserType"];
            this.gvPBMCharges.HtmlRowCreated += gvPBMCharges_HtmlRowCreated;
            this.gvPBMCharges.CustomCallback += gvPBMCharges_CustomCallback;
            this.gvPBMCharges.HtmlRowPrepared += gvPBMCharges_HtmlRowPrepared;
            this.gvPBMCharges.EnableRowsCache = false;

            ChckLogin();
            LoadTitle();
            PopulateFacilityList();

            if (!IsPostBack && !IsCallback)
            {
                this.OnClickonShowData = false;
                //SelectAllNodes();
                if (userType != Enums.UserType.Admin_User)
                {
                    chkSelectAll.Checked = true;
                    cblFacility.SelectAll();