Application affectation tag library, we can consign the abstracts filigree as excel, pdf, csv and xml. In the afterward archetype we will see how to dispaly abstracts application affectation tag and to consign as excel, pdf, csv and xml.
The afterward jar files should be placed in the WEB-INF/lib directory
itext-1.3.jar book is appropriate incase of exporting to pdf. displaytag-export-poi-1.2.jar is requried to consign the book as csv, xml and excel.The afterward taglib charge should be placed in anniversary JSP folio that uses the affectation tag.
In this archetype we will affectation a account of actor’s capacity like name, email Id and the TV appearance in which they performed. In this archetype we accept a ActorData chic which abundance the actor’s capacity like name, email id and the tv show. The ActorData chic has a loadData() adjustment which allotment an ArrayList of all the amateur details.
The afterward attributes and methods are present in the ActorData class.
In the execute() adjustment of the UserAction class, the loadData() adjustment of ActorData chic is called. This adjustment will acknowledgment an ArrayList of actors, that ArrayList is stored in the actorList aspect of the UserForm class.
Now we will affectation all the amateur abstracts present in the actorList in the jsp folio application dispalytag.
The consign aspect of the table tag should be set to true, inorder to consign the abstracts grid. After ambience the amount the abstracts filigree can be exported to excel, csv and xml. If you appetite to consign to pdf again the “export.pdf” acreage to true.
By absence the name of the consign book will be the name of the jsp page. You can change the name of the pdf book by ambience the “export.pdf.filename” acreage amount to the adapted book name. In the agnate way you can change the name of the excel book by ambience “export.excel.filename” acreage to a adapted book name.
The name aspect of the table tag authority the name of the account in the form. The id amount specifies an instance name for the ArrayList. The pagesize aspect holds the cardinal of annal to be displayed in anniversary page.
The acreage aspect of the cavalcade tag authority the amount of the acreage to be displayed in this anniversary column. The amount of the acreage can be any one of the acreage of the ActorData class. The ActorData chic should accept a getter adjustment for that agnate property. For instance if the acreage name is tvShow again their should be a agnate getTvShow() adjustment in the ActorData class.
If the sortable aspect of the cavalcade tag is set to “true” again that cavalcade will be sortable.
The accumulation aspect of the cavalcade tag is set to “1” , which agency anniversary different abstracts will be displayed alone already and will not be again for the consecutive times.
The afterward angel shows the aboriginal folio of the abstracts grid. Since the pagesize is set to ten, ten annal are displayed in the aboriginal page.
On beat the Excel articulation the user will be prompted to accessible or save the file.
On beat accessible the abstracts filigree will be displayed in Excel format.
The media acreage of the cavalcade tag is acclimated to specify in which media that cavalcade should be shown. If the media is set to “html” again alone in the jsp folio that accurate cavalcade will be displayed. If the media is set to “html, excel” again that accurate cavalcade will be displayed in jsp folio as able-bodied as in excel.
On beat the PDF articulation the user will be prompted to accessible or save the file.
On beat accessible the abstracts filigree will be displayed in PDF format.
On beat the CSV articulation the abstracts filigree will be displayed in the csv format.
On beat the XML articulation the abstracts filigree will be displayed in the xml format.
You can download the antecedent cipher of the displaytag consign to excel archetype by beat on the Download articulation below.
Source Lib: Download
I Will Tell You The Truth About Itext Fill Pdf Form Java Example In The Next 10 Seconds | Itext Fill Pdf Form Java Example – itext fill pdf form java example
| Pleasant for you to my personal website, within this time I will teach you in relation to itext fill pdf form java example