简体   繁体   English

如何从Excel模板生成Excel图表?

[英]How to generate Excel chart from Excel template?

  1. I have data in 10 columns in Excel sheet 我在Excel工作表中有10列数据

  2. I created an Excel template with 2 columns (salary, average) and a graph generated by those 2 columns 我创建了一个包含2列(薪水,平均值)的Excel模板和由这2列生成的图表

  3. I need to take that Excel template as input and the out put should be 我需要将Excel模板作为输入,输出应该是

An Excel sheet with 2 columns of DATA and a CHART or GRAPH generated by that data. 带有2列DATA的Excel工作表以及由该数据生成的CHART或GRAPH。

You may create a template excel sheet and save it as as xml (save as => choose excel 2003 xml format). 您可以创建模板Excel工作表并将其另存为xml(另存为=>选择excel 2003 xml格式)。 Now you just have to replace your template values with placeholders which can easily be replaced using string replacements. 现在您只需要使用占位符替换模板值,这些占位符可以使用字符串替换轻松替换。

We just created an excel import/export this way. 我们刚才用这种方式创建了一个excel导入/导出。 Be careful though, excel does not read all xml files, even if they are valid xml. 但要小心,excel不读取所有xml文件,即使它们是有效的xml。 When writing relay on string operations instead of linq to xml or xml writers and stick exactly to the format excel creates when saving. 在字符串操作上写继电器而不是linq到xml或xml编写器时,并完全坚持excel在保存时创建的格式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM