Jump to content
JasperReports Library 7.0 is now available ×

Suppressing column headings


tmg

Recommended Posts

We are trying to get column headings for certain export types to show only on the first page. When executing the code below, we get the following error:

net.sf.jasperreports.engine.JRException: Report design not valid :

1. Variable not found : $V{PAGE_NUMBER}

 

Code:
		JRDesignBand bandDetail = new JRDesignBand();
bandDetail.setHeight(20);

JRDesignBand bandHeader = new JRDesignBand();
bandHeader.setHeight(60);

//suppress column headings except for the following export types
if (mExportType != "PDF"«»)
{
JRDesignExpression mExp = new JRDesignExpression();
JRDesignExpressionChunk c1 = new JRDesignExpressionChunk();
c1.setText("new Boolean("«»);
c1.setType(JRExpressionChunk.TYPE_TEXT);
mExp.addChunk(c1);
JRDesignExpressionChunk c2 = new JRDesignExpressionChunk();
c2.setText("$V{PAGE_NUMBER}"«»);
c2.setType(JRExpressionChunk.TYPE_VARIABLE);
mExp.addChunk(c2);
JRDesignExpressionChunk c3 = new JRDesignExpressionChunk();
c3.setText(".intValue()==1)"«»);
c3.setType(JRExpressionChunk.TYPE_TEXT);
mExp.addChunk(c3);
mExp.setValueClass(Boolean.class);
bandHeader.setPrintWhenExpression(mExp);

}

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...