[Urgente]Secure table in the text

General TRichView support forum. Please post your questions here
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

[Urgente]Secure table in the text

Post by Ceprotec »

Need instruction or command or property table fixing it in the text of the Richview fixing the same in a row and column that I want.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

If solutions proposed in http://www.trichview.com/forums/viewtopic.php?t=6050 are not acceptable, please explain why.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Is that really the topic earlier goal was not actually like to leave a static table.
Would have any suggestions?
sorry
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You still did not explain what is "fixing"
Placing it at the specified position on the page, over the text, like this?
Image
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Exactly.
One question, if I type something it will always be in this position, right?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

TRichView itself does not support floating objects at fixed positions, so you need to prepare two documents: a main document and a document with a table.
The main document can be printed using TRVPrint, as usual, a table can be printed using TRVReportHelper component in TRVPrint.OnPagePostpaint event. I'll make an example later today or tomorrow.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

ok, I'll be awaiting after that I'll ask you one more question, because in my application in the header it is not changing the font and font size, only the body of the text.
Thank you. :)
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I adapted one of old demos for printing headers.
Now it prints a table (more exactly, any document prepared in a separate editor) below the text of the main document at the fixed position (X = 1 cm, Y= 5 cm) (actually, for more precise positioning in cm, printer physical margins must be taken into account; if you want, I can explain how to do it)

http://www.trichview.com/support/files/ ... dtable.zip

PS: I found un unexpected behavior - when RVReportHelper is used for drawing on page for the first time, the main form may become active. I'll try to investigate why it happens, but a workaround is simple - initializing TRVReportHelper before showing a preview form, for example in FormCreate:

Code: Select all

rvhHeader.Init(Canvas, 100);
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

ok, another question, I'm putting a text at runtime called 'TRANSFER' in the header, I would like him to stay to the right and Courier New font, how do I do?
thank you
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

How do you put this text in a header?
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I'm putting as follows:

Code: Select all

  Canvas.Brush.Style := bsClear;
  Canvas.Font.Assign(SRichViewEdit1.RichViewEdit.Style.TextStyles[7]);

  // Drawing header
  H := SRichViewEdit1.TopMargin100Pix;
  Text := 'TRASLADO';
  Canvas.FillRect(Rect(294, 20, 1088, 20 + H));

  Canvas.TextOut( (900 + 1088 - Canvas.TextWidth(Text)) div 2, PageRect.Top + H div 2, Text);
on the event onpaintpage.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Hmm. Do you use ScaleRichView?
I thought you use TRVPrint, so my solution with the fixed table is for TRVPrint, not for TSRichViewEdit.

For TSRichViewEdit, you can use a similar method in OnPaintPage event, but WYSIWYG output is not guaranteed.

As for the header. Why do you draw it using events? You can add text to SRichViewEdit1.RVHeader instead.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

yes, I used the following code:

Code: Select all

SRichViewEdit1.RVHeader.InsertText ('TRASLADO');
but was not able to format the letter and put right, so I found this code made ​​earlier quoted, but that is also not working properly, could you tell me how to do?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

It's better to use RVHeader.
Do you use StyleTemplates?
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

yes, I use
Post Reply