protected void btnExport_Click(object sender, EventArgs e)
{
FarPoint.Web.Spread.FpSpread ExportSpread = new FarPoint.Web.Spread.FpSpread();
ExportSpread = fpSpreadScan;
FarPoint.Web.Spread.SheetView pSheet = ExportSpread.Sheets[0];
pSheet.ColumnFooterVisible = false;
pSheet.RowHeaderVisible = false;
if (ExportSpread.Sheets.Count <= 0)
{
ExportSpread.Sheets.Add(pSheet);
ExportSpread.Sheets[0] = pSheet;
}
else
{
ExportSpread.Sheets[0] = pSheet;
}
for (int rowindex = 2; rowindex < ExportSpread.Sheets[0].RowCount - 1; rowindex++)
{
for (int col = 0; col < 13; col++)
{
ExportSpread.ActiveSheetView.Cells[rowindex, col].Border = new Border(BorderStyle.Solid, Color.Black, 2);
}
}
//ExportSpread.Sheets[0].Cells[3, 9].Border.BorderStyleBottom = BorderStyle.Solid;//单元格底部有边框
//ExportSpread.Sheets[0].Cells[rowindex, colindex].Border.BorderStyleTop = BorderStyle.Solid;//上部有边框
ExportSpread.Sheets[0].Cells[3, 9].Border.BorderStyleRight = BorderStyle.None;//右边无边框
ExportSpread.Sheets[0].Cells[3, 10].Border.BorderStyleLeft = BorderStyle.None;//左侧无边框
fpSpreadScan.SaveExcelToResponse(string.Format("{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmssff")));
}
这个是我的导出方法。有些用户的IE8 浏览器 兼容/非兼容模式下导出都是只有画出的表格边框 而没有里面的数据 |
|