将Excel工作表嵌入表格 [英] Embed Excel Sheet into form
问题描述
好的,我需要将Excel模板文档嵌入到winform中(保留所有格式),更改一些值,打印预览,然后将其打印为PDF或打印机。我需要在不花老板任何现金的情况下做到这一点。
OK, I need to embed an Excel template document into a winform (retaining all the formatting), change some values, printpreview it, then print it to either PDF or a printer. And I need to do it without spending any of the boss's cash.
我尝试嵌入标准Excel COM内容,但IDE(C#Express 2010)不喜欢并崩溃了(Office控件似乎执行的不多,仅偶尔访问Web浏览器中的XLS)
I tried embedding the standard Excel COM stuff, but the IDE (C# Express 2010) didn't like it and crashed (the Office control didn't seem to do much and accessing an XLS in a webbrowser only worked occasionally)
所以我猜我在找
实际上,从理论上讲,它可以是任何网格类型的格式,只要我可以对Excel进行类似的格式化并使它看起来像
In fact theoretically it could be any grid-type format as long as I can do similar formatting to Excel and make it look all pretty for the client.
有什么想法吗?
干杯
推荐答案
您可以使用DSOFramer控件获得所需的功能。这是微软很久以前提供的一个小控件,此控件已从其站点退役。不过,它仍然运作良好。您可以从此处下载控件:
You could get the functionality you want with the DSOFramer control. This was a small control that Microsoft provided long, long time ago, and has since decomissioned from their site. It still works perfectly well, though. You can download the control from here:
这篇关于将Excel工作表嵌入表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!