C#我也是工作以后临时边学就边用了,期间零零碎碎遇到一些特定的功能需求,记录一下
调用Windows接口生成excel文件
引用“using System.Windows.Controls;”
//新建一个对象save用以表示文件表
SaveFileDialog save = new SaveFileDialog();
//设置文件名,这里使用拼接方式
save.DefaultFileName = "客户明细表_机构号" + DownVO.orgcode + "_" + (cb.SelectedItem as AAA.BBB.Common.SignServiceReference.dictDataVO).name.ToString() + "_数据日期" + DateUtility.ToYearMonthString(DateTime.Now);
//这里cb表示前台界面的菜单按钮,这里通过SelectedItem获取到用户的选项,然后通过dictDataVO字典转化成对应的中文,存在文件的名字当中。DateUtility.ToYearMonthString(DateTime.Now)是获取当前日期的年月日
//设置文件的后缀名和适用格式
save.DefaultExt = "xls";
save.Filter = "EXCEL Files(*.xls)|*.xls|ET Files(*.et)|*.et|All files (*.*)|*.*";
//弹出一个对话框,选择是否保存文件
bool? result = save.ShowDialog();
//如果是,则打开文件
if (result != null && result == true)
{
using (Stream stream = save.OpenFile())//使用stream保存数据流
{
if (downList != null)
{
String DataRowTemplate = Common.Utility.ControlUtility.GenerateDataRowTemplateWithNumber(15, new int[] { 8, 12, 13 });//表示一共有15列数据,其中8,12,13列为数值型数据
StringBuilder sbRowData = new StringBuilder("");
int i = 1;
foreach (tagCustDtlVO item in downList)
{
//用数据按行依次填充数据列模板,这里item可以理解为一个结构体,里面有一行数据的各个属性值
#region
sbRowData.AppendLine(
String.Format(DataRowTemplate.Replace("&", "\""),
ControlUtility.NullToEmpty((i++).ToString()),
ControlUtility.NullToEmpty(item.orgcode), // 归属机构编号
ControlUtility.NullToEmpty(item.orgname), // 归属机构名称
ControlUtility.NullToEmpty(item.custname), // 姓名
ControlUtility.NullToEmpty(item.custcertno), // 证件号
ControlUtility.NullToEmpty(item.mobile), // 电话
ControlUtility.NullToEmpty(ControlUtility.GetDictionaryValue("CustormerType", item.custype).ToString()), // 类别
ControlUtility.NullToEmpty(item.creditrange),//预授信区间
ControlUtility.NullToEmpty(item.creditavg),//预授信均值
ControlUtility.NullToEmpty(item.product_kind),//推荐卡种
ControlUtility.NullToEmpty(item.product_desc),//卡种特色
ControlUtility.NullToEmpty(item.sale_desc),//营销活动
ControlUtility.NullToEmpty(item.idntmon), // 当月识别次数
ControlUtility.NullToEmpty(item.idntyear), // 当年识别次数
ControlUtility.NullToEmpty(item.idntacc) // 累计识别次数
)
);
#endregion
}
StringBuilder sbReport = new StringBuilder(ReportTemplate);//ReportTemplate为模板文件,模板格式见下文
//使用@@符号替换模板文件中的特定字段 sbReport.Replace("@@DataRowTemplate@@", sbRowData.ToString());
sbReport.Replace("@@date@@", DateUtility.ToYearMonthDayString(DateTime.Now));
sbReport.Replace("@@orgCode@@", tagCustDtlDownVO.orgcode);
sbReport.Replace("@@customerType@@", (cbCustType.SelectedItem as AAA.BBB.CCCC.SignServiceReference.dictDataVO).name.ToString());
StreamWriter sw = new StreamWriter(stream, Encoding.UTF8);//使用UTF8编码格式
using (sw)
{
sw.Write(sbReport.ToString().Replace("&&", "\""));//写数据
BizMessageBox.Show("导出成功!");
}
stream.Close();//关闭
sw.Close();
}
}
}
下面是模板文件,赋值粘贴到编辑器里对准格式看会轻松一些
截取一段做例子
例:<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>机构:@@orgCode@@</Data>
</Cell>
</Row>
<Row>。。。</Row>表示excel中的一行。<Cell>。。。</Cell>表示一个单元格。这里语法跟HTML有点像。
例:<Row>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>序号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构名称</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户姓名</Data>
</Cell>
省略巴拉巴拉
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信区间</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信均值</Data>
</Cell>
</Row>
用这种方式定义一行列标题
例:
<Worksheet ss:Name=&&Sheet1&&>
<Table x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&75&& ss:DefaultRowHeight=&&13.5&&>
“内容巴拉巴拉”
</Table>
</Worksheet>
然后上面代码的foreach循环会自动从list中取数据进行一行又一行的数据填充
-----------------------------我是分割线------------------------------
下面是完整的excel模板流
/// <summary>
/// 待替换的模板数据流
/// </summary>
#region ReportTemplate
private String ReportTemplate = @"<?xml version=&&1.0&& encoding=&&UTF-8&& standalone=&&yes&&?>
<Workbook xmlns=&&urn:schemas-microsoft-com:office:spreadsheet&& xmlns:o=&&urn:schemas-microsoft-com:office:office&& xmlns:x=&&urn:schemas-microsoft-com:office:excel&& xmlns:ss=&&urn:schemas-microsoft-com:office:spreadsheet&& xmlns:html=&& http://www.w3.org/TR/REC-html40&& xmlns:dt=&&uuid:C2F41010-65B3-11d1-A29F-00AA00C14882&&>
<DocumentProperties xmlns=&&urn:schemas-microsoft-com:office:office&&>
<Author>Lily</Author>
<LastAuthor>MC SYSTEM</LastAuthor>
<Created>2013-05-22T17:49:25</Created>
</DocumentProperties>
<CustomDocumentProperties xmlns=&&urn:schemas-microsoft-com:office:office&&>
<KSOProductBuildVer dt:dt=&&string&&>2052-9.1.0.4047</KSOProductBuildVer>
</CustomDocumentProperties>
<ExcelWorkbook xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<WindowWidth>20120</WindowWidth>
<WindowHeight>7380</WindowHeight>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID=&&s2&& ss:Name=&&货币&&>
<NumberFormat ss:Format=&&_ "¥"* #,##0.00_ ;_ "¥"* \-#,##0.00_ ;_ "¥"* "-"??_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s1&& ss:Name=&&千位分隔&&>
<NumberFormat ss:Format=&&_ * #,##0.00_ ;_ * \-#,##0.00_ ;_ * "-"??_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&Default&& ss:Name=&&Normal&&>
<Alignment/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID=&&s42&& ss:Name=&&强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&񒿾&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s41&& ss:Name=&&解释性文本&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󅒐&& ss:Italic=&&1&&/>
</Style>
<Style ss:ID=&&s36&& ss:Name=&&标题 2&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&3&& ss:Color=&&#C0C0C0&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&13&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s24&& ss:Name=&&40% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FFCC00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s19&& ss:Name=&&40% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FF8080&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s8&& ss:Name=&&货币[0]&&>
<NumberFormat ss:Format=&&_ "¥"* #,##0_ ;_ "¥"* \-#,##0_ ;_ "¥"* "-"_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s39&& ss:Name=&&计算&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF9900&& ss:Bold=&&1&&/>
<Interior ss:Color=&&#C0C0C0&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s17&& ss:Name=&&20% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FFCC99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s13&& ss:Name=&&强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&񑙗&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s5&& ss:Name=&&百分比&&>
<NumberFormat ss:Format=&&0%&&/>
</Style>
<Style ss:ID=&&s7&& ss:Name=&&标题&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&18&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s43&& ss:Name=&&强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&!CCCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s29&& ss:Name=&&60% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF8080&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s28&& ss:Name=&&标题 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s22&& ss:Name=&&40% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CC99FF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s6&& ss:Name=&&20% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FF99CC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s40&& ss:Name=&&检查单元格&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&& ss:Bold=&&1&&/>
<Interior ss:Color=&󬯠&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s35&& ss:Name=&&标题 1&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&3&& ss:Color=&񑙗&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&15&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s23&& ss:Name=&&40% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&cCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s18&& ss:Name=&&40% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&cCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s15&& ss:Name=&&强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF0000&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s4&& ss:Name=&&千位分隔[0]&&>
<NumberFormat ss:Format=&&_ * #,##0_ ;_ * \-#,##0_ ;_ * "-"_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s26&& ss:Name=&&60% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&BCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s25&& ss:Name=&&标题 3&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&2&& ss:Color=&BCC&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s21&& ss:Name=&&40% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&�FF00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s9&& ss:Name=&&20% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s3&& ss:Name=&&强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&󃕐&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s10&& ss:Name=&&输入&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&񑙗&&/>
<Interior ss:Color=&&#FFCC99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s44&& ss:Name=&&强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF6600&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s30&& ss:Name=&&60% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&�FF00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s20&& ss:Name=&&差&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󃕐&&/>
<Interior ss:Color=&&#FF99CC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s11&& ss:Name=&&20% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s37&& ss:Name=&&好&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ὀ&&/>
<Interior ss:Color=&&#CCFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s33&& ss:Name=&&60% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&!CCCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s32&& ss:Name=&&60% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&󃕐&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s27&& ss:Name=&&警告文本&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF0000&&/>
</Style>
<Style ss:ID=&&s12&& ss:Name=&&20% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CC99FF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s38&& ss:Name=&&汇总&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑙗&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑙗&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s34&& ss:Name=&&60% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF9900&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s16&& ss:Name=&&链接单元格&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&&#FF9900&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF9900&&/>
</Style>
<Style ss:ID=&&s14&& ss:Name=&&20% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCFFFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s31&& ss:Name=&&输出&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&񑘕&& ss:Bold=&&1&&/>
<Interior ss:Color=&&#C0C0C0&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s45&& ss:Name=&&适中&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󲠔&&/>
<Interior ss:Color=&&#FFFF99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s46&& ss:Name=&&注释&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
</Borders>
<Interior ss:Color=&&#FFFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s47&&/>
<Style ss:ID=&&s48&&>
<Alignment ss:Horizontal=&&Center&&/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s49&&>
<Alignment ss:Horizontal=&&Left&&/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&9&& ss:Color=&�&&/>
</Style>
<Style ss:ID=&&s50&&>
<Alignment ss:Horizontal=&&Center&&/>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&10&& ss:Color=&�&&/>
</Style>
<Style ss:ID=&&s51&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
</Borders>
</Style>
<Style ss:ID=&&s52&&>
<Alignment/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s53&&>
<Alignment ss:Horizontal=&&Center&&/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s54&&>
<Alignment ss:Horizontal=&&Left&&/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&9&& ss:Color=&�&&/>
</Style>
</Styles>
<Worksheet ss:Name=&&Sheet1&&>
<Table x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&75&& ss:DefaultRowHeight=&&13.5&&>
<Column ss:Index=&&10&& ss:StyleID=&&Default&& ss:AutoFitWidth=&&0&& ss:Width=&&82.5&&/>
<Row ss:Height=&&20.25&&>
<Cell ss:StyleID=&&s53&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>目标客户明细表(月报)</Data>
</Cell>
<Cell ss:StyleID=&&s52&&/>
<Cell ss:StyleID=&&s52&&/>
<Cell ss:StyleID=&&s52&&/>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>日期:@@date@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>客户类型:@@customerType@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>机构:@@orgCode@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>序号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构名称</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户姓名</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户证件号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>联系电话</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户类型</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信区间</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信均值</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>推荐卡种</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>卡片特色</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>营销活动</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>当月识别次数</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>当年识别次数</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>累计识别次数</Data>
</Cell>
</Row>
@@DataRowTemplate@@
</Table>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<Selected/>
<TopRowVisible>2</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>6</ActiveRow>
<ActiveCol>2</ActiveCol>
<RangeSelection>R7C3</RangeSelection>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name=&&Sheet2&&>
<Table ss:ExpandedColumnCount=&&1&& ss:ExpandedRowCount=&&1&& x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&54&& ss:DefaultRowHeight=&&13.5&&/>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<TopRowVisible>0</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name=&&Sheet3&&>
<Table ss:ExpandedColumnCount=&&1&& ss:ExpandedRowCount=&&1&& x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&54&& ss:DefaultRowHeight=&&13.5&&/>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<TopRowVisible>0</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>";
#endregion
调用Windows接口生成excel文件
引用“using System.Windows.Controls;”
//新建一个对象save用以表示文件表
SaveFileDialog save = new SaveFileDialog();
//设置文件名,这里使用拼接方式
save.DefaultFileName = "客户明细表_机构号" + DownVO.orgcode + "_" + (cb.SelectedItem as AAA.BBB.Common.SignServiceReference.dictDataVO).name.ToString() + "_数据日期" + DateUtility.ToYearMonthString(DateTime.Now);
//这里cb表示前台界面的菜单按钮,这里通过SelectedItem获取到用户的选项,然后通过dictDataVO字典转化成对应的中文,存在文件的名字当中。DateUtility.ToYearMonthString(DateTime.Now)是获取当前日期的年月日
//设置文件的后缀名和适用格式
save.DefaultExt = "xls";
save.Filter = "EXCEL Files(*.xls)|*.xls|ET Files(*.et)|*.et|All files (*.*)|*.*";
//弹出一个对话框,选择是否保存文件
bool? result = save.ShowDialog();
//如果是,则打开文件
if (result != null && result == true)
{
using (Stream stream = save.OpenFile())//使用stream保存数据流
{
if (downList != null)
{
String DataRowTemplate = Common.Utility.ControlUtility.GenerateDataRowTemplateWithNumber(15, new int[] { 8, 12, 13 });//表示一共有15列数据,其中8,12,13列为数值型数据
StringBuilder sbRowData = new StringBuilder("");
int i = 1;
foreach (tagCustDtlVO item in downList)
{
//用数据按行依次填充数据列模板,这里item可以理解为一个结构体,里面有一行数据的各个属性值
#region
sbRowData.AppendLine(
String.Format(DataRowTemplate.Replace("&", "\""),
ControlUtility.NullToEmpty((i++).ToString()),
ControlUtility.NullToEmpty(item.orgcode), // 归属机构编号
ControlUtility.NullToEmpty(item.orgname), // 归属机构名称
ControlUtility.NullToEmpty(item.custname), // 姓名
ControlUtility.NullToEmpty(item.custcertno), // 证件号
ControlUtility.NullToEmpty(item.mobile), // 电话
ControlUtility.NullToEmpty(ControlUtility.GetDictionaryValue("CustormerType", item.custype).ToString()), // 类别
ControlUtility.NullToEmpty(item.creditrange),//预授信区间
ControlUtility.NullToEmpty(item.creditavg),//预授信均值
ControlUtility.NullToEmpty(item.product_kind),//推荐卡种
ControlUtility.NullToEmpty(item.product_desc),//卡种特色
ControlUtility.NullToEmpty(item.sale_desc),//营销活动
ControlUtility.NullToEmpty(item.idntmon), // 当月识别次数
ControlUtility.NullToEmpty(item.idntyear), // 当年识别次数
ControlUtility.NullToEmpty(item.idntacc) // 累计识别次数
)
);
#endregion
}
StringBuilder sbReport = new StringBuilder(ReportTemplate);//ReportTemplate为模板文件,模板格式见下文
//使用@@符号替换模板文件中的特定字段 sbReport.Replace("@@DataRowTemplate@@", sbRowData.ToString());
sbReport.Replace("@@date@@", DateUtility.ToYearMonthDayString(DateTime.Now));
sbReport.Replace("@@orgCode@@", tagCustDtlDownVO.orgcode);
sbReport.Replace("@@customerType@@", (cbCustType.SelectedItem as AAA.BBB.CCCC.SignServiceReference.dictDataVO).name.ToString());
StreamWriter sw = new StreamWriter(stream, Encoding.UTF8);//使用UTF8编码格式
using (sw)
{
sw.Write(sbReport.ToString().Replace("&&", "\""));//写数据
BizMessageBox.Show("导出成功!");
}
stream.Close();//关闭
sw.Close();
}
}
}
下面是模板文件,赋值粘贴到编辑器里对准格式看会轻松一些
截取一段做例子
例:<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>机构:@@orgCode@@</Data>
</Cell>
</Row>
<Row>。。。</Row>表示excel中的一行。<Cell>。。。</Cell>表示一个单元格。这里语法跟HTML有点像。
例:<Row>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>序号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构名称</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户姓名</Data>
</Cell>
省略巴拉巴拉
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信区间</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信均值</Data>
</Cell>
</Row>
用这种方式定义一行列标题
例:
<Worksheet ss:Name=&&Sheet1&&>
<Table x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&75&& ss:DefaultRowHeight=&&13.5&&>
“内容巴拉巴拉”
</Table>
</Worksheet>
然后上面代码的foreach循环会自动从list中取数据进行一行又一行的数据填充
-----------------------------我是分割线------------------------------
下面是完整的excel模板流
/// <summary>
/// 待替换的模板数据流
/// </summary>
#region ReportTemplate
private String ReportTemplate = @"<?xml version=&&1.0&& encoding=&&UTF-8&& standalone=&&yes&&?>
<Workbook xmlns=&&urn:schemas-microsoft-com:office:spreadsheet&& xmlns:o=&&urn:schemas-microsoft-com:office:office&& xmlns:x=&&urn:schemas-microsoft-com:office:excel&& xmlns:ss=&&urn:schemas-microsoft-com:office:spreadsheet&& xmlns:html=&& http://www.w3.org/TR/REC-html40&& xmlns:dt=&&uuid:C2F41010-65B3-11d1-A29F-00AA00C14882&&>
<DocumentProperties xmlns=&&urn:schemas-microsoft-com:office:office&&>
<Author>Lily</Author>
<LastAuthor>MC SYSTEM</LastAuthor>
<Created>2013-05-22T17:49:25</Created>
</DocumentProperties>
<CustomDocumentProperties xmlns=&&urn:schemas-microsoft-com:office:office&&>
<KSOProductBuildVer dt:dt=&&string&&>2052-9.1.0.4047</KSOProductBuildVer>
</CustomDocumentProperties>
<ExcelWorkbook xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<WindowWidth>20120</WindowWidth>
<WindowHeight>7380</WindowHeight>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID=&&s2&& ss:Name=&&货币&&>
<NumberFormat ss:Format=&&_ "¥"* #,##0.00_ ;_ "¥"* \-#,##0.00_ ;_ "¥"* "-"??_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s1&& ss:Name=&&千位分隔&&>
<NumberFormat ss:Format=&&_ * #,##0.00_ ;_ * \-#,##0.00_ ;_ * "-"??_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&Default&& ss:Name=&&Normal&&>
<Alignment/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID=&&s42&& ss:Name=&&强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&񒿾&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s41&& ss:Name=&&解释性文本&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󅒐&& ss:Italic=&&1&&/>
</Style>
<Style ss:ID=&&s36&& ss:Name=&&标题 2&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&3&& ss:Color=&&#C0C0C0&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&13&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s24&& ss:Name=&&40% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FFCC00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s19&& ss:Name=&&40% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FF8080&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s8&& ss:Name=&&货币[0]&&>
<NumberFormat ss:Format=&&_ "¥"* #,##0_ ;_ "¥"* \-#,##0_ ;_ "¥"* "-"_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s39&& ss:Name=&&计算&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF9900&& ss:Bold=&&1&&/>
<Interior ss:Color=&&#C0C0C0&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s17&& ss:Name=&&20% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FFCC99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s13&& ss:Name=&&强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&񑙗&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s5&& ss:Name=&&百分比&&>
<NumberFormat ss:Format=&&0%&&/>
</Style>
<Style ss:ID=&&s7&& ss:Name=&&标题&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&18&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s43&& ss:Name=&&强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&!CCCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s29&& ss:Name=&&60% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF8080&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s28&& ss:Name=&&标题 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s22&& ss:Name=&&40% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CC99FF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s6&& ss:Name=&&20% - 强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#FF99CC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s40&& ss:Name=&&检查单元格&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑘕&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&& ss:Bold=&&1&&/>
<Interior ss:Color=&󬯠&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s35&& ss:Name=&&标题 1&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&3&& ss:Color=&񑙗&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&15&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s23&& ss:Name=&&40% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&cCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s18&& ss:Name=&&40% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&cCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s15&& ss:Name=&&强调文字颜色 2&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF0000&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s4&& ss:Name=&&千位分隔[0]&&>
<NumberFormat ss:Format=&&_ * #,##0_ ;_ * \-#,##0_ ;_ * "-"_ ;_ @_ &&/>
</Style>
<Style ss:ID=&&s26&& ss:Name=&&60% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&BCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s25&& ss:Name=&&标题 3&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&2&& ss:Color=&BCC&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ദ&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s21&& ss:Name=&&40% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&�FF00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s9&& ss:Name=&&20% - 强调文字颜色 1&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCCCFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s3&& ss:Name=&&强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&󃕐&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s10&& ss:Name=&&输入&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&󅒐&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&񑙗&&/>
<Interior ss:Color=&&#FFCC99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s44&& ss:Name=&&强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF6600&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s30&& ss:Name=&&60% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&�FF00&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s20&& ss:Name=&&差&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󃕐&&/>
<Interior ss:Color=&&#FF99CC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s11&& ss:Name=&&20% - 强调文字颜色 3&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s37&& ss:Name=&&好&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&ὀ&&/>
<Interior ss:Color=&&#CCFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s33&& ss:Name=&&60% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&!CCCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s32&& ss:Name=&&60% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&󃕐&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s27&& ss:Name=&&警告文本&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF0000&&/>
</Style>
<Style ss:ID=&&s12&& ss:Name=&&20% - 强调文字颜色 4&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CC99FF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s38&& ss:Name=&&汇总&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&񑙗&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑙗&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s34&& ss:Name=&&60% - 强调文字颜色 6&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FFFFFF&&/>
<Interior ss:Color=&&#FF9900&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s16&& ss:Name=&&链接单元格&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Double&& ss:Weight=&&3&& ss:Color=&&#FF9900&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&&#FF9900&&/>
</Style>
<Style ss:ID=&&s14&& ss:Name=&&20% - 强调文字颜色 5&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&�&&/>
<Interior ss:Color=&&#CCFFFF&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s31&& ss:Name=&&输出&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&񑘕&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&񑘕&& ss:Bold=&&1&&/>
<Interior ss:Color=&&#C0C0C0&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s45&& ss:Name=&&适中&&>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&11&& ss:Color=&󲠔&&/>
<Interior ss:Color=&&#FFFF99&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s46&& ss:Name=&&注释&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&& ss:Color=&&#C0C0C0&&/>
</Borders>
<Interior ss:Color=&&#FFFFCC&& ss:Pattern=&&Solid&&/>
</Style>
<Style ss:ID=&&s47&&/>
<Style ss:ID=&&s48&&>
<Alignment ss:Horizontal=&&Center&&/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s49&&>
<Alignment ss:Horizontal=&&Left&&/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&9&& ss:Color=&�&&/>
</Style>
<Style ss:ID=&&s50&&>
<Alignment ss:Horizontal=&&Center&&/>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
</Borders>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&10&& ss:Color=&�&&/>
</Style>
<Style ss:ID=&&s51&&>
<Borders>
<Border ss:Position=&&Bottom&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Left&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Right&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
<Border ss:Position=&&Top&& ss:LineStyle=&&Continuous&& ss:Weight=&&1&&/>
</Borders>
</Style>
<Style ss:ID=&&s52&&>
<Alignment/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s53&&>
<Alignment ss:Horizontal=&&Center&&/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&16&& ss:Color=&�&& ss:Bold=&&1&&/>
</Style>
<Style ss:ID=&&s54&&>
<Alignment ss:Horizontal=&&Left&&/>
<Borders/>
<Font ss:FontName=&&宋体&& x:CharSet=&&134&& ss:Size=&&9&& ss:Color=&�&&/>
</Style>
</Styles>
<Worksheet ss:Name=&&Sheet1&&>
<Table x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&75&& ss:DefaultRowHeight=&&13.5&&>
<Column ss:Index=&&10&& ss:StyleID=&&Default&& ss:AutoFitWidth=&&0&& ss:Width=&&82.5&&/>
<Row ss:Height=&&20.25&&>
<Cell ss:StyleID=&&s53&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>目标客户明细表(月报)</Data>
</Cell>
<Cell ss:StyleID=&&s52&&/>
<Cell ss:StyleID=&&s52&&/>
<Cell ss:StyleID=&&s52&&/>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>日期:@@date@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>客户类型:@@customerType@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s54&& ss:MergeAcross=&&10&&>
<Data ss:Type=&&String&&>机构:@@orgCode@@</Data>
</Cell>
</Row>
<Row>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>序号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>机构名称</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户姓名</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户证件号</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>联系电话</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>客户类型</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信区间</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>预授信均值</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>推荐卡种</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>卡片特色</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>营销活动</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>当月识别次数</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>当年识别次数</Data>
</Cell>
<Cell ss:StyleID=&&s50&&>
<Data ss:Type=&&String&&>累计识别次数</Data>
</Cell>
</Row>
@@DataRowTemplate@@
</Table>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<Selected/>
<TopRowVisible>2</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>6</ActiveRow>
<ActiveCol>2</ActiveCol>
<RangeSelection>R7C3</RangeSelection>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name=&&Sheet2&&>
<Table ss:ExpandedColumnCount=&&1&& ss:ExpandedRowCount=&&1&& x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&54&& ss:DefaultRowHeight=&&13.5&&/>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<TopRowVisible>0</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name=&&Sheet3&&>
<Table ss:ExpandedColumnCount=&&1&& ss:ExpandedRowCount=&&1&& x:FullColumns=&&1&& x:FullRows=&&1&& ss:DefaultColumnWidth=&&54&& ss:DefaultRowHeight=&&13.5&&/>
<WorksheetOptions xmlns=&&urn:schemas-microsoft-com:office:excel&&>
<PageSetup>
<Header x:Margin=&&0.3&&/>
<Footer x:Margin=&&0.3&&/>
<PageMargins x:Left=&&0.699305555555556&& x:Right=&&0.699305555555556&& x:Top=&&0.75&& x:Bottom=&&0.75&&/>
</PageSetup>
<TopRowVisible>0</TopRowVisible>
<LeftColumnVisible>0</LeftColumnVisible>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>";
#endregion