TOPIC: Grid with RowSpan?
#1569
Grid with RowSpan? 10 Months, 3 Weeks ago
I looked at the code but this is my first report. Is there a way to make a Grid with a RowSpan? i.e. ASCII drawing:

Code:


+----------------+---------+---------+
|                | ABC DEF | XYZ 123 |
| Person's Name  +---------+---------+
|                | FED CBA | 321 ZYX |
+----------------+---------+---------+



I see where Grid has span but not rowspan. I tried various things with using Hline and Vline, all were very difficult to format and keep looking right (never did get the vertical spacing right as in the above example). If Grid had a RowSpan, that would be terrific!

Jeremy
 
 
Last Edit: 2009/10/03 23:29 By jeremy_c.
 
#1573
Re:Grid with RowSpan? 10 Months, 3 Weeks ago
No, Grid does not have rowspan. I agree it would be nice.

You can usually use nested containers to achieve similar results. For example a Grid inside a Horz (or inside another Grid)
 
 
andrew
 
#1575
Re:Grid with RowSpan? 10 Months, 3 Weeks ago
I have tried the Grid inside of a Grid but it seems to then have double borders :-/

Jeremy
 
 
#1581
Re:Grid with RowSpan? 10 Months, 3 Weeks ago
This is the best I could come up with. Any thoughts on making this look correct?

Code:


#(Params
  (Grid (
    (
      (Text 'Checkpoint')
      (Text 'CH')
      (Grid (
        ((Text 'Dist') (Text 'GS') (Text 'ETE') (Text 'ETA') (Text 'Fuel U'))
        ((Text 'Rem') (Text 'Act') (Text 'ATE') (Text 'ATA') (Text 'Fuel R'))
      ) border: 1)
    )
  ) border: 1)
  title: "Flight Plan"
)



Jeremy
 
 
#1582
Re:Grid with RowSpan? 10 Months, 3 Weeks ago
I tried a few things but I did not have much success.

I think the best answer is to improve GridFormat. The code is not too big, but it will be tricky to get it right. You would need both row span and vertical centering.

I notice that even now it does not seem to be calculating the size properly when nested. (The inside Grid goes past the outside Grid.)

Jennebelle has worked with Grid more, maybe she will have a suggestion.

A totally different approach would be to generate HTML and use the browser control to display and print it.
 
 
andrew
 
#1583
Re:Grid with RowSpan? 10 Months, 3 Weeks ago
I was hoping to be able to create PDFs and control the printing pretty closely.

Jeremy
 
 
#1609
Re:Grid with RowSpan? 10 Months, 1 Week ago
Here is an idea:

Code:

Params.On_Preview(#(Horz 
    (Vert Vskip (Static "Person's Name") Vskip)
    Hskip
    (Grid (
        ((Text 'ABC DEF') (Text 'XYZ 123'))
        ((Text 'FED CBA') (Text '321 ZYX'))
        ) border: 1)
    )
  )



Or something like this:

Code:

Params.On_Preview(#(Horz 
    (Grid (
        ((Text "Person's Name")(Text 'ABC DEF') (Text 'XYZ 123'))
        ((Text "")(Text 'FED CBA') (Text '321 ZYX'))
    ) border: 1)
    )
  )



It would probably be pretty easy to add a row span that just skips the rows but it will take quite a bit of work to make sure the vertical centering worked properly (to make sure it handles all types of headings, titles, images, etc.)
 
 
#1613
Re:Grid with RowSpan? 10 Months ago
Correct borders are pretty important as it's the standard way of printing a pilots logbook.

Jeremy