Copy data from grid to clipboard and paste in Excel
up vote
0
down vote
favorite
I have data saved in array, get by selected rows. Want to copy them to clipboard and paste to excel but in format like in pic
enter image description here
But I have everything in one row and in one cell:
enter image description here
How to separate them. My code:
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
javascript excel clipboard
add a comment |
up vote
0
down vote
favorite
I have data saved in array, get by selected rows. Want to copy them to clipboard and paste to excel but in format like in pic
enter image description here
But I have everything in one row and in one cell:
enter image description here
How to separate them. My code:
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
javascript excel clipboard
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have data saved in array, get by selected rows. Want to copy them to clipboard and paste to excel but in format like in pic
enter image description here
But I have everything in one row and in one cell:
enter image description here
How to separate them. My code:
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
javascript excel clipboard
I have data saved in array, get by selected rows. Want to copy them to clipboard and paste to excel but in format like in pic
enter image description here
But I have everything in one row and in one cell:
enter image description here
How to separate them. My code:
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
function Copy () {
var coped = new Array();
$.each(searchGrid.getSelectedRowsData(), function () {
coped.push(this.SerialNumber, this.Model );
});
var dummy = document.createElement("input");
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
debugger;
// Output the array into it
document.getElementById("dummy_id").value = coped;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
};
javascript excel clipboard
javascript excel clipboard
edited Nov 19 at 14:16
wanttobeprofessional
81331222
81331222
asked Nov 19 at 14:12
Elena Pla...
32
32
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376480%2fcopy-data-from-grid-to-clipboard-and-paste-in-excel%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown