[Urgente]Secure table in the text

General TRichView support forum. Please post your questions here
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There are two ways to apply this formatting to the header:
1) Apply "courier + right alignment" to 'header' style template, so text will be courier + right aligned by default.
2) Leave 'header' style template as it is, but apply "courier + right alignment" to text on top of a style template.

Which one do you prefer?
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Option 1
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

problem solved,
thanks again
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I have many questions yet. kkk
The function FillFields transforms tags (for example {Name}) I include by the event onPaintPage? If yes, how do?
For now I have only:

Code: Select all

FillFields (SRichViewEdit1.RichViewEdit.RVData) / / / body text
SRichViewEdit1.RichViewEdit.Format;
FillFields (SRichViewEdit1.RVHeader.RVData) / / / Header
SRichViewEdit1.RVHeader.Format;
FillFields (SRichViewEdit1.RVFooter.RVData) / / / footer
SRichViewEdit1.RVFooter.Format;
and the tests did not replace.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If you use RichViewActions (TrvActionNew for creating a new document), changing the default header font is very simple.
rvActionNew1.StyleTemplate contains a list of styletemplates that will be applied to new documents.
A styletemplate named 'header' is included there by default. You can change its properties

Code: Select all

st := rvActionNew1.FindItemByName('header');
st.TextStyle.FontName := 'Courier New';
st.ValidTextProperties :=st.ValidTextProperties+[rvfiFontName];
st.ParaStyle.Alignment := rvaRight;
st.ValidParaProperties :=st.ValidParaProperties+[rvpiAlignment];
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Your code must work, but I would write:

Code: Select all

FillFields (SRichViewEdit1.RichViewEdit.RVData) / / / body text 
FillFields (SRichViewEdit1.RVHeader.RVData) / / / Header 
FillFields (SRichViewEdit1.RVFooter.RVData) / / / footer 
SRichViewEdit1.Format;
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

this is my code in the event OnPaintPage

Code: Select all

Canvas.Brush.Style := bsClear;
Canvas.Font.Style  := [fsBold]; // negrito
Canvas.Font.Size   := 20; // tamanho fonte 20
Canvas.Font.Name   := 'Arial'; // letra

// Drawing header
H := SRichViewEdit1.TopMargin100Pix;
Text := '{TRASLADO}';

Canvas.FillRect(Rect(PageRect.Left, PageRect.Top, PageRect.Right, PageRect.Top + H));
Canvas.TextOut((PageRect.Left + 600 +PageRect.Right - Canvas.TextWidth(Text)) div 2, PageRect.Top - 30 + H div 2, Text);
and in the function FillFields it is:

Code: Select all

   if FieldName='TRASLADO' then
   begin
       result := '*****';
   end;
but not finding the word TRASLADO to replace.
What do am I doing wrong?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Please send me a sample project (as simple as possible) to richviewgmailcom
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I found another solution, as I include a table at runtime with three columns, in the event OnPaintPage? can you give some example?

thanks
Post Reply