带有经典 ASP 图表的 Excel 组件

发布于 2024-10-07 14:12:49 字数 150 浏览 0 评论 0原文

我曾经使用一家名为 ActiveXLS 的公司来保存带有经典 ASP 图表的本机 XLS 文件,但他们似乎已经关闭了。

谁能推荐一个我可以使用的替代经典 asp excel 组件?

CSV 或 HTML(具有 XLS 内容类型)导出不足以满足我的需要。

I was using a company called ActiveXLS to save native XLS files with charts from Classic ASP but they seem to have closed down.

Can anyone recommend an alternative classic asp excel component I can use?

CSV or HTML (with XLS content type) export is not sufficient for what I need.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

养猫人 2024-10-14 14:12:49

您可以使用经典 ASP 访问 MS Excel DOM。对于基于网络的环境,这种方法有一定的局限性,但我已经将它用于小批量的情况。

下面是一些示例代码来说明:

Set oApp = Server.CreateObject("Excel.Application")

Set oBook = oApp.Workbooks.Add
Set oSheet = oBook.ActiveSheet
Set oRange = oApp.ActiveCell

' Create the header fields
oRange.Cells(1,1) = "Column 1"
oRange.Cells(1,2) = "Column 2"

oSheet.Range(oSheet.Cells(1,1), oSheet.Cells(i,j)).Select
oApp.Selection.Columns.AutoFit
oSheet.Cells(1,1).Select

oBook.SaveAs "filename.xls"
oBook.Close
oApp.Quit

Set oApp = Nothing

这确实需要在构建这些文件的服务器上安装 Excel。

You can access the MS Excel DOM using Classic ASP. There are definite limitations of this approach for a web based environment but I have used it for low volumes.

Here's some sample code to illustrate:

Set oApp = Server.CreateObject("Excel.Application")

Set oBook = oApp.Workbooks.Add
Set oSheet = oBook.ActiveSheet
Set oRange = oApp.ActiveCell

' Create the header fields
oRange.Cells(1,1) = "Column 1"
oRange.Cells(1,2) = "Column 2"

oSheet.Range(oSheet.Cells(1,1), oSheet.Cells(i,j)).Select
oApp.Selection.Columns.AutoFit
oSheet.Cells(1,1).Select

oBook.SaveAs "filename.xls"
oBook.Close
oApp.Quit

Set oApp = Nothing

This does require Excel to be installed on the server that builds these files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文