使用css和阿拉伯语数据导出Html表也显示在asp.net C#中表现出色

时间:2014-07-21 06:09:10

标签: c# html css asp.net excel

我在asp.net中有下表,我想生成excel与css和阿拉伯语数据也显示在reoprt.I我使用以下但不是阿拉伯数据出现在我的Excel中,而不是阿拉伯数据出现在我的CSS中。我是使用asp.net c#

Response.ContentType = "application/x-msexcel";
                Response.AddHeader("Content-Disposition", "attachment; filename=ExcelFile.xls"); Response.ContentEncoding = System.Text.Encoding.UTF8;
                StringWriter tw = new System.IO.StringWriter(); HtmlTextWriter 
                    hw = new HtmlTextWriter(tw); tblid.RenderControl(hw);
                Response.Write(tw.ToString());
                Response.End();



<style type="text/css" >
    .repFont
    {
     -webkit-transform: rotate(-90deg); 
    -moz-transform: rotate(-90deg);
    width: 53px;
    }
        table {
            border: 1px solid black;
            border-spacing:0px;

        }
         td {
        border: 1px solid black;
        border-spacing:0px;
        font-size:11PX;
        text-align:center;
        padding: 0px;
    }

        .auto-style1 {
            height: 27px;
        }
            .bgtd1 {
                background-color:#FFFF99;
            }
            .title {
                color:#CC3333;
            }
            .titleMale {
            color:#3366FF;
            }
            .titleTotal {
                font-weight:bold;
                font-size:12PX;
            }
            .maintitle {
             font-size:12px;

            }
            .maintileArabic {

                color:#CC3333;
                padding-left: 187px;
            }
            .maintileEng {

                color:#3366FF;
                padding-left: 113px;
                 padding-bottom: 11px;
            }

        </style>    
    <table id="tblid" runat="server"  border="1" >
          <tr class="bgtd1">
            <td colspan="2" rowspan="2" class="title">Region</td>
            <td  colspan="3" class="title"><span id="result_box" lang="ar" xml:lang="ar">المجموع العام</span></td>
            <td colspan="2" class="title"> سلطانالخارج</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" class="title">مسندم</td>
            <td colspan="2" rowspan="2" class="title"><span id="result_box2" lang="ar" xml:lang="ar">منطقة</span></td>
          </tr>
          <tr class="bgtd1">
            <td  colspan="3" class="auto-style1">Grand Total</td>
            <td colspan="2" class="auto-style1">&nbsp;&nbsp;</td>
            <td colspan="2" class="auto-style1">
                &nbsp;Musandam&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Al-wusta&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Alburaimi&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Al-Dhahira&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Dohfar&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;&nbsp;Al-dhakhila&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Al-sharqiya(n)&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Al-sharqiyah&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Albatiniah(s)&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Al-Albatinah&nbsp;</td>
            <td colspan="2" class="auto-style1">&nbsp;Muscat&nbsp;</td>
          </tr>
          <tr>
            <td colspan="2" class="bgtd1">Gender</td>
            <td class="title"><span id="result_box8" lang="ar" xml:lang="ar">&nbsp;مجموع&nbsp;</span></td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td>١</td>
            <td class="titleMale" >ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td>١</td>
            <td class="titleMale">ذ</td>
            <td>١</td>
            <td class="titleMale">ذ</td>
            <td>١</td>
            <td class="titleMale">ذ</td>
            <td >١</td>
            <td class="titleMale">ذ</td>
            <td colspan="2" class="bgtd1"><span id="result_box3" lang="ar" xml:lang="ar">جنس</span></td>
          </tr>
          <tr>
            <td colspan="2" class="bgtd1">Specialization</td>
            <td class="title">Total</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td>F</td>
            <td class="titleMale">M</td>
            <td colspan="2" class="bgtd1" ><span id="result_box4" lang="ar" xml:lang="ar">تخصص</span></td>
          </tr>
          <tr>
            <td  rowspan="4" class="bgtd1"><div class="repFont bgtd1">Foundation</div></td>
            <td class="bgtd1">Engnieering</td>
            <td >120</td>
            <td>48</td>
            <td class="titleMale">72</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td>0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td class="bgtd1">الهندسة&nbsp;</td>
            <td  rowspan="4" class="bgtd1"><div  class="repFont ">&nbsp;مؤسسة&nbsp;</div></td>
          </tr>
          <tr>
              <td class="bgtd1">Information Technology</td>
            <td>213</td>
            <td>147</td>
            <td class="titleMale">66</td>
            <td>1</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td>0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td >1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>1</td>
            <td  class="titleMale">1</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td class="bgtd1">&nbsp;تكنولوجيا المعلومات&nbsp;</td>
          </tr>
          <tr>
            <td rowspan="2" class="bgtd1"><span class="titleTotal">Total</span></td>
            <td rowspan="2">313</td>
            <td >195</td>
            <td  class="titleMale">138</td>
            <td>1</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>2</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>2</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td>0</td>
            <td>2</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>2</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td>2</td>
            <td  class="titleMale">2</td>
            <td>0</td>
            <td  class="titleMale">0</td>
            <td rowspan="2" class="bgtd1" >إجمالي</td>
          </tr>
          <tr>
            <td colspan="2">313</td>
            <td colspan="2">3</td>
            <td colspan="2">0</td>
            <td colspan="2">4</td>
            <td colspan="2">0</td>
            <td colspan="2">4</td>
            <td colspan="2">0</td>
            <td colspan="2">4</td>
            <td colspan="2">0</td>
            <td colspan="2">4</td>
            <td colspan="2">0</td>
            <td colspan="2">4</td>
            <td colspan="2">0</td>
          </tr>
        </table>

0 个答案:

没有答案