*
* @throws com.haulmont.yarg.exception.ReportingException If there is not appropriate band or alias is bad
*/
protected void replaceAllAliasesInDocument() {
XTextDocument xTextDocument = as(XTextDocument.class, xComponent);
XReplaceable xReplaceable = as(XReplaceable.class, xTextDocument);
XSearchDescriptor searchDescriptor = xReplaceable.createSearchDescriptor();
searchDescriptor.setSearchString(ALIAS_WITH_BAND_NAME_REGEXP);
try {
searchDescriptor.setPropertyValue(SEARCH_REGULAR_EXPRESSION, true);
} catch (Exception e) {
throw new OpenOfficeException("An error occurred while setting search properties in Open office", e);
}
XIndexAccess indexAccess = xReplaceable.findAll(searchDescriptor);
for (int i = 0; i < indexAccess.getCount(); i++) {
try {
XTextRange textRange = as(XTextRange.class, indexAccess.getByIndex(i));
String alias = unwrapParameterName(textRange.getString());