Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有一种方法可以从adf表中导出excel,其中excel的某些列将是只读的?_Excel_Oracle Adf_Jdeveloper - Fatal编程技术网

是否有一种方法可以从adf表中导出excel,其中excel的某些列将是只读的?

是否有一种方法可以从adf表中导出excel,其中excel的某些列将是只读的?,excel,oracle-adf,jdeveloper,Excel,Oracle Adf,Jdeveloper,我创建了一个将adf只读表导出到excel的解决方案,但找不到一个可以使excel的某些列不可编辑的解决方案 我的代码如下 <af:commandButton text="Download Excel" id="cb3"> <af:setPropertyListener from="true" to="#{pageFlowScope.hideT

我创建了一个将adf只读表导出到excel的解决方案,但找不到一个可以使excel的某些列不可编辑的解决方案

我的代码如下

<af:commandButton text="Download Excel" id="cb3">
                      <af:setPropertyListener from="true"
                                              to="#{pageFlowScope.hideTheseColumnsInExcel}"
                                              type="action"/>
                      <af:exportCollectionActionListener type="excelHTML"
                                                         exportedId="t1"
                                                         filename="emtiaz.xls"
                                                         title="Emtiaz"/>
                      <af:setPropertyListener from="false"
                                              to="#{pageFlowScope.hideTheseColumnsInExcel}"
                                              type="action"/>
</af:commandButton>


上面的代码是我用来选择特定列的按钮和属性侦听器。

ExportCollection不提供这种级别的控制。 您可以选择使用ADF桌面集成,这将使您能够控制:

您需要在excel文件中设置格式,请检查以下URL

如果在将表格导出到excel文件时需要隐藏列 请查找以下代码

下载按钮:-

<af:commandButton text="#{appviewcontrollerbundle.exportExcel}"
                            id="cmi2" styleClass="btn-action"
                            disabled="#{bindings.ChatbotQuestionAnswerView1.estimatedRowCount == 0}"
                            rendered="#{sessionScope.channel ne 'MobileApp'}">
            <af:setPropertyListener from="1"  to="#{pageFlowScope.hideTheseColumnsInExcel}" type="action"/>
            <af:exportCollectionActionListener exportedId="t1"
                                               type="excelHTML" 
                                               filename="ChatBot.xls"
                                               title="Chatbot_Questions"/>     
            <af:setPropertyListener from="2" to="#{pageFlowScope.hideTheseColumnsInExcel}" type="action"/>
          </af:commandButton>

要在excel文件中显示的不需要的列:-

<af:column sortable="false" rendered="#{ pageFlowScope.hideTheseColumnsInExcel eq null or  pageFlowScope.hideTheseColumnsInExcel eq '2'}" partialTriggers="::cmi2" 
               headerText="delete" id="c7"
               noWrap="false" width="55" align="center">
      <af:commandLink action="delete" immediate="true"  text="delete" id="cb4" styleClass="btn-action" >
        <af:showPopupBehavior popupId="::p1" triggerType="action"/>
      </af:commandLink>
    </af:column>

我认为ADF导出无法实现这一点。您可能需要使用ApachePOI并以编程方式进行。