Tags:
create new tag
view all tags

Feature Proposal: Fully support summary lines on tables derived from searches

Motivation

Often a search generates a table, one in many cases one wants to produce a summary line at the bottom of that table showing, e.g., totals for the generated table columns (using SpreadSheetPlugin).

However, this only works if the search returns a result. If the search did not return any result, the table will be messed up. (This is also discussed on EmptySearchAndSpreadsheetProblem.) See this example:

Topic

Total: -1

Description

In all situations (i.e., whether the search does or does not return a result, table cells added immediately after a table generated by a search should render correctly as part of the generated table.

-- ThomasWeigert - 01 Jun 2005

Documentation

Additional parameter for %SEARCH:

Parameter: Description: Default:
"nofinalnewline" If on, the search variable does not end in a line by itself off

When nofinalnewline is on, any text continuing immediately after the search variable on the same line will be rendered as part of the table generated by the search, if appropriate.

Examples

ALERT! Don't work unless this feature is installed...

Modified (nofinalnewline="on", summary continues in same line)

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Location" nofinalnewline="on" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main" limit="3" format="|$web.$topic|"}%| Total: %CALC{"$ROW(-2)"}% |

TopicSorted ascending
Total: 3
AAlFandi
AJAlfieriCrispin
ALbertoBArrios

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Xocation" nofinalnewline="on" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main"  format="|$web.$topic|"}%| Total: %CALC{"$ROW(-2)"}% |

TopicSorted ascending
Total: 0

Modified (nofinalnewline="on", summary on new line)

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Location" nofinalnewline="on" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main" limit="3" format="|$web.$topic|"}%
| Total: %CALC{"$ROW(-2)"}% |

TopicSorted ascending
ALbertoBArrios
AAlFandi
AJAlfieriCrispin

Total: -1

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Xocation" nofinalnewline="on" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main"  format="|$web.$topic|"}%
| Total: %CALC{"$ROW(-2)"}% |

Topic

Total: -1

Traditional (Summary on new line)

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Location" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main" limit="3" format="|$web.$topic|"}%
| Total: %CALC{"$ROW(-2)"}% |

TopicSorted ascending
Total: 3
AAlFandi
AJAlfieriCrispin
ALbertoBArrios

%TABLE{sort="on" initsort="1" initdirection="down" headerrows="1" footerrows="1"}%
| *Topic* |
%SEARCH{ "Xocation" casesensitive="on" regex="on" nosearch="on" nototal="on" web="Main"  format="|$web.$topic|"}%
| Total: %CALC{"$ROW(-2)"}% |

Topic

Total: -1

Implementation

I have implemented this feature with a flag to search. I do believe that this should be the standard behavior of search.

In SVN 4345.

Added doco SVN 4348.


Discussion:

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-06-06 - SamHasler
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.