日日噜噜夜夜狠狠久久无码区_法国《性迷宫》在线观看_国产精品亚洲一区二区三区在线_yellow视频在线免费观看_国产欧美日韩精品a在线看_超碰97中文

物流問答

現(xiàn)在想學(xué)習(xí)一些怎樣在excel經(jīng)過API(或其它方法)能夠主動(dòng)顯現(xiàn)快遞狀況,比方已簽收,在途中…

2023/3/28 14:34:27 來源:貨代軟件公司
內(nèi)容摘要:給你一個(gè)參閱 在這個(gè)類中,有兩個(gè)參數(shù)傳進(jìn)來,一個(gè)是它的數(shù)據(jù)源,另一個(gè)是整個(gè)報(bào)表的標(biāo)題字符串,詳細(xì)看代碼就應(yīng)該知道了。 using System; using ***.Data; using Excel; namespace LogicLayer { /// /// OutputExcel 的摘要闡明 /// public class OutputExcel { public OutputExcel(DataView dv,string str) { // // TO...
給你一個(gè)參閱
在這個(gè)類中,有兩個(gè)參數(shù)傳進(jìn)來,一個(gè)是它的數(shù)據(jù)源,另一個(gè)是整個(gè)報(bào)表的標(biāo)題字符串,詳細(xì)看代碼就應(yīng)該知道了。

using System;
using ***.Data;
using Excel;

namespace LogicLayer
{
///
/// OutputExcel 的摘要闡明
///
public class OutputExcel
{
public OutputExcel(DataView dv,string str)
{
//
// TODO: 在此處增加結(jié)構(gòu)函數(shù)邏輯
//
Excel.Application excel;
int rowIndex=4;
int colIndex=1;

Excel._Workbook xBk;
Excel._Worksheet xSt;

excel= new Excel.ApplicationClass();;
xBk = excel.Workbooks.Add(true);
xSt = (Excel._Worksheet)xBk.ActiveSheet;

//
//獲得標(biāo)題
//
foreach(DataColumn col in dv.Table.Columns)
{
colIndex++;
excel.Cells4,colIndex = col.ColumnName;
xSt.get_Range(excel.Cells4,colIndex,excel.Cells4,colIndex).HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter;//設(shè)置標(biāo)題格局為居中對(duì)齊
}

//
//獲得表格中的數(shù)據(jù)
//
foreach(DataRowView row in dv)
{
rowIndex ++;
colIndex = 1;
foreach(DataColumn col in dv.Table.Columns)
{
colIndex ++;
if(col.DataType == System.Type.GetType(“System.DateTime”))
{
excel.CellsrowIndex,colIndex = (Convert.ToDateTime(rowcol.ColumnName.ToString())).ToString(“yyyy-MM-dd”);
xSt.get_Range(excel.CellsrowIndex,colIndex,excel.CellsrowIndex,colIndex).HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter;//設(shè)置日期型的字段格局為居中對(duì)齊
}
else
if(col.DataType == System.Type.GetType(“System.String”))
{
excel.CellsrowIndex,colIndex = “”+rowcol.ColumnName.ToString();
xSt.get_Range(excel.CellsrowIndex,colIndex,excel.CellsrowIndex,colIndex).HorizontalAlignment = Excel.XlVAlign.xlVAlignCenter;//設(shè)置字符型的字段格局為居中對(duì)齊
}
else
{
excel.CellsrowIndex,colIndex = rowcol.ColumnName.ToString();
}
}
}
//
//加載一個(gè)算計(jì)行
//
int rowSum = rowIndex + 1;
int colSum = 2;
excel.CellsrowSum,2 = “算計(jì)”;
xSt.get_Range(excel.CellsrowSum,2,excel.CellsrowSum,2).HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter;
//
//設(shè)置選中的部分的色彩
//
xSt.get_Range(excel.CellsrowSum,colSum,excel.CellsrowSum,colIndex).Select();
xSt.get_Range(excel.CellsrowSum,colSum,excel.CellsrowSum,colIndex).Interior.ColorIndex = 19;//設(shè)置為淺黃色,合計(jì)有56種
//
//獲得整個(gè)報(bào)表的標(biāo)題
//
excel.Cells2,2 = str;
//
//設(shè)置整個(gè)報(bào)表的標(biāo)題格局
//
xSt.get_Range(excel.Cells2,2,excel.Cells2,2).Font.Bold = true;
xSt.get_Range(excel.Cells2,2,excel.Cells2,2).Font.Size = 22;
//
//設(shè)置報(bào)表表格為最習(xí)慣寬度
//
xSt.get_Range(excel.Cells4,2,excel.CellsrowSum,colIndex).Select();
xSt.get_Range(excel.Cells4,2,excel.CellsrowSum,colIndex).Columns.AutoFit();
//
//設(shè)置整個(gè)報(bào)表的標(biāo)題為跨列居中
//
xSt.get_Range(excel.Cells2,2,excel.Cells2,colIndex).Select();
xSt.get_Range(excel.Cells2,2,excel.Cells2,colIndex).HorizontalAlignment = Excel.XlHAlign.xlHAlignCenterAcrossSelection;
//
//制作邊框
//
xSt.get_Range(excel.Cells4,2,excel.CellsrowSum,colIndex).Borders.LineStyle = 1;
xSt.get_Range(excel.Cells4,2,excel.CellsrowSum,2).BordersExcel.XlBordersIndex.xlEdgeLeft.Weight = Excel.XlBorderWeight.xlThick;//設(shè)置左邊線加粗
xSt.get_Range(excel.Cells4,2,excel.Cells4,colIndex).BordersExcel.XlBordersIndex.xlEdgeTop.Weight = Excel.XlBorderWeight.xlThick;//設(shè)置上邊線加粗
xSt.get_Range(excel.Cells4,colIndex,excel.CellsrowSum,colIndex).BordersExcel.XlBordersIndex.xlEdgeRight.Weight = Excel.XlBorderWeight.xlThick;//設(shè)置右邊線加粗
xSt.get_Range(excel.CellsrowSum,2,excel.CellsrowSum,colIndex).BordersExcel.XlBordersIndex.xlEdgeBottom.Weight = Excel.XlBorderWeight.xlThick;//設(shè)置下邊線加粗
//
//顯現(xiàn)作用
//
excel.Visible=true;
}
}
}

http://www.guestlion.cn/wuliuwenda/63833.html 現(xiàn)在想學(xué)習(xí)一些怎樣在excel經(jīng)過API(或其它方法)能夠主動(dòng)顯現(xiàn)快遞狀況,比方已簽收,在途中…

免責(zé)聲明:本文章部分圖片素材和內(nèi)容素材來源于網(wǎng)絡(luò),僅供學(xué)習(xí)與參考,不代表本站立場(chǎng),如果損害了您的權(quán)利,請(qǐng)聯(lián)系網(wǎng)站客服,我們核實(shí)后會(huì)立即刪除。

標(biāo)簽:

快遞
在線咨詢
QQ咨詢
微信咨詢
微信咨詢
電話咨詢
周一至周五 9:00-18:00
135-1055-3738
回頂部 主站蜘蛛池模板: 株洲县| 岳阳市| 永登县| 云阳县| 阿合奇县| 乌苏市| 嘉义市| 延寿县| 平泉县| 赤城县| 海丰县| 黄陵县| 东丰县| 永和县| 临潭县| 那曲县| 吉安县| 松阳县| 区。| 马边| 乌兰察布市| 横峰县| 赣榆县| 舟曲县| 汉源县| 海南省| 枣阳市| 福安市| 绥滨县| 白城市| 乌鲁木齐县| 清丰县| 高平市| 西林县| 监利县| 论坛| 武定县| 金山区| 涿鹿县| 信阳市| 呼和浩特市|