Tk Library Source Code

View Ticket
Login
Ticket UUID: 1204345
Title: variable size cell
Type: Patch Version: None
Submitter: bschofield Created on: 2005-05-18 15:07:38
Subsystem: report Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-01-25 10:20:56
Resolution: Rejected Closed By: sf-robot
    Closed on: 2006-01-25 03:20:56
Description:
Here is a patch that allows a reports to formatted in
such a manner that the cell widths are variable in
size, just big enough to fit the value. If one were to
define a style that converts a matrix to csv format,
the current implementation would produce something like
the following

foo, bar , ack ick
I   , love , tcl      

This patch provides the a new key word "var" for column
size and allows the integer value "0" to indicate that
cells in that column should be just big enough to hold
the data. For example, the following code fragment
would alter the results in the example below.

$report size 0 var
$report size 1 var
$report size 2 0 ; # integer value 0 to indicate
variable size

The new output would be

foo, bar, ack ick
I, love, tcl
User Comments: sf-robot added on 2006-01-25 10:20:56:
Logged In: YES 
user_id=1312539

This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

andreas_kupries added on 2006-01-11 04:52:10:
Logged In: YES 
user_id=75003

I am still waiting for a proper use case ...

andreas_kupries added on 2005-10-01 05:51:36:
Logged In: YES 
user_id=75003

Oops. I was to quick, buggy. It is much simpler.

proc ::csv::joinmatrix {matrix} {
    return [joinlist [$matrix get rect 0 0 end end]]
}

andreas_kupries added on 2005-10-01 05:49:53:
Logged In: YES 
user_id=75003

proc ::csv::joinmatrix {matrix} {
    set csv {}
    foreach line [$matrix get rect 0 0 end end] {
lappend csv [joinlist $line]
    }
    return [join $csv \n]
}

andreas_kupries added on 2005-10-01 05:43:56:
Logged In: YES 
user_id=75003

Hm. I am quite sure that I would not use a report object to
convert a matrix to csv. That can be done much more
directly. Get all cells of the matrix, which is a list of
lists, then iterate over the outer list and use csv::join to
generate the csv lines, [join] them. ... I better pack that
into a utility procedure.

Are there any other use cases there a report with a
right-ragged column makes sense ?

bschofield added on 2005-05-18 22:07:39:

File Added - 135014: report.tcl.var-size-cols.patch

Attachments: