I've looked and not found an answer to this yet. I assume the functionality is available right now, though, given the blog from 7 years ago about copy and pasting from Excel.
We have clients who frequently change the formulas they use to calculate quantities and costs based on those quantities, so it's imperative that the formula persist during a copy from their working sheets.
Our worksheet setup is now more aligned to the demo at www.igniteui.com/.../loading-data.
Thank you for posting in the Infragistics community!
I am not sure I understand what you need to achieve completely. I see that you have placed a Spreadsheet on the page, and there is also a workbook defined with JS code, that is visualized by the Spreadsheet.
Do you users need to be able to copy formulas from the Spreadsheet formula bar ? If this is the case, I believe this is currently working fine, which makes me think there is more to your scenario that I am missing. Please provide more details around it in order to make me able to help you.
Looking forward to hearing from you.
Our spreadsheets (to be copied) contain formulas which are not persisted to the columns they appear in. I have enabled the formula bar, but the only way to get the existing formula into the cell is to copy the formula directly (in the formula bar in Excel), one cell at a time. Our customers are expecting to copy thousands of rows at a time for integration into the db.
Thank for explaining your requirement. Currently copying the formula bar directly is not supported.
What you can do to persist the formula bars is a little trick:
1) Copy the formula as plain text wrapped in quotes in the next or another cell in the Spreadsheet. In the example below I use cell C1:
2) Copying/Pasting the second row to Excel will produce what you need:
I believe you should be able to hide/delete the B column before copying or after pasting so that to keep the original structure of your spreadsheet.
Please let me know if you have further questions, I will be glad to help.
You can also populate the C1 cell via code, if you need any assistance how to do that please let us know.
This doesn't solve my issues. I need to be able to paste a formula (or group of formulas) without modifying it before copy. Having it copy as plain text also breaks the formulas since they're based on the row they start in, and in plain text, they don't convert to the residing row. For instance, a formula may appear on row 34 in your source sheet, but since it's pasted as plain text, it doesn't compensate for being pasted to row 400 and will not represent the values of row 400 accurately.
I tried catching the paste event in order to apply the jQuery "applyFormula" function, but I couldn't get anything from it. I'm building based on the example at https://www.igniteui.com/spreadsheet/loading-data. Could you give a sample function that actually works to catch the paste action and apply the "applyFormula" function to values being pasted.
I did not mean modifying a formula in advance and pasting it as plain text.
What I meant is to dedicate a new column, where the formula that you have pasted, will be converted to plain text automatically.
Let's say that you paste a formula in C34, in D34 we will see the formula from C34 as plain text, wrapped in quotes. To achieve this, we need to put the following formula in D34:
=CHAR(34) & FORMULATEXT(C34) & CHAR(34)
(If you need this formula above on many rows, let's say 1 to 100, this should be either prepared in advance, so that each new row contains the corresponding index, or resolved programmatically. I will check further if this is feasible and update you)
Of course, you should be able to copy this formula along all rows, and the
Once that you copy the whole worksheet and paste in Excel, you will receive the expected output in cell D34. It is inconvenient that cell C34 will be of no use to you in excel, so you can delete it (the whole column).
Does this makes more sense now ? If you do think I still miss something from your scenario, please let me know so that I can further consider another programmatic solution.