Domanda

i have an application in which i have a table and that table is converting its data to a pdf file it is in sturts and it is working fine.But i have to add this capability to another application which also have a table with data from the database.i am posting my working code and also the piece of code where i want to add this capability.... this is the page from where i am exporting the data to a pdf file.i have implemented this in my table but when i click on the table

    <display:table class="tableData context-menu-one" name="sessionScope.DetailsFormBean.listOfUser" requestURI="/search.do" id="tableData" pagesize="10" style="overflow-x: scroll" export="true">
                    <thead>
                        <tr style="font-size: 14px;" >
                            <th  align="left"> <display:column  title="Favourites"/></th>
                            <th  align="left"> <display:column property="call_type" title="CALL_TYPE"/></th>
                            <th  align="left"> <display:column property="a_no" title="A_NO"/></th>
                            <th  align="left"> <display:column property="b_no" title="B_NO"/></th>
                            <th  align="left"> <display:column property="call_duration" title="CALL_DURATION"/></th>
                            <th  align="left"> <display:column property="start_day" title="START_DAY"/></th>
                            <th  align="left"> <display:column property="end_day" title="END_DAY"/></th>
                            <th  align="left"> <display:column property="a_home_circle" title="A_HOME_CIRCLE"/></th>
                            <th  align="left"> <display:column property="a_rome_circle" title="A_ROME_CIRCLE"/></th>
                            <th  align="left"> <display:column property="a_imei" title="A_IMEI"/></th>
                            <th  align="left"> <display:column property="a_imsi" title="A_IMSI"/></th>

                            <display:setProperty name="export.excel.filename" value="ActorDetails.xls"/>
                            <display:setProperty name="export.pdf.filename" value="ActorDetails.pdf"/>
                            <display:setProperty name="export.pdf" value="true" />
                        </display:table> 




  <action input="/"  name="DetailsFormBean"  path="/search" scope="session" type="com.homeland.action.HomeLandPersonalAction" parameter="search">
        <forward name="found" path="/searchpage.jsp"/>
    </action>

the table dissapears when i click on the export to pdf options....somebody please help

È stato utile?

Soluzione

Exporting as pdf,csv & xml is from struts-displaytag properties. You have to use displaytag in your JSP page and then use the list actorList.

It doesn't depend on Database. Once the list gets the values (either from DB or other ways-hard coded too), you can display it in your JSP using displaytag property. And it will show the option of exporting, provided you set it to true.

This would looks like the same as in your question.

<display:table id="data" name="sessionScope.UserForm.actorList" requestURI="/userAction.do" pagesize="10" export="true">
        <display:column property="tvShow" title="TV Show" sortable="true" media="html" group="1" />
        <display:column property="userName" title="User Name" sortable="true" />
        <display:column property="emailId" title="Email Id" sortable="true" />
        <display:setProperty name="export.excel.filename" value="ActorDetails.xls"/>
        <display:setProperty name="export.pdf.filename" value="ActorDetails.pdf"/>
        <display:setProperty name="export.pdf" value="true" />
    </display:table>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top