没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|使用教程|编辑:张莹心|2021-10-27 09:38:01.767|阅读 249 次
概述:自 VintaSoft Imaging .NET SDK 10.1 版以来,可以以编程方式编辑现有的 DOCX 和 XLSX 文档。本文使用此功能创建一个简单且易于定制的 XLSX 文档格式的价目表生成器。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
VintaSoftImaging.NET SDK是一个为.NET开发人员开发的,强大而易于使用的图像工具包。它可以让你加载、查看、处理、打印和保存数字图像,可将它们转换为不同的图像格式,可用多种TIFF和动态GIF文件提高您的工作效率。
通常,价目表是包含商品或服务信息(描述、照片、数量、价格)的表格。对于此类表的表示非常适合 XLSX 格式。
自 VintaSoft Imaging .NET SDK 10.1 版以来,可以以编程方式编辑现有的 DOCX 和 XLSX 文档。可以使用此功能创建一个简单且易于定制的 XLSX 文档格式的价目表生成器。
执行以下步骤以创建 XLSX 文档格式:
价目表生成器:
// 使用此代码的项目必须引用以下程序集:
// - Vintasoft.Imaging
// - Vintasoft.Imaging.Office.OpenXml
/// <summary>
/// 生成基于 XLSX 文档模板的 XLSX 价目表。
/// </summary>
public static void GenerateXlsxPricelist()
{
//创建XLSX文档编辑器和使用文件“Pricelist_template.xlsx”作为文档模板
使用(Vintasoft.Imaging.Office.OpenXml.Editor。XlsxDocumentEditor编辑器=
新Vintasoft.Imaging.Office.OpenXml.Editor。XlsxDocumentEditor(“Pricelist_template.xlsx” ))
{
// 生成测试价目表数据
PriceListItem[] testData = GetTestData();
// 填写价目表数据
FillPricelistData(editor, testData);
// 将价格表保存到 XLSX 文档
editor.Save( " Pricelist.xlsx " );
}
}
/// <summary>
/// 使用 XLSX 文档编辑器填充价目表数据。
/// </summary>
/// <param name="documentEditor">DOCX 文档编辑器。</param>
/// <param name="pricelistData">价目表数据。</param>
private static void FillPricelistData (
Vintasoft.Imaging.Office.OpenXml.Editor。XlsxDocumentEditor文档编辑器,
PriceListItem[] pricelistData)
{
// 在文档中设置当前日期
documentEditor.Body[ "[date]" ] = System. 日期时间.Now.ToShortDateString();
// 获取文档
Vintasoft.Imaging.Office.OpenXml.Editor 中的第一张工作表。XlsxDocumentSheet sheet = documentEditor.Sheets[0];
// 获取文档
Vintasoft.Imaging.Office.OpenXml.Editor 中的模板行。XlsxDocumentSheetRow templateRow = sheet.FindRow( "[n]" );
int itemNumber = 1;
// 对于价目表中的每一项
foreach (PriceListItem item in pricelistData )
{
// 复制模板行并在模板行后插入副本
Vintasoft.Imaging.Office.OpenXml.Editor. XlsxDocumentSheetRow currentRow = templateRow;
templateRow =(Vintasoft.Imaging.Office.OpenXml.Editor。XlsxDocumentSheetRow)templateRow.InsertCopyAfterSelf();
// 填充当前行的数据
currentRow.FindCell( "[n]" ).Number = itemNumber;
currentRow.FindCell( "[产品]" ).Text = item.Product;
currentRow.FindCell( "[价格]" ).Number = item.Price;
// 获取当前行中存储产品图片的图片对象
Vintasoft.Imaging.Office.OpenXml.Editor. OpenXmlDocumentImage image = sheet.FindImages(currentRow)[0];
// 如果产品有图片
if (! string .IsNullOrEmpty(item.ImageId))
{
在图像对象//集产品图像
使用(Vintasoft.Imaging。VintasoftImage productImage =新Vintasoft.Imaging。VintasoftImage(item.ImageId))
image.SetImage(productImage, true );
}
别的
{
// 从当前行移除图像对象
图像.移除();
}
项目编号++;
}
// 从结果文档中删除模板行
templateRow.Remove();
}
/// <summary>
/// 返回价目表测试数据。
/// </summary>
/// <returns>价格表测试数据。</returns>
public static PriceListItem[] GetTestData()
{
return new PriceListItem[] {
new PriceListItem( "VintaSoft Imaging .NET SDK, Developer license for Desktop PCs" , "vsimaging-icon.png" , 219.95f),
new PriceListItem( "VintaSoft Imaging .NET SDK, Developer license for Servers" , "vsimaging-icon.png" , 549.95f),
new PriceListItem( "VintaSoft Imaging .NET SDK, Site license for Desktop PCs" , "vsimaging-icon.png" , 659.95f),
new PriceListItem( "VintaSoft Imaging .NET" SDK,服务器站点许可”,“vsaging-icon.PNG", 1649.95f),
new PriceListItem( "VintaSoft Imaging .NET SDK, Single Server license" , "vsimaging-icon.png" , 164.95f),
new PriceListItem( "VintaSoft Annotation .NET Plug-in, Site license for Desktop PCs" , "vsannotation-icon.png" , 449.95f),
new PriceListItem( "VintaSoft Office .NET Plug-in, Site license for Desktop PCs" , "vsoffice-icon.png" , 569.95f),
new PriceListItem( "VintaSoft PDF .NET Plug-in (Reader+Writer), 台式电脑站点许可" , "vspdf-icon.png" ,
1499.95f),新PriceListItem( "VintaSoft PDF .NET Plug-in (Reader+Writer+VisualEditor), Site license for Desktop PCs" , "vspdf-icon.png" ,2999.95f),
new PriceListItem( "VintaSoft JBIG2 .NET Plug-in, Site台式电脑许可证” , “vsjbig2-icon.png” ,1139.95f),
new PriceListItem( “VintaSoft JPEG2000 .NET 插件, 台式电脑站点许可证” , “vsjpeg2000-icon.png” , 689.95f),
new PriceListItem( "VintaSoft Document Cleaup .NET Plug-in, Site license for Desktop PCs" , "vsdoccleanup-icon.png" , 569.95f),
新的价目表项目("VintaSoft OCR .NET 插件,台式电脑的站点许可证","vsocr-icon.png",509.95f),
新的PriceListItem( "VintaSoft DICOM .NET 插件(编解码器+MPR),台式机的站点许可证) " , "vsdicom-icon.png" , 1199.95f),
new PriceListItem( "VintaSoft Forms Processing .NET Plug-in, Site license for Desktop PCs" , "vsformsprocessing-icon.png" , 509.95f),
new PriceListItem( " VintaSoft Barcode .NET SDK (1D+2D Reader+Writer), 台式电脑站点许可" , "vsbarcode-icon.png" , 1379.95f),
新的价目表项目("VintaSoft Twain .NET SDK, Developer license" , "vstwain-icon.png" , 179.95f),
new PriceListItem( "VintaSoft Twain .NET SDK, Site license" , "vstwain-icon.png" , 539.95f),
new PriceListItem( "VintaSoft Twain .NET SDK, Single URL license" , "vstwain-icon.png" , 149.95f),
new PriceListItem( "VintaSoft Twain ActiveX, Developer license" , "vstwain-icon.png" , 99.95f),
new PriceListItem( "VintaSoft Twain ActiveX, 站点许可证" , "vstwain-icon.png" , 299.95f),
new PriceListItem( "VintaSoft Twain ActiveX, Single URL license" , "vstwain-icon.png" , 119.95f)
};
}
/// <summary>
/// 代表一个价目表项目。
/// </summary>
公共 类PriceListItem
{
/// <summary>
/// 初始化 <see cref="PriceListItem"/> 类的新实例。
/// </summary>
/// <param name="product">产品名称。</param>
/// <param name="imageId">图像ID。</param>
/// <param name="price">产品价格。</param>
public PriceListItem( string product, string imageId, float price)
{
产品 = 产品;
ImageId = imageId;
价格 = 价格;
}
/// <summary>
/// 获取产品名称。
/// </summary>
公共 字符串产品;
/// <summary>
/// 获取图像 ID。
/// </summary>
公共 字符串ImageId;
/// <summary>
/// 获取产品价格。
/// </summary>
公开 浮动价格;
}
购买最新正版授权!""
慧都年终盛典火爆开启,一年仅一次的最强促销,十八周年盛“惠”不容错过!!优惠详情点击查看>>
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@ke049m.cn




在使用Parasoft C/C++test执行BugDetective数据流分析时,可能会遇到用户自定义的资源API,那在这种情况下,若要判断是否存在资源问题,如资源泄露等,则需要手动配置测试配置。
大型SaaS系统的自动化测试常常受制于界面变化快、结构复杂、加载机制多变等因素。从元素识别到脚本管理,SmartBear TestComplete帮助Salesforce建了可靠的自动化测试体系。
BarTender 标签管理系统,正是帮助企业轻松实现 GS1 标准化标签设计、编码生成与信息联动的强大工具。
Parasoft C/C++test 是一款功能强大的 C/C++ 软件测试工具,集成了静态代码分析、单元测试、集成测试和覆盖率分析等功能,单元测试作为其关键功能之一,为了适配多样化的目标部署环境,C/C++test 设计了灵活的测试结果收集机制。通过Socket通讯方式来收集单元测试结果,从而扩展其测试覆盖范围与应用场景。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@ke049m.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
半岛外围网上直营