没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
#region 导出
protected void Button2_Click(object sender, EventArgs e)
{
jiazaifenye(pagesize, curpage, v);
if (dt != null)
{
#region 操作excel
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
xlWorkBook = new Microsoft.Office.Interop.Excel.Application().Workbooks.Add(Type.Missing);
xlWorkBook.Application.Visible = false;
xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Sheets[1];
//设置标题
xlWorkSheet.Cells[1, 1] = "作者";
xlWorkSheet.Cells[1, 2] = "作品";
xlWorkSheet.Cells[1, 3] = "提交时间";
xlWorkSheet.Cells[1, 4] = "投票数";
xlWorkSheet.Cells[1, 5] = "作品链接";
//设置宽度
((Microsoft.Office.Interop.Excel.Range)xlWorkSheet.Cells[1, 2]).ColumnWidth = 15;
//设置字体
xlWorkSheet.Cells.Font.Size = 12;
#region 为excel赋值
for (int i = 0; i < dt.Rows.Count; i++)
{
string dizhi = "";
if (dt.Rows[i]["types"].ToString() == "视频") { dizhi = dt.Rows[i]["contens"].ToString(); }
protected void Button2_Click(object sender, EventArgs e)
{
jiazaifenye(pagesize, curpage, v);
if (dt != null)
{
#region 操作excel
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
xlWorkBook = new Microsoft.Office.Interop.Excel.Application().Workbooks.Add(Type.Missing);
xlWorkBook.Application.Visible = false;
xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Sheets[1];
//设置标题
xlWorkSheet.Cells[1, 1] = "作者";
xlWorkSheet.Cells[1, 2] = "作品";
xlWorkSheet.Cells[1, 3] = "提交时间";
xlWorkSheet.Cells[1, 4] = "投票数";
xlWorkSheet.Cells[1, 5] = "作品链接";
//设置宽度
((Microsoft.Office.Interop.Excel.Range)xlWorkSheet.Cells[1, 2]).ColumnWidth = 15;
//设置字体
xlWorkSheet.Cells.Font.Size = 12;
#region 为excel赋值
for (int i = 0; i < dt.Rows.Count; i++)
{
string dizhi = "";
if (dt.Rows[i]["types"].ToString() == "视频") { dizhi = dt.Rows[i]["contens"].ToString(); }
hb314220380
- 粉丝: 0
- 资源: 5
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
- 4
- 5
- 6
前往页