jasper reports - Fixed header in Excel using JasperReports -


how can create excel report fixed header using japserreports? mean need header fixed when scroll excel file.

this possible adding couple properties in jrxml file each report. take @ advanced excel features freeze panes. if wanted freeze after first column header (down left side basically) this:

            <statictext>                 <reportelement style="sans_bold" mode="opaque" x="0" y="60" width="104" height="20" forecolor="#ffffff" backcolor="#666666">                     <property name="net.sf.jasperreports.export.xls.auto.filter" value="start"/>                     <property name="net.sf.jasperreports.export.xls.column.width" value="110"/>                     <property name="net.sf.jasperreports.export.xls.freeze.column.edge" value="left"/>                 </reportelement>                 <box>                     <leftpen linewidth="0.5" linecolor="#000000"/>                     <bottompen linewidth="0.5" linecolor="#000000"/>                 </box>                 <textelement verticalalignment="middle"/>                 <text><![cdata[state]]></text>             </statictext> 

or if wanted freeze below header below own of fields:

           <statictext>                 <reportelement style="sans_bold" mode="opaque" x="316" y="60" width="199" height="20" forecolor="#ffffff" backcolor="#666666">                     <property name="net.sf.jasperreports.export.xls.freeze.row.edge" value="bottom"/>                 </reportelement>                 <box>                     <leftpen linewidth="0.5" linecolor="#000000"/>                     <bottompen linewidth="0.5" linecolor="#000000"/>                     <rightpen linewidth="0.5" linecolor="#000000"/>                 </box>                 <textelement verticalalignment="middle"/>                 <text><![cdata[street]]></text>             </statictext> 

if download jasperreports zip, there demo folder in it, contains working example, in xlsfeatures folder. final not, demo worked me when exporting xls, not when tried use xlsx (although there may way make work, not find quickly).


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -