Amount of leaves and exchange of variable

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

Amount of leaves and exchange of variable

Post by Ceprotec »

Hi Sergey!

I'm having a problem: I need a formula to give me the amount of leaves that will be printed in RichView, since for each sheet I need to have a header variables to add themselves. Example: a person begins to type text in a page, the header will have a variable with the number 10, if that person continue typing and move to the next sheet in the header variable that needs to go to 11 and so forth but retaining the value one for each impression.

I also need to change the formula FillFields GetFieldValueFromDatabase and go for it separately on each sheet in the editor, and also by changing the variable header. example: there are five pages typed, I need him to run through a leaf changing the variables, and then the sheet 2 ... for that variable receives the header on every sheet your new number.
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

There is one difficulty with changing text in such variables. When pages are calculated, and you replace page numbers, they can have different width ('10' is longer than '9'). After such replacement, lines may wrap differently, and page breaks can appear in different places.

Should these page number references be inserted in the main document? If they are in header/footer, headers/footers can be generated at the moment of printing.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I will not change the number of leaves RichView, I just need to know what is the variable that makes this control as you said, because it has only one leaf is a case if you have two leaves is another case I just need to know how many sheets are being used at the time of printing.

There are variables in both the footer / header, especially the header, as in the text / main document. FillFields GetFieldValueFromDatabase the functions are not working for the header, and also necessary that these functions only run analyzing a leaf, I give the command and the other runs on another sheet there. example, there are two variables in the sheet 1 and 3 variables in the sheet 2, I need to replace him initially only two variveis a leaf, stop, then I do some of the commands and then run it only on sheet 2 by switching the 3 variables .. is how to control this??
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I am afraid that I do not completely understand you :(

I assume you use TRichView and print it using TRVPrint.
After RVPrint is formatted for printing (after calling RVPrint.FormatPages), RVPrint.PagesCount returns the count of pages.
Besides, for any location in the document, RVPrint.GetPageNo returns the page index.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

well .. we walk by then.

First I need a function or procedure that replace variables in the text by your data ... For this I use FillFields GetFieldValueFromDatabase right?
The problem is that if I put a variable in the header it is not changed. These functions only affect the variables within the body of the text. How do I change the header too?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Where do you store this header?
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I do not store the header separately ...
is necessary armazaenar the header and footer, as the header is also not leaving the impression ..
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, I do not understand how you implemented header in your application, so cannot say why FillFields does not work for it.
Please give me more details how you implemented header.

You use TRichViewEdit, not ScaleRichView, aren't you?
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I use SRichViewEdit, and I have no formula for the header, use it the way it is loaded. And FillFields function does not change the variables included in the header, and I'm not exactly consiguir not add it in the header. Example: I have the variable "{name}" in normal text it changes the name of the person using FillFields, but is unchanged in the header is "{name} ".
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You should apply this procedure not only to SRichViewEdit1.RichViewEdit, but to SRichViewEdit1.RVHeader and SRichViewEdit1.RVFooter as well.

If you use ScaleRichView, information above about using RVPrint is not applicable. But SRichViewEdit has its own PageCount property and GetPageNo method.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

is: I need to create a variable in the header on each page that gets a new number as is done in page numbering, example of a counter.

example: I have three variveisl inserted in the header: {Book} / {term} / {Sheet}

I at one point of a command for these variables receive values and the bank are: {12} / {15} / {18}. however, the variable {sheet} must have a value to each sheet that has been used in the text editor:

example: they have their second leaves, the first is {12} / {15} / {18}, and the second sheet must be {12} / {15} / {19} .. and so consequently it has 10 leaves the last is {12} / {15} / {28}, but this inside or outside the header too. understand?

Namely, I need a function that works together with the function of the control sheets used in the editor because depending on the amount of pages being used, the following variables are given different values.
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

Has any action that can make the link with the previous page? By Microsoft Word to exist as a page break, and after taking the bond of the previous page, so the header can be modified without changing the other pages. no way to do this in SrichView?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, support of header and footer in ScaleRichView is limited in the current version. Improvements are planned in the next year.

In the current version, header and footer is the same for all pages. If you have fields in RVFooter and RVHeader, values in these fields will be the same in all pages.

The only solution is drawing header and footer yourself. See the demo in Demos\CustomDraw\Header and Footer\
Ceprotec
Posts: 259
Joined: Thu Oct 28, 2010 6:09 pm
Contact:

Post by Ceprotec »

I understand.

But there is a component PageNoVisible, it is not in the footer but it has a value on each sheet (1,2,3 ...). he also has a function to be able to appear on each sheet with their own number, and surely his position is also stated on the sheet right? not there as I use this same code / function to be able to solve my problem by assigning the initial value and pursuing the final value? So I could make it through the exchange of my variable that is different on each sheet. Any idea?
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can define the starting value of these numbers in SRV.PageProperty.PageNoFirst.
Post Reply