Skip to content

Commit 1e6510a

Browse files
excel export DeepSee standard method (experimental)
1 parent 00b38fb commit 1e6510a

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

export/LightPivotTable-DeepSeePortlet.xml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<Class name="DeepSee.LightPivotTable">
1313
<Super>%DeepSee.Component.Portlet.abstractPortlet</Super>
14-
<TimeChanged>63575,80028.98656</TimeChanged>
14+
<TimeChanged>63578,5208.234472</TimeChanged>
1515
<TimeCreated>63515,61322.546099</TimeCreated>
1616

1717
<Parameter name="INCLUDEFILES">
@@ -289,15 +289,43 @@
289289
<Language>javascript</Language>
290290
<ClientMethod>1</ClientMethod>
291291
<Implementation><![CDATA[
292+
var container = document.getElementById(this.id),
293+
controller = this.getConnectedController();
294+
292295
if (!this.LightPivotTable) return;
293296
294-
//if (location.pathname.indexOf("DeepSee") > -1) {
295-
// window.open(
296-
// location.href.replace(/(%|_)(25)?DeepSee.*/, "_DeepSee.UI.MDXExcel.zen?MDX=")
297-
// + encodeURIComponent(this.LightPivotTable.getActualMDX())
298-
// );
299-
// return;
300-
//}
297+
if (location.pathname.indexOf("DeepSee") > -1) {
298+
299+
var controls = this.id.replace(/\/.*/, "") + "/control/",
300+
i = 1, n,
301+
filter = document.getElementById(controls + i),
302+
303+
filterNames = [],
304+
filterValues = [];
305+
306+
do {
307+
if ((n = (filter.getElementsByTagName("input")[0] || {}).name) === "$V_applyFilter" || n === "$V_setFilter") {
308+
filterNames.push((filter.parentNode.getElementsByClassName("zenLabel")[0] || {}).innerText || "");
309+
filterValues.push("SET");
310+
}
311+
filter = document.getElementById(controls + (++i));
312+
} while (filter);
313+
314+
window.open(
315+
location.href.replace(/(%|_)(25)?DeepSee.*/, "_DeepSee.UI.MDXExcel.zen?MDX=")
316+
+ encodeURIComponent(this.LightPivotTable.getActualMDX())
317+
+ "&ROWTOTALAGG=sum"
318+
+ "&COLUMNTOTALAGG=sum"
319+
+ "&FILTERNAMES=" + encodeURIComponent(filterNames.join("\n"))
320+
+ "&FILTERVALUES=" + encodeURIComponent(filterValues.join("\n"))
321+
+ "&FILTERLABELS=" + encodeURIComponent(filterNames.join("\n"))
322+
+ "&TITLE=Exported data"
323+
+ "&SUBTITLE="
324+
+ "&CSPSHARE=1"
325+
+ "&CSPCHD=" + container.getElementsByTagName("div")[0].getAttribute("session")
326+
);
327+
return;
328+
}
301329
302330
var link = document.createElement("a"),
303331
csvData = [], preservedGroups = {},
@@ -353,7 +381,7 @@
353381
}
354382
355383
&html<
356-
<div maxHeaderWidth="#(..MaxHeaderWidth)#" listingColumnMinWidth="#(..ListingColumnMinWidth)#" fixTotals="#(..FixTotals)#" pagination="#(..Pagination)#" export-csv="#(..ExportCSV)#" data-source="#(..DataSource)#" show-summary="#(..ShowSummary)#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
384+
<div session="#(%session.CSPSessionCookie)#" maxHeaderWidth="#(..MaxHeaderWidth)#" listingColumnMinWidth="#(..ListingColumnMinWidth)#" fixTotals="#(..FixTotals)#" pagination="#(..Pagination)#" export-csv="#(..ExportCSV)#" data-source="#(..DataSource)#" show-summary="#(..ShowSummary)#" class="lpt-container" style="position: absolute; left: 0; bottom: 0; width: 100%; height: 100%;">
357385
358386
</div>
359387
>

0 commit comments

Comments
 (0)