3 バイト配列を結合して 1 つの配列を形成し、レポートを生成しようとしていました。
byte[] bArray=null;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream( );
for(int i=0;i<3;i++)
{
//Other stuff
bArray = getTheReportContent(); //The return type of this method is List<byte[]>
outputStream.write(bArray);
}
byte bArrayCombined[] = outputStream.toByteArray( ); //Checked the count. bArrayCombined.length=sum of all the 3 bArray
response.setContentLength((int) bArrayCombined.length);
outStream.write(bArrayCombined, 0, bArrayCombined.length);
outStream.flush();
これを報告書に書いてみると、内容が思い通りにならない。最初のbArray
コンテンツのみを表示します。ここで私が間違ったところ。
編集:
次のgetTheReportContent
手順を実行します。
jasper を使用してレポートをエクスポートします。そして、byteArrList を返します。
List byteArrList = new ArrayList();
--------
exporterXLS.exportReport();
byteArrList.add(outputStream.toByteArray());