#1 2012-11-29 14:24:20

Neevor
Member
From: Krakow, Poland
Registered: 2012-11-29
Posts: 2

How to draw a line below table header

Hello, I'm new on this forum and new in PDF Engine at all wink

I'm trying to use SQLite3Pages for report generating in runtime.
And...
How to underline whole table header and not rows? And maybe whole table (last row) too?
How to draw multiline header?
How to draw multiline text in single cell?
Can i bold one letter in one word in one cell? wink

That is enough for start.
Thanks in advance for any help.

Offline

#2 2012-11-29 14:49:16

Leander007
Member
From: Slovenia
Registered: 2011-04-29
Posts: 113

Re: How to draw a line below table header

Please look first report example in MainDemo (SQLite3/Samples/MainDemo) at procedure TFileRibbon.CreateReport in FileClient.pas.
Play a little bit with TGDIPages properties and methods. That way you will quickly see what is possible "out of the box".


"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal

Offline

#3 2012-11-29 14:57:27

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: How to draw a line below table header

Welcome in our forum!

Most of your question have already been answered in this forum.

0) Unit is now called mORMotReport.pas. wink

1) You have a WithBottomGrayLine boolean parameter to TGDIPages.AddColumnHeaders().
To customize column header, you have OnStartColumnHeader / OnEndColumnHeader event handlers.

2) Multi line header is possible when including #13#10 as line separator in the cell text.

3) Multi line in cell is possible when including #13#10 as line separator in the cell text.

4) There is no word-level or letter-level font attribute handled yet.

We are open to any patch/proposal!
wink

You can use a TRichEdit content to handle more complex content, in the limit of the RichEdit process, of course.

Thanks for your interest.

Offline

#4 2012-11-30 11:25:18

Neevor
Member
From: Krakow, Poland
Registered: 2012-11-29
Posts: 2

Re: How to draw a line below table header

Thanks for your answers.

Unfortunatelly i can't do what i want. I'm trying with latest (today's) version of mormot.

1) Multiline cells

    AddColumnHeaders(['Column'#13#10'number'#13#10'one','Column'#13#10'number'#13#10'two','Last column'],false,false);
    DrawTextAcrossCols(['One line','Two'#13#10'lines', 'almost empty']);

Code above gives me strange results:
20hspqh.jpg
i'm expecting something different.

2) Header underline.
I thought that use of multiple headers will workaround multiline cells.

    AddColumnHeaders(['Column','Column',''],false,false);
    AddColumnHeaders(['number','number',''],false,false);
    AddColumnHeaders(['one','two','Last column'],false,false);

Sure it is... but sad
I'm trying to underline entire header... Changing to

// last header row
AddColumnHeaders(['one','two','Last column'],true,false);

This code gives me every header's row underlined.
More... It underlines every data row too sad
1zvs52.png

It seems (and sure it is) that WithBottomGrayLine  is global for whole table. Not good.
Maybe there is a possibility to add something as AddGrayUnderline.

    AddColumnHeaders(['Column','Column',''],false,false);
    AddColumnHeaders(['number','number',''],false,false);
    AddColumnHeaders(['one','two','Last column'],false,false);
    AddGrayUnderline();

?

Offline

Board footer

Powered by FluxBB