Might be doable using cross-references...
How would that work?
Can you explain a little?
Untested, but I'm thinking add a text anchor in each cell of the main table, then reference those anchors in the subtables.
Have you tried the Edit > Place and Link feature to help you achieve this?
I thought about it but then I realized that it only works with "Placed" text
In my situation, I am not placing text - rather typing direct into InDesign
I still dont really understand
Do you mean that everything I type into the table should be into text anchors?
Edit->Place and Link also works for text which you type in InDesign.
1.) Open a new document having 2 pages init.
2.) Create a textframe on page#1 and fill it with some text.
3.) Place insertion pointer inside the text and from Edit->Place and link
4.) Click any where on Page#2 (This will create another frame which will be linked with textframe created on page#1)
Now if you will make any changes in textframe#1 then those will be reflected in textframe#2 once you update the story from links panel.
Its your choice. But the same thing can easily be achieved by Edit->Place and link also. You need not to create so many x-refs and keep track of them.
Keep cool! It's not a matter of choice. Do it with a table, as asked, and send us a screenshot! of the result!
@Dinesh – are you sure?
The scenario here is the following – at least I understood it like that:
1. A main source holding a table with a lot of cells.
2. Several small tables reflecting contents of arbitrary table cells out of the main source table.
How would that work without using cross references where text anchors (sources) are linked to individual cells through crossreferences?
With Edit->Place you could link individual tables to other text frames.
But individual cells to other cells in other tables?
Question on using the crossreferences scenario:
How can we update the source table without wrecking the special anchor characters?
We have to be very careful not removing the anchor. Doing it with a linked Excel file seems not be possible.
A script could help in that scenario. But without it?
I think with Edit -> Place we could link anchored text frames in table cells to other anchored text frames in different table cells. Is there an advantage in that vs. using text anchors with crossreferences?
As I understood the feature Edit -> Place is on Whole Story basis.
I've no problem With this process and I modify the data very quickly but you're right: we need to be very careful. Not I here, because I know exactly what I do.
All I do is define a little grep research on each cell containing a "Blue - Source" Char style and Click: Cmd-Alt-F. So, I select, cell by cell, the text in them without selecting the cross-reference marker.
@Obi-wan – yes. Doing an update on the sources in InDesign is possible like that :-)
What I'm aiming at is a script that can look at all crossReferenceSources in a table and store their properties and bind that information to table cells. So that after the anchors are destroyed after updating the table – by hand or by re-linking to an Excel file – the individual anchors can be recreated.
Both individual cells and crossReferenceSources are able to hold textual information not visible to the user through the insertLabel() / exportLabel() function/method set. So writing a script like that seems to be possible. In principle. I would not do it for free, of course… ;-)
And another scenario: even with the *normal* ScriptLabel functionality we could establish a workflow, where individual cells are bound to other cells. Their contents and other cell properties too could be synchronized through a script as well. Hm, have to think about it a bit more…
Aha! Uwe, you already make a lot on the Adobe Forums for free! Can't you do it for our friend MyDavey?
It's a joke! A script like this is complex to write. E.g., if I modify the data of a table and add it in the same time several columns and lines, how do you manage this?
@Obi-wan – it could be easy like that:
1. Select a table you want to use as The Source, label it "Source" (yes, whole tables can hold Script Label information!)
2. Start a script that is writing different information to the label property of every individual cell (that is also possible by hand with Script Label Panel).
3. For the target cell use the same label information like that in the source cell.
4. Have a script that syncs from the source to all targets: the contents of the cells, some other formatting like cell background color or applied cell style if you wish. You could even sync to individual text frames holding the same label (some properties that cannot be applied to text frames, but to cells could be filtered out).
Update the information in source. Add rows and columns if you wish. But also update the new cells with unique label information in source. And create new targets. After preparing source and targets sync by script.
No need for creating text anchors and crossreferences. And no chance to wreck the special characters (other than wrecking the process by changing the label information by hand with the Script Label Panel).
Thanks a lot for all your responses
You hit it on the nail - that is exactly what I am trying to do
There is still a lot of 'hand-work' do be done - i.e., setting up the tables and also when the rows/columns are changed
But it still seems like the best method
However, I do see that it is a fairly large script...
We have to:
1) get all the tables in the doc
2) find the source table - by script label
3) loop through each cell in the source table, and then search for that cell in all the other tables and update the contents
Is this what you meant?
It seems that if we have one large table and many small ones, this can take the script a considerable amount of time - true?
Like this, as you, I think it's doable.
Do you think the next way could be easily scripted: Word or Excel files updated links, and without loosing the style enhancements made in ID?
That sounds great!
If that is possible it would be the ideal situation!!
Lets hear what the pros have to say about it...
As we think, it's doable to script the process but there's a cost for this. The real question is: is this cost justified? Maybe! If not, cross-references is an easy way and it's doable.
But I like the script idea! … only if we consider the whole process and not just a little bit. For this, that needs a high-flying developer (as Uwe) and and a scenario that addresses and anticipates the whole issue! as for Comics.
Do you think the next way could be easily scripted: Word or Excel files updated links, and without loosing the style enhancements made in ID?
Definitely that's not easy! I fact that is a huge task…
@Davey – about speed: what do we talk about here? A source table with how many cells? How many target cells?
Should only unformatted contents be synchronized? Or even formatted text? That would make a substantial difference in speed…
The source table has about 3000 cells
It gets separated into 4 sub tables - numbered accordingly
Regarding the formatted text,
Its not so important but would be a nice feature
1/ you can define a script label for each table. Right?
2/ you can, in an "zero" ID file, import each XL table to have a link between this ID file and all the XL tables linked, creating text blocks where you "import and link" each XL table, defining for each text block a script label. E.g., the first XL table is in a first text block whose the script label is 0001-0000-0000. Right?
So, for this table, you can imagine, by calculation, that the first cell of the first line have the script label: 0001-0001-0001, the second cell: 0001-0001-0002 … the first cell of the second line: 0001-0002-0001, the second cell: 0001-0002-0002 … Right?
So, even if the first table is updated, we have not lost the script label of the text block where it is. Right?
So, If I'm right, you can with this update the tables in the "Layout" ID file (we have pasted the tables in it defining for them the same script labels as the text blocks of the "zero" ID file.
To do this, you use the idea of your post#15. Right?
You can do this because if the first text block script label, in the "zero" ID file, is 0001-0000-0000, the first table script label, in the "layout" ID file, is 0001-0000-0000 too! Right?
I imagine you understand the interest of the "zero" ID file. Now, we only have to update the XL files, launch a [JS] to update (the script labels) and we don't loose the enhancements made in the "Layout" ID file.
Thanks to tell me if I'm right … or totally wrong!
@Obi-wan – yes. If we have a Source document and one or several Target documents open (or available) we can establish a connection with unique labeled cells in Source to various target cells in the Target documents. Changing the contents of the Source would not affect the labels. Unless we build a totally different target table. What I have to check is, if updating a table with a linked Excel file will only "update" the contents of the table or rebuild it anew (and that would erase all already assigned labels).
As first tests are showing, an updated Excel file linked to a table in InDesign will not create a new table. Even if columns and rows are added.
So a possible workflow with a set of scripts would do the following:
1. Source Document with one big table.
Select the table, run the first script, that will give every cell in the table, that is not labeled, a unique label.
Run it again, if you update the table with more columns and rows.
2. To create the target tables, one can simply copy chunks of the table and paste them into the target document(s) as separate tables. Or do so with selected rows or selected columns. The applied labels will survive, if cells are exchanged with cells.
3. Run a script to synchronize source contents to target table(s). The unformatted contents will be duplicated (fast mode) or the formatted text will be duplicated (very slow mode). Check for overset cells or whole tables before and after. Fix the overset before doing anything else.
4. Run a helper script to set the labels of all selected cells in a table to "empty", if you want to rearrange things or start from scratch.
5. To protect content from beeing copied to the target, simply label them with a string that is not used in the target.
6. To protect content from beeing updated in the target, simply label them different from any string that is used for labels in the source.
6. [Edit] Or use an empty label for a cell you want to protect in the target.
Sounds nice, but it also sounds complex...
I dont understand 2 and 3
Meaning, #2 says that I would have to copy chunks of text/cells to the other charts
This is manual work, something I was trying to avoid
#3 sounds like the script will do it automatically
Unless you mean that when the table row/column count changes, it will have to be adjusted automatically, otherwise the script will do it
When you imagine a script, you need to imagine it in a workflow. We're right on this point.
So, If I tell an author how I proceed, I can change his way to work (a little, He's the boss!). So, imagine my author writes a Finance book with a lot of tables that we need to update for the following editions, and maybe for the present edition. He basically works with Word creating his tables in his Word files, using sometimes Excel for very complex tables.
What I finally ask him is copy each table in a Excel file. The book has, e.g., 37 chapters. Each table is numbered as: Table-01-1.xlsx, Table-01-02.xlsx, … for the Chapter 1 ; Table-02-01.xlsx, Table-02-01.xlsx, … for the Chapter 2 …
So the author gives me 37 Word files (one per Chapter) and 37 Excel folders (with x Excel files per each, corresponding to all the tables found in each chapter).
I import the 37 Chapters (Word files) in ID. I make a "beautiful" layout BUT there's here no link between ID and Excel.
@Davey – this all is in "concept" phase.
For #2: here I am outlining a possible workflow where you have the Source table and no target tables.
To create a target you could simply copy/paste parts of the source to another InDesign file. Done.
Or I could develop a script that would do that for you. Eg.: In the UI of that script you could tell the script copy cell x to y of source to a specific insertion point in a text of a specific text frame. Or overwrite an existing table with new cells. Or, or…
For #3, yes the script will do that automatically. You are prompted for a source document, you point the script to that document, and you are prompted for a or some target documents. When this is done, the update of the contents in the target will run automatically.
When row and column count for a target should change, you could do this by adding rows and columns from the source by copy/paste. Or we need another script or a control, that will add columns or rows automatically in a specified range. Or with a rule we need to define yet… ;-)
As I said, it's only a "concept". What it is not: the Swiss Army Knife of Database Publishing.
Let's keep it simple for now.
The main principle behind that workflow:
We have labels on cells. If one label of a source cell has the same value as the label on a target cell, there is a mechanism that can update one source to one target or one source to many targets.
@Obi-wan – so? So! Yes. !!
Building such a workflow is possible. In this case we have several source tables you can link to Excel files. Place them all in arbitrary sequence into the source document. Do not touch them by removing columns or rows. Just update them, if the author delivers new files.
Before doing the targets, label every cell you want to synchronize later.
The targets are tables of various sizes. Copy and pasted from the source table(s). The labels are transferred with that. If additional columns or rows should be in the target, just copy and paste them from the labeled sources to existing tables or as new tables to the target document(s).
Then run the script to synchronize the contents.
In fast mode the script will update the contents without formatting. Nested styles, cell styles, GREP styles will do all the necessary final formatting.
@Obi-wan – it may be not *exactly* what you want, but it's close.
What you want is some **magic**, that is updating the tables to new content AND doing the formatting right.
If you can write a rule-book for the formatting part, that is absolutely logical, I could write a script that will do this magic.
If not, and you have a list of 1001 exceptions it is still doable, but will cost you "an arm and a leg"… ;-)
I will give the basic functionality described in answers #24-26 a try and write something.
I'll be back with a demo soon…
Then, I think, we could discuss implementation and questions about usage or a GUI (Graphical User Interface) better.
Ok. Back again. I wrote a set of scripts. Basic functionality is working well. Still testing a bit and then doing a demo movie. No GUI yet. Think we need something like a Label Inspector to make that workflow more convenient. And a meta table that is showing which label goes to which cell with what contents currently.
Here some figures with my testing on a MacBook Pro OSX 10.7.5 with InDesign CC v10:
(Unformatted contents only)
1. Labeling 6,000 cells in Source Document with unique labels: about 35 sec.
2. Synchronizing ALL 6,000 cells in Source with 600 cells in target: about 6 sec.
3. Synchronizing ALL 6,000 cells in Source with 3,000 cells in target: about 9 sec.
Ok. Times could vary. My table cells did not contain much. Just their label information.
You'll hear from me. :-)
Uwe, good luck! Hope you can show us something amazing! I do not forget the amount of work necessary to begin to see the end of the tunnel!