Paste Data

From Planimate Knowledge Base
Revision as of 19:33, 22 April 2015 by Rick (talk | contribs) (Created page with "=== Copying and Pasting Behaviour<br> === A range of cells can be selected and copied either using the "Copy" context menu option or Ctrl-C.<br> For pasting, the context m...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Copying and Pasting Behaviour

A range of cells can be selected and copied either using the "Copy" context menu option or Ctrl-C.

For pasting, the context menu has options for Paste Over, Paste Insert and Paste Append. These all operate from the selected cell (the column for Paste Append) or top left of a selected region if the selected cell is within it. Ctrl-V acs as the Paste Over.

Paste Insert inserts rows at the target row for the pasted data. Paste Append adds rows to the bottom of the table. These two options are not available if the table option "User Cannot Add/Delete Rows" is set, only Paste Over existing cells is possible.

Paste Over ignores columns past the last table column. If you are creating a table in Planimate you could use the "Import From Clipboard" option in the Table Editor File Menu. This is a data import tool that can create table columns and is not being discussed here.

Pate Over automatically appends rows if the pasted data extends paste the last row in the table unless the "User Cannot Add/Delete Rows" is set for the table.

Any columns with the "Protect From Edits" column option set are silently skipped during a paste, retaining their existing value. Newly added rows get the clear value for such columns. If all columns are set to "Protect From Edits" then a Paste OVer is effectively ignored.

Copying and pasting honours views with custom column formats/arrangements and row filters. You can paste over row filtered data but Planimate will not insert or append rows whilst there is a row filt

Memory vs Clipboard Paste

Data in the table editor and table views can be copy/pasted within Planimate, between instances of Planimate with different models and between Planimate and other applications such as spreadsheets.

When data is copy/pasted within an instance of Planimate, an "in-memory copy" is made, generally the underlying data is copied exactly as represented. This preserves precision even for display formats that truncate the displayed data, do not show years etc.

In cases where another application is active then Planimate is selected, the clipboard is used for pasting. It might well be the same data that was previously copied in that Planimate instance, eg:

  • you copy some data from a table
  • you switch to another program
  • you switch back to Planimate and paste

Copying via the clipboard is especially useful when a user pastes data from a spreadsheet. Some of Planimate's display formats are not clipboard friendly as they may hide seconds, minutes, the date or even the year, making their textual form only useful for reports, not actually useable date data input.

For a developer, copy/pasting such data is not a problem so long as you copy and paste within an instance of Planimate without switching to another application in between.

Special Paste Handling

Scaled Units

To keep consistent with the clipboard, pasting between scaled columns such as "Time Hours (scaled)", "Time Minutes (scaled)" and other unscaled columns such as "Units" always copies the numbers as displayed, even when it is a memory copy.

Text Columns

In-memory pasting from a non text column (values, times, labels) into a "Text" formatted column will paste the formatted original cell as text. This is particularly useful for converting labels into pure text.

In-memory pasting from a "Text" formatted column into any other format will attempt to interpret the text as the destination format, be it numbers, dates or labels - ie: you can use this to convert text into labels.

The above two cases are consistent with what would happen via the clipboard since there is no distinction between text and no text cells apart from enclosing quotes which are removed upon paste.

Pasting Into Dates

Planimate is quite generous when pasting into date formatted columns, if the format of the column fails to parse pasted text, Planimate will try each of the main classes of calendar time format that it supports, including the default operating system data format.

However if dealing with purely numerical US month/date/year data, it is strongly advised that the desination column be correctly formatted for such US dates as the defaults for date/month/year could easily misinterpret such data. Using named months will avoid this problem.

If a cell does not parse as a date its logged as an error and the paste continues.

Units and Times

Planimate first tries the format of the column to parse pasted data. If this fails, it will use simple heuristics (the "autoparser") to look for money, commas and hh:mm / hh:mm:ss type times and paste the value into the cell, with times being converted to seconds as is standard for most time formats (apart from the scaled ones mentioned above). If the autoparser fails, the cell is logged as an error.

Labels

Label formatted columns automatically add new labels if the user can add labels into that column, otherwise they are logged as errors.




If table data is copied within the same Planimate and directly

pasted, an 'in-memory' paste of the cell values/text is
performed, this means a binary copy of the cell data with the
resulting display depending on the format of the cell.
This is indicated in the context menu by the dimensions of the
data being displayed.

If you switch tasks away and back to Planimate, pasting occurs
via the Windows clipboard. Text data in the clipboard is
interpreted according to the format of the cells, with some
fallback to basic defaults. For date formatted cells, it
attempts to interpret with all the supported date formats.
Pasting via clipboard is indicated in the context menu by
"(clipboard)" being shown instead of dimensions. This size
isn't shown as arbitrarily processing the clipboard (which may
contain text the user never intends to paste) would make
the UI laggy.

- Label List Import Errors
- "logged errors" error state
- protected cells are skipped
paste bc


table paste handling code. Now supports pasting
of arbitrary selected regions at any point in a table. Features
include:
- works with Ctrl-V or table view context menu. Ctrl-V broadcast
is no longer sent and is redundant
- auto append of rows as needed unless user cannot append rows
to the table in which case only existing rows are altered
- supports customised column views and pasting over filtered rows
- extra columns are ignored (future version may give more options)
- does not stop on error, paste everything it can
- auto adds labels if user can do so
- can insert or paste over existing rows at any column
- can append new rows at entire row or column 1
- for copy/paste within an instance of Planimate with it staying
active, in-memory paste is performed. If you alt-tab to
another application, it pastes via clipboard.