Page 1 of 2
[Urgente]Secure table in the text
Posted: Wed Aug 07, 2013 7:01 pm
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.
Posted: Thu Aug 08, 2013 7:12 am
by Sergey Tkachenko
If solutions proposed in
http://www.trichview.com/forums/viewtopic.php?t=6050 are not acceptable, please explain why.
Posted: Thu Aug 08, 2013 12:23 pm
by Ceprotec
Is that really the topic earlier goal was not actually like to leave a static table.
Would have any suggestions?
sorry
Posted: Fri Aug 09, 2013 7:39 am
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?
Posted: Fri Aug 09, 2013 12:25 pm
by Ceprotec
Exactly.
One question, if I type something it will always be in this position, right?
Posted: Fri Aug 09, 2013 12:56 pm
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.
Posted: Fri Aug 09, 2013 2:38 pm
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.
Posted: Sat Aug 10, 2013 4:45 pm
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:
Posted: Mon Aug 12, 2013 5:13 pm
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
Posted: Tue Aug 13, 2013 9:56 am
by Sergey Tkachenko
How do you put this text in a header?
Posted: Tue Aug 13, 2013 11:14 am
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.
Posted: Tue Aug 13, 2013 11:25 am
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.
Posted: Tue Aug 13, 2013 11:40 am
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?
Posted: Tue Aug 13, 2013 3:04 pm
by Sergey Tkachenko
It's better to use RVHeader.
Do you use StyleTemplates?
Posted: Tue Aug 13, 2013 6:32 pm
by Ceprotec
yes, I use