简体   繁体   English

(XPages/Javascript)点击按钮导出excel

[英](XPages/Javascript)Click the button to export excel

I already asked this question, like this: Onclick the button to export excel in XPages我已经问过这个问题了,像这样: Onclick the button to export excel in XPages

But this tip just exports the view's value.但是这个提示只是导出视图的值。

I want to set more values in the excel, and the page just shows a part of the info into the view.我想在excel中设置更多的值,页面只是在视图中显示了一部分信息。

The view just like this:视图就像这样:

在此处输入图片说明

And the excel just like this: excel就像这样:

在此处输入图片说明

How to achieve this kind of excel export?如何实现这种excel导出?

So you want to use the whole view, not just the visible parts.所以你想使用整个视图,而不仅仅是可见部分。 Whole, both for columns and rows.整体,包括列和行。 Your best course of action is to head over to OpenNTF.org and look for the project Poi4Xpages .您最好的做法是前往OpenNTF.org并寻找Poi4Xpages项目。 It allows you to generate real xls(x) files including formula and formatting.它允许您生成真实的 xls(x) 文件,包括公式和格式。 There you can loop through a view as you wish.在那里,您可以根据需要循环查看视图。

The samples and documentation should get you started.示例和文档应该可以帮助您入门。

See: https://my.webgate.biz/poi/documentation.nsf/viewdoc.xsp?docid=ConfigureExcelExport请参阅: https : //my.webgate.biz/poi/documentation.nsf/viewdoc.xsp?docid=ConfigureExcelExport

We use this in a similar fashion.我们以类似的方式使用它。 You can use styles (CSS) to display or hide cells.您可以使用样式 (CSS) 来显示或隐藏单元格。 You have to add the style information on the page itself, not in a separate file, otherwise Excel won't use them.您必须在页面本身上添加样式信息,而不是在单独的文件中,否则 Excel 将不会使用它们。

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

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