While there is currently no way to it, you can see %DeepSee.UI.MDXExcel class, which does excel export and write your own csv exporter. It would be a simplified copy of %DeepSee.UI.MDXExcel.
All output is done via &html so you need to replace that with the usual write.
2. Write the method which executes the MDX from p.1 and forms CSV file from the %DeepSee.ResultSet
3. If you want to get the CSV from the widget add Action control with call to your method from p.2 or Call to another CSP page which will call you p.2 method and download csv file.
I implemented an excel export option for CCD activity dashboards many times. Here is the generic javascript that you can find all over the web:
$(document).ready(function () {
function exportTableToCSV($table, filename) {
var $rows = $table.find('tr:has(td)'),
// Temporary delimiter characters unlikely to be typed by keyboard // This is to avoid accidentally splitting the actual contents tmpColDelim = String.fromCharCode(11), // vertical tab character tmpRowDelim = String.fromCharCode(0), // null character
// actual delimiter characters for CSV format colDelim = '","', rowDelim = '"\r\n"',
// Grab text from table into CSV formatted string csv = '"' + $rows.map(function (i, row) { var $row = $(row), $cols = $row.find('td');
return $cols.map(function (j, col) { var $col = $(col), text = $col.text();
// This must be a hyperlink $(".export").on('click', function (event) { // CSV exportTableToCSV.apply(this, [$('# directactivitytable>table'), 'export.csv']);
// IF CSV, don't do event.preventDefault() or return false // We actually need this to be a typical hyperlink }); });
Here is the custom javascript where you need to reference your specific classes:
$(".submit").on('click', function (event) { var activitytable = #server(HIE.Test.CareConnect.Util.C5Dash.ActivityTable())#; $('#activitytable').html(activitytable); var inputBoxValue = $('#query').val(); var directactivitytable = #server(HIE.Test.CareConnect.Util.C5Dash.DirectActivityTable(inputBoxValue))#; $('#directactivitytable').html(directactivitytable); });
And finally the div tags for a given webpage could be as follows:
Hello Saurav,
There is currently no way to export widgets or pivot tables to a CSV format.
Regards,
Asaf
Hello.
While there is currently no way to it, you can see %DeepSee.UI.MDXExcel class, which does excel export and write your own csv exporter. It would be a simplified copy of %DeepSee.UI.MDXExcel.
All output is done via &html so you need to replace that with the usual write.
Another option is:
1.Get the MDX from pivot,
2. Write the method which executes the MDX from p.1 and forms CSV file from the %DeepSee.ResultSet
3. If you want to get the CSV from the widget add Action control with call to your method from p.2 or Call to another CSP page which will call you p.2 method and download csv file.
Thanks and this is probably closest to what may work for my customer.
I implemented an excel export option for CCD activity dashboards many times. Here is the generic javascript that you can find all over the web:
$(document).ready(function () {
function exportTableToCSV($table, filename) {
var $rows = $table.find('tr:has(td)'),
// Temporary delimiter characters unlikely to be typed by keyboard
// This is to avoid accidentally splitting the actual contents
tmpColDelim = String.fromCharCode(11), // vertical tab character
tmpRowDelim = String.fromCharCode(0), // null character
// actual delimiter characters for CSV format
colDelim = '","',
rowDelim = '"\r\n"',
// Grab text from table into CSV formatted string
csv = '"' + $rows.map(function (i, row) {
var $row = $(row),
$cols = $row.find('td');
return $cols.map(function (j, col) {
var $col = $(col),
text = $col.text();
return text.replace(/"/g, '""'); // escape double quotes
}).get().join(tmpColDelim);
}).get().join(tmpRowDelim)
.split(tmpRowDelim).join(rowDelim)
.split(tmpColDelim).join(colDelim) + '"',
// Data URI
csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
$(this)
.attr({
'download': filename,
'href': csvData,
'target': '_blank'
});
}
// This must be a hyperlink directactivitytable>table'), 'export.csv']);
$(".export").on('click', function (event) {
// CSV
exportTableToCSV.apply(this, [$('#
// IF CSV, don't do event.preventDefault() or return false
// We actually need this to be a typical hyperlink
});
});
Here is the custom javascript where you need to reference your specific classes:
var activitytable = #server(HIE.Test.CareConnect.Util.C5Dash.ActivityTable())#;
$('#activitytable').html(activitytable);
var inputBoxValue = $('#query').val();
var directactivitytable = #server(HIE.Test.CareConnect.Util.C5Dash.DirectActivityTable(inputBoxValue))#;
$('#directactivitytable').html(directactivitytable);
});
And finally the div tags for a given webpage could be as follows:
<div class="uk-width-medium-1-1">
<hr class="uk-grid-divider">
<form class="uk-form" >
<p>
<a href="#" class="export">Export Table data into Excel</a>
</p>
</form>
<div class="uk-overflow-container">
<hr>
<div id="directactivitytable"></div>
</hr>
</div>
</hr>
</div>
</div>
Hi, Saurav!
DeepSeeWeb(DSW) has this option.
You can try it e.g. in DC Analytics.
Right-click on the widget and choose the Export -> Document (*.CSV) option:
E.g. here is the csv file for All the DeepSee posts on DC.
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue