sc/source/filter/excel/xepivotxml.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 76c3e6fdcdc522e0577097c7c4ff442e65129b94
Author:     Karthik Godha <[email protected]>
AuthorDate: Tue Jan 27 20:28:39 2026 +0530
Commit:     Michael Stahl <[email protected]>
CommitDate: Wed Jan 28 13:46:59 2026 +0100

    tdf#170498: Export dataOnRows attribute in PivotTable
    
    bug-document: forum-es-922.xls
    Change-Id: Ib78d5905665362277ef5fc9df307f68438655cef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198209
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index c2d7a064538e..bf426177feb1 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -989,13 +989,17 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
     const ScDPSaveData::DimsType& rDims = rSaveData.GetDimensions();
     bool bTabularMode = false;
     bool bCompactMode = true;
+    bool bDataOnRows = false;
     for (const auto & i : rDims)
     {
         const ScDPSaveDimension& rDim = *i;
 
         tools::Long nPos = -1; // position in cache
         if (rDim.IsDataLayout())
+        {
             nPos = -2; // Excel uses an index of -2 to indicate a data layout 
field.
+            bDataOnRows = (rDim.GetOrientation() == 
sheet::DataPilotFieldOrientation_ROW);
+        }
         else
         {
             OUString aSrcName = 
ScDPUtil::getSourceDimensionName(rDim.GetName());
@@ -1047,6 +1051,7 @@ void XclExpXmlPivotTables::SavePivotTableXml( 
XclExpXmlStream& rStrm, const ScDP
         XML_xmlns, rStrm.getNamespaceURL(OOX_NS(xls)).toUtf8(),
         XML_name, rDPObj.GetName().toUtf8(),
         XML_cacheId, OString::number(nCacheId),
+        XML_dataOnRows, ToPsz10(bDataOnRows),
         XML_applyNumberFormats, ToPsz10(false),
         XML_applyBorderFormats, ToPsz10(false),
         XML_applyFontFormats, ToPsz10(false),

Reply via email to