Tag: primefaces

PrimeFaces DataExporter大数据

我有65000的数据从DB到excel.But PF DataExporter组件不写入大数据到excel.What我可以使用这个过程吗?有一个这个过程的库?

JSF – 使用Apache POI中的HSSFFont,为JSF中的Excel表单设置全局字体types

我有一个选项将数据表导出到Excel工作表。 我试着设置字体types为“Calibri”表中的所有单元格。 但是,下面的代码是只分配标题的字体types,而不是为其余的单元格 我怎么能够为表单中的所有单元格全局设置字体types? public void exportToXLS(Object document) { HSSFWorkbook wb = (HSSFWorkbook) document; HSSFSheet sheet = wb.getSheetAt(0); wb.setSheetName(0, "report_lists"); // set sheet name sheet.shiftRows(0, sheet.getLastRowNum(), 4); // shifting the rows to HSSFRow header = sheet.getRow(4); header.getCell(1).setCellValue("Test Group"); header.getCell(2).setCellValue("Category"); HSSFRow firstrow = sheet.getRow(0); firstrow.createCell(0).setCellValue("Actuals"); SimpleDateFormat sdf = new SimpleDateFormat( "EEE MMM d HH:mm:ss 'CDT' yyyy […]

导出为CSV JSF和PrimeFaces

导出到Excel JSF和PrimeFaces 我正在尝试下载在运行时创build的CSV文件。 这个链接是有用的Excel和我需要做同样的CSV。 HSSFWorkbook用于Excel中,但我使用FileWriter的CSV。 我需要一行来使用,而不是workbook.write(externalContext.getResponseOutputStream()); 我不能使用writer.write(externalContext.getResponseOutputStream()); FileWriter是FileWritervariables,不接受outputStream作为参数。

Primefaces – dynamic确认对话框内容

我有一个上传Excel电子表格的JSF页面。 该电子表格具有一定数量的行的工作簿。 在处理每一行之前,我想统计一切,并询问用户“确认X行的处理? 这是我的JSF代码(cancel.xhtml): <h:form enctype="multipart/form-data" id="frmMassive"> <p:growl id="messagesUpload" showDetail="true" life="3000" /> <h:panelGrid id="panel" columns="2"> <h:outputText value="File" /> <p:fileUpload value="#{cancelView.file}" mode="simple" skinSimple="true" /> <p:spacer></p:spacer> <p:commandButton value="Send file" ajax="false" action="#{cancelView.preProcessMassive}" /> </h:panelGrid> </p:panel> </h:form> <h:form id="frmConfirm"> <p:commandButton style="display: none" id="confirmButton" actionListener="#{cancelView.postProcessMassive}"> <p:confirm header="Confirmation" message="Confirm the processing of #{cancelView.lineCount} line(s)?" icon="ui-icon-alert" /> </p:commandButton> <p:confirmDialog global="true" showEffect="fade" hideEffect="fade"> […]

在从primefaces数据表输出的excel文件中不显示标题

我得到的primefaces数据与使用的filter。 每一个工作正常。 但是当我导出数据表excel文件的标题不显示。 这里我使用外部的remoteCommand来处理服务器端的事件。 这里是xhtml代码: <h:form> <p:commandButton value="#{dictionary['export_to_excel']}" icon="ui-icon-calculator" ajax="false"> <p:dataExporter type="xls" target=":gwsReportAllPartForm:gwsReportAllPartListDataTable" fileName="analytics"/> </p:commandButton> </h:form> <h:form id="gwsReportAllPartForm"> <p:remoteCommand name="updateFilters" update=":gwsReportAllPartForm:gwsReportAllPartListDataTable"></p:remoteCommand> <p:dataTable id="gwsReportAllPartListDataTable" value="#{viewAllAnalyticsBean.gwsReportPartTwoList}" var="report" paginator="true" rows="100" paginatorTemplate="{PageLinks} {CurrentPageReport}" currentPageReportTemplate="{currentPage} #{dictionary['out_of']} {totalPages}" emptyMessage="#{dictionary['nothing_is_here']}" scrollable="true" scrollWidth="1050" scrollHeight="500"> <p:ajax event="filter" listener="#{viewAllAnalyticsBean.onFilterDataTable}" oncomplete="updateFilters()"/> <p:column headerText="#{dictionary['reporting_period']}" styleClass="columnCustomClass" style="width: 90px;position:relative; padding-bottom: 30px;"> <h:outputText value="#{report.gwsReportPartOne.year}, #{report.gwsReportPartOne.quarter}"/> </p:column> <p:column headerText="#{dictionary['subsoil_user_contract_register_number']}" styleClass="columnCustomClass" style="width: […]

Primefaces数据导出器在Excel中导出空值

我有一个页面,我加载一些数据到一个数据表,并提供一个button导出到XLS。 我用Primefaces在其网页和XLS文件下载相同的示例代码,但是当我打开它,我发现它尽pipedatable包含值为空。 我正在使用Primefaces 4.0,这是我的XHTML页面 <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j" xmlns:p="http://primefaces.org/ui" template="/WEB-INF/templates/default.xhtml"> <ui:define name="content"> <h:head> </h:head> <body style="background-image: url('#{request.contextPath}/resources/gfx/Whitewallpaper.jpg')"> <h:form id="form"> <p:tabView id="tabview" orientation="left" style="width : 1200px; " > <p:tab title="Visualiser "> <p:panel header=" " > <h:commandLink > <p:commandButton value="exporter" /> <p:dataExporter type="xls" target="crs" fileName="prixde" pageOnly="true" /> </h:commandLink> <p:dataTable id="crs" var="car" value="#{marchebean.selectedmarche.marchetraveau}" > <f:facet […]

自定义导出p:从.xls到.pdf的dataTable数据

我来自马其顿,在我的国家我们使用西里尔字体。 我正在NetBeans IDE中开发一个Web应用程序,并使用PrimeFaces 5.2框架。 为了导出,我使用poi-3.9.jar和itext-2.7.1.jar 。 我创build了一个表格<p:dataTable> ,用一些西里尔文本列(像名字,姓氏等列)来填充。 在我的应用程序中,我喜欢使用导出到PDF并导出到Excel,因此客户端可以从表中导出数据作为报告或其他内容。 导出到Excel的效果很好。 我可以看到所有的数据(包括西里尔语文本),并可以在postProcessor中修改它。 在后处理程序中,我使用蓝色背景创build表格的标题,为每个单元格添加边框,如果行数更多,则行更大,自动调整所有列等。 来自xhtml的代码: <p:dataTable var="u" value="#{WebClient.allRemoteParkingUsers}" id="uncheckedParkingRequests" rowKey="#{u.ID}" editable="true" tableStyle="table-layout: auto;" emptyMessage="Не постои ниеден паркинг клиент според податоците по кои пребарувате." filteredValue="#{WebClient.filtered_users}" widgetVar="client_table" paginator="true" rows ="20" rowsPerPageTemplate="20,50,100" paginatorAlwaysVisible="true" paginatorPosition="bottom" paginatorTemplate="{PreviousPageLink} {CurrentPageReport} {NextPageLink} {RowsPerPageDropdown} {Exporters}"> <f:facet name="header" id="naslovTabela"> <p:outputLabel value="Листа на паркинг клиенти"/> <p:outputPanel style="text-align: right; […]

如何覆盖PrimeFaces p:dataExporter错误地将数字导出为Excel中的文本?

PrimeFace p:dataExporter标签默认情况下将数字数据导出为文本,导致在左上angular有一个绿色三angular形的单元格。 在PrimeFaces展示示例中也可以看到,如果您单击cars表下的Excel导出。 我怎样才能覆盖这个默认值,以确保我的数字列不导出为文本? 我试图使用postProcessor属性指向我的方法,它使用POI API设置所有数据单元格的Excel格式,但没有生效(没有改变任何东西): public void formatExcel(Object doc) { HSSFWorkbook book = (HSSFWorkbook)doc; HSSFSheet sheet = book.getSheetAt(0); HSSFRow header = sheet.getRow(0); int colCount = header.getPhysicalNumberOfCells(); int rowCount = sheet.getPhysicalNumberOfRows(); HSSFCellStyle numStyle = book.createCellStyle(); numStyle.setDataFormat((short)1); for(int rowInd = 1; rowInd < rowCount; rowInd++) { HSSFRow row = sheet.getRow(rowInd); for(int cellInd = 1; cellInd < […]