Skip to content

Commit f92f3f4

Browse files
excel export standard DeepSee method replace
1 parent f3d72e2 commit f92f3f4

4 files changed

Lines changed: 30 additions & 2 deletions

File tree

export/LightPivotTable-DeepSeePortlet.xml

Lines changed: 10 additions & 1 deletion
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>63565,64700.290542</TimeChanged>
14+
<TimeChanged>63566,4522.006886</TimeChanged>
1515
<TimeCreated>63515,61322.546099</TimeCreated>
1616

1717
<Parameter name="INCLUDEFILES">
@@ -247,6 +247,15 @@
247247
<ClientMethod>1</ClientMethod>
248248
<Implementation><![CDATA[
249249
if (!this.LightPivotTable) return;
250+
251+
if (location.pathname.indexOf("DeepSee") > -1) {
252+
window.open(
253+
location.href.replace(/(%|_)(25)?DeepSee.*/, "_DeepSee.UI.MDXExcel.zen?MDX=")
254+
+ encodeURIComponent(this.LightPivotTable.getActualMDX())
255+
);
256+
return;
257+
}
258+
250259
var link = document.createElement("a"),
251260
csvData = [], preservedGroups = {},
252261
rawData = this.LightPivotTable.dataController.getData(),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "LightPivotTable",
33
"author": "ZitRo",
4-
"version": "1.0.0-beta.2",
4+
"version": "1.0.0-beta.3",
55
"description": "A lightweight pivot table for MDX2JSON source for InterSystems Cache",
66
"main": "test/testServer.js",
77
"repository": {

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ lp.setFilter("[DateOfSale].[Actual].[YearSold].&[2009]");
7676
lp.refresh(); // refresh pivot contents
7777
lp.updateSizes(); // recalculate pivot sizes
7878
lp.changeBasicMDX("..."); // change basic mdx
79+
lp.getActualMDX(); // get the current mdx
7980
```
8081

8182
#### Caché DeepSee

source/js/LightPivotTable.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,24 @@ LightPivotTable.prototype.changeBasicMDX = function (mdx) {
7777

7878
};
7979

80+
/**
81+
* Returns current mdx including filters.
82+
* @returns {string}
83+
*/
84+
LightPivotTable.prototype.getActualMDX = function () {
85+
86+
var mdx = this.CONFIG.dataSource.basicMDX,
87+
mdxParser = new MDXParser(),
88+
filters = this.dataSource._PIVOT_DEFAULT_FILTERS.concat(this.dataSource.FILTERS);
89+
90+
for (var i in filters) {
91+
mdx = mdxParser.applyFilter(mdx, filters[i]);
92+
}
93+
94+
return mdx;
95+
96+
};
97+
8098
/**
8199
* Performs resizing.
82100
*/

0 commit comments

Comments
 (0)