Beispiel #1
0
 /// <summary>
 /// 导出EXCEL时触发。
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void exporter_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
 {
     if (e.RowType == DevExpress.Web.GridViewRowType.Data && e.Column != null)
     {
         e.Text = Convert.ToString(e.TextValue);
     }
 }
        protected void ASPxGridViewExporter1_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            StringFormat      sFormat      = new StringFormat(StringFormatFlags.NoWrap);
            BrickStringFormat brickSFormat = new BrickStringFormat(sFormat);

            e.XlsxFormatString = sFormat.ToString();
        }
Beispiel #3
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;

            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 8)
            {
                string strCoCode = e.GetValue("CoCode").ToString();
                if (strCoCode != string.Empty)
                {
                    using (COMPANY_BO objT24_COMPANY_BO = new COMPANY_BO())
                    {
                        COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp";
                }
            }
        }
Beispiel #4
0
        protected void grvExport_RenderBrick(object sender, DevExpress.Web.ASPxGridViewExportRenderingEventArgs e)
        {
            GridViewDataColumn dataColumn = e.Column as GridViewDataColumn;

            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 7)
            {
                if (e.GetValue("Serials") != null)
                {
                    string strSerials = e.GetValue("Serials").ToString();
                    if (!string.IsNullOrEmpty(strSerials))
                    {
                        strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList());
                    }

                    e.TextValue = strSerials;
                }
                else
                {
                    e.TextValue = string.Empty;
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 9)
            {
                string strCoCode = e.GetValue("CO_CODE").ToString();
                if (strCoCode != string.Empty)
                {
                    using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO())
                    {
                        DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode);
                        if (objT24_COMPANY != null)
                        {
                            e.TextValue = objT24_COMPANY.COMPANY_NAME;
                        }
                    }
                }
            }

            dataColumn = e.Column as GridViewDataColumn;
            if (e.RowType == GridViewRowType.Data && dataColumn != null && dataColumn.VisibleIndex == 10)
            {
                if (e.GetValue("IsUsed") != null)
                {
                    bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed"));

                    if (strStatus)
                    {
                        e.TextValue = "Đã cấp mã";
                    }
                    else
                    {
                        e.TextValue = "Đã xóa";
                    }
                }
                else
                {
                    e.TextValue = "Đã cấp mã";
                }
            }
        }