import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
<!-- 指标查询的tab页内容 start-->
<div class="tab_contents">
<!-- 搜索条件面板 -->
<div class="search_box_panel">
<table class="search-box-table">
<tr>
<th width='40px'></th>
<th>年份:</th>
<th>
<select id="beginYear" name="" class="ui-text">
</select>
</th>
<th>至</th>
<th>
<select id="endYear" name="" class="ui-text">
</select>
</th>
<th width='55%'></th>
<th><button id="search_for_index_btn" class="ui-btn ui-btn-primary">查询</button></th>
<th><button class="ui-btn ui-btn-primary" οnclick="expPdf();">导出PDF</button></th>
<th><button class="ui-btn ui-btn-primary" οnclick="expExl();">导出Excel</button></th>
</tr>
</table>
</div>
<!-- 搜索结果面板 -->
<div id="search_result_panel" class="search_result_panel">
<table id="index_query_table">
<thead>
<tr>
<th rowspan="2">序号</th>
<th rowspan="2">年份</th>
<th colspan="4">节电量(万kWh)</th>
<th colspan="4">节电力(万kW)</th>
<th rowspan="2">状态</th>
</tr>
<tr>
<th>预指标值</th>
<th>确认值</th>
<th>承担值</th>
<th>指标值</th>
<th>预指标值</th>
<th>确认值</th>
import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.Rectangle;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
<!-- 指标查询的tab页内容 start-->
<div class="tab_contents">
<!-- 搜索条件面板 -->
<div class="search_box_panel">
<table class="search-box-table">
<tr>
<th width='40px'></th>
<th>年份:</th>
<th>
<select id="beginYear" name="" class="ui-text">
</select>
</th>
<th>至</th>
<th>
<select id="endYear" name="" class="ui-text">
</select>
</th>
<th width='55%'></th>
<th><button id="search_for_index_btn" class="ui-btn ui-btn-primary">查询</button></th>
<th><button class="ui-btn ui-btn-primary" οnclick="expPdf();">导出PDF</button></th>
<th><button class="ui-btn ui-btn-primary" οnclick="expExl();">导出Excel</button></th>
</tr>
</table>
</div>
<!-- 搜索结果面板 -->
<div id="search_result_panel" class="search_result_panel">
<table id="index_query_table">
<thead>
<tr>
<th rowspan="2">序号</th>
<th rowspan="2">年份</th>
<th colspan="4">节电量(万kWh)</th>
<th colspan="4">节电力(万kW)</th>
<th rowspan="2">状态</th>
</tr>
<tr>
<th>预指标值</th>
<th>确认值</th>
<th>承担值</th>
<th>指标值</th>
<th>预指标值</th>
<th>确认值</th>