Section Invocation
Sections can be enabled / disabled sections during runtime. The following codes demostrate how to retrieve a dynamic parameter to determine the sections to be rendered :-
- Code Snippet -
(Written at the report template, 'On Render Begin' of the Report)
//Get the list of sections
reportList = this.getSectionList();
ltIter = reportList.listIterator();
while (ltIter.hasNext())
{
tempString = (ltIter.next()).toString();
tempFlag = "True";
//Retrieve parameter and pass in to StringTokenizer to separate the string, ',' is the delimiter
st = new java.util.StringTokenizer
(Properties.getProperty("ListOfSections"),",");
//Enable / Disable Section
while (st.hasMoreTokens())
{
if(tempString.equals(st.nextToken()))
{
tempFlag = "False";
}
}
if(tempFlag.equals("True"))
{
ltIter.remove();
}
}
Sample parameter pass-in : Section 1, Section 2
Parameter passed in are separated by the StringTokenizer() and for loop set the flag to enable the sections.