if (reportContext == null)
{
return new String[0];
}
AbstractReportDefinition definition = reportContext.getReportDefinition();
final LinkedHashSet<String> names = new LinkedHashSet<String>();
while (definition != null)
{
final CompoundDataFactory dataFactoryElement = (CompoundDataFactory) definition.getDataFactory();
final int dataFactoryCount = dataFactoryElement.size();
for (int i = 0; i < dataFactoryCount; i++)
{
final DataFactory dataFactory = dataFactoryElement.getReference(i);
final String[] queryNames = dataFactory.getQueryNames();
names.addAll(Arrays.asList(queryNames));
}
if (definition instanceof SubReport)
{
final Section parentSection = definition.getParentSection();
definition = (AbstractReportDefinition) parentSection.getReportDefinition();
}
else
{
definition = null;