我在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"> </td>
<td colspan="2" class="auto-style1">
Musandam </td>
<td colspan="2" class="auto-style1"> Al-wusta </td>
<td colspan="2" class="auto-style1"> Alburaimi </td>
<td colspan="2" class="auto-style1"> Al-Dhahira </td>
<td colspan="2" class="auto-style1"> Dohfar </td>
<td colspan="2" class="auto-style1"> Al-dhakhila </td>
<td colspan="2" class="auto-style1"> Al-sharqiya(n) </td>
<td colspan="2" class="auto-style1"> Al-sharqiyah </td>
<td colspan="2" class="auto-style1"> Albatiniah(s) </td>
<td colspan="2" class="auto-style1"> Al-Albatinah </td>
<td colspan="2" class="auto-style1"> Muscat </td>
</tr>
<tr>
<td colspan="2" class="bgtd1">Gender</td>
<td class="title"><span id="result_box8" lang="ar" xml:lang="ar"> مجموع </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">الهندسة </td>
<td rowspan="4" class="bgtd1"><div class="repFont "> مؤسسة </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"> تكنولوجيا المعلومات </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>