32#include <com/sun/star/sdb/CommandType.hpp>
39 using namespace xml::sax;
43 const Reference< css::xml::sax::XFastAttributeList > & _xAttrList
44 ,
const uno::Reference< report::XReportDefinition >& _xComponent) :
45 OXMLReportElementBase( rImport, _xComponent,nullptr)
46 ,m_xReportDefinition(_xComponent)
48 OSL_ENSURE(m_xReportDefinition.is(),
"No Report definition!");
50 impl_initRuntimeDefaults();
56 switch( aIter.getToken() )
60 sal_Int32 nRet = sdb::CommandType::COMMAND;
63 SAL_WARN_IF(!bConvertOk,
"reportdesign",
"convertEnum failed");
64 m_xReportDefinition->setCommandType(nRet);
68 m_xReportDefinition->setCommand(aIter.
toString());
71 m_xReportDefinition->setFilter(aIter.
toString());
75 m_xReportDefinition->setCaption(aIter.
toString());
81 m_xReportDefinition->setMimeType(aIter.
toString());
84 m_xReportDefinition->setName(aIter.
toString());
94 TOOLS_WARN_EXCEPTION(
"reportdesign",
"Exception caught while filling the report definition props");
99OXMLReport::~OXMLReport()
104void OXMLReport::impl_initRuntimeDefaults()
const
106 OSL_PRECOND( m_xReportDefinition.is(),
"OXMLReport::impl_initRuntimeDefaults: no component!" );
107 if ( !m_xReportDefinition.is() )
112 m_xReportDefinition->setCommandType( sdb::CommandType::COMMAND );
121css::uno::Reference< css::xml::sax::XFastContextHandler > OXMLReport::createFastChildContext(
123 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
125 css::uno::Reference< css::xml::sax::XFastContextHandler > xContext = OXMLReportElementBase::createFastChildContext(nElement,xAttrList);
144 m_xReportDefinition->setReportHeaderOn(
true);
151 m_xReportDefinition->setPageHeaderOn(
true);
168 m_xReportDefinition->setPageFooterOn(
true);
175 m_xReportDefinition->setReportFooterOn(
true);
186void OXMLReport::endFastElement(sal_Int32)
188 Reference< XFunctions > xFunctions = m_xReportDefinition->getFunctions();
190 for (
const auto& rEntry : aFunctions)
191 xFunctions->insertByIndex(xFunctions->getCount(),
uno::Any(rEntry.second));
193 if ( !m_aMasterFields.empty() )
194 m_xReportDefinition->setMasterFields(Sequence< OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
195 if ( !m_aDetailFields.empty() )
196 m_xReportDefinition->setDetailFields(Sequence< OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
199void OXMLReport::addMasterDetailPair(const ::std::pair< OUString,OUString >& _aPair)
201 m_aMasterFields.push_back(_aPair.first);
202 m_aDetailFields.push_back(_aPair.second);
const SvXMLImport & m_rImport
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
std::map< OUString, Reference< XFunction > > TGroupFunctionMap
OXMLReport(const OXMLReport &)=delete
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
#define SAL_WARN_IF(condition, area, stream)
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
OUString toString(OptionInfo const *info)
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
#define PROGRESS_BAR_STEP
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)