SID-01921: EDITTABLE overwrites code
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
5.5 |
| Category: |
EditTablePlugin |
Server OS: |
Linux centos 6.4 |
Last update: |
11 years ago |
Hi. I am new to TWiki and I'm having some troubles with EDITTABLE.
When I use EDITTABLE, it sometimes overwrites my label rows, setting them to 0 or deleting the contents entirely. It happens when I'm using CALC. I also need to call the variable to another topic. Is there a way to tell EDITTABLE not to modify the code inside a label?
For Example, this table, if edited and saved, correctly keeps Service Level's formula, but sets Variance to 0, and destroys the variable declarations in the last column.
%EDITTABLE{format=" | text, 10, 0 | text, 10,0 | text, 10,0 | label, 4 | label, 4 | label, 4 | label, 4 |" footerrows="1" headerrows="1" headerislabel="on" changerows="off"}%
%TABLE{name="Report" tablewidth="1000" footerrows="1" headeralign="center" dataalign="right"}%
| *F2015Month* | *Total Orders* | *On Time* | *Service Level* | *Target* | *Variance* | | |
| *Febuary* | 102 | 89 | %CALC{$FORMAT(PERCENT, 1, $EVAL($T(R$ROW():C3) / $T(R$ROW():C2)))}% | 95% | %CALC{$FORMAT(PERCENT, 1, $EVAL( ($T(R$ROW():C4) - $T(R$ROW():C5))/100))}% | <!--- %CALC{$SET(OTFFebSL,$T(R$ROW():C4))}% %<nop>CALC{$GET(OTFFebSL)}% %CALC{$SET(OTFFebVar, $T(R$ROW():C6))}% %<nop>CALC{$GET(OTFFebVar)}% ---> |
--
Matthew Boucher - 2014-05-07
Discussion and Answer
I have somewhat similar issues. My solution was
1. set a custom variable
Set WORKSHEETTOTALCOST = $ROUND($EVAL($VALUE($T(R$ROW():C$COLUMN(-4))) * $VALUE($T(R$ROW():C$COLUMN(-2))) * $VALUE($T(R$ROW():C$COLUMN(-1)))), 2)
etc...
2. place it in the EDITTABLE Parameters
%EDITTABLE{format="|text, 20|text, 5|text, 5|text, 5|text, 5|text, 5, %WORKSHEETTOTALCOST%|text, 5, %WORKSHEETTOTALPRICE%|text, 5|text, 5, %WORKSHEETTOTALREVENUE%|text, 5, %WORKSHEETFINALPRICE%|" quietsave="off"}%
see my example
Sandbox.WorksheetTest
--
Michael Severo - 2014-05-07
Not sure. Can you reproduce it here on TWiki.org? Let's see:
This is a perfect example where you could get more more flexibility by creating a tailored TWiki application with
TWikiForms. See blog on
How to Create a TWiki Application.
--
Peter Thoeny - 2014-05-07
Looks like an issue, column 6 is resolved to 0.
--
Peter Thoeny - 2014-05-07
The above example seems to work without the format PERCENT or % symbol ?
--
Michael Severo - 2014-05-08
Thank you for your quick help.
Removing the % seems to work for column 6. Unfortunately it still eats my variable declarations.in column 7, which of course prevents me from pulling the variables to a new topic.
If a way exists for me to call a table cell from another topic that would also solve my problem.
For example, if on another page, I could INCLUDE{this topic}, then call R2:C4 from table: 'this'. Is that possible?
--
Matthew Boucher - 2014-05-08
- You should just removed all the percent formatting for all column.
- Theres this for table cell call Sandbox/SpreadSheetRollupTest.
- A different approach maybe perhaps make an application with forms?
--
Michael Severo - 2014-05-08
Removing all percent formatting and declaring the variables outside the table like Sandbox/SpreadSheetRollupTest worked for me.
Thank you for your help.
--
Matthew Boucher - 2014-05-12
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.