【问题标题】:Insert chart at specific location in ms word using c# with xceed namespace使用带有 xceed 命名空间的 c# 在 ms word 中的特定位置插入图表
【发布时间】:2021-12-11 19:50:13
【问题描述】:

我已经使用 xceed.words.net 命名空间在 c#.net 中创建了 PieChart,我正在尝试将该图表插入到 ms Word 中。 但该图表插入该文档的最后一页。 但我需要将该图表插入该文档中的特定位置。 例如:我的文档有 8 页我需要在中间的 3 页插入该聊天。但该图表插入到最后一页,即第 8 页。

Var p= new PieChart() ;
Int32 a=0,b=0;
Var c=new list<chartdata>() 
{
New chartdata() {cycle="USA",initial=a},
New chartdata() {cycle="canada",initial=b}
}
Var s1=new series("country") ;
s1. Bind(c, "cycle", " Initial") ;
p. Addseries(s1) ;
Var para= doc. InsertParagraph("chart") ;                            
doc. InsertChartAfterParagraph(p, para, 300,500) ;     

This is what I have written.. But that chart is inserting at end of 
the document .. But I need that at specific location


Did anybody knows about this please help me.. 
Thank you

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: c# ms-word pie-chart xceed


【解决方案1】:

我认为它还不支持。 可以参考github issuehttps://github.com/xceedsoftware/DocX/issues/156

您可以尝试在特定位置创建段落并尝试将图表附加到它。

【讨论】:

  • Var para= doc.插入段落(“图表”);博士。 InsertChartAfterParagraph(p, para, 300,500) ;我已经使用了这段代码,但那段也只插入到最后一页
猜你喜欢
  • 2013-09-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多