Hi,
I'd like to know if there is some way to insert *a lot* of text in a report, some two pages from MS Word. I mean, this special report has to be a standard contract and I have managed to insert all the clauses using labels, but it should exist a better solution, I guess--?
-- dulaman
"I don't want to believe. I want to know." (Carl Sagan)
0
Comments
So probably there is not a better solution. Exept putting all in a table and printing the table.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I think the 1024 chars limit is not enough even for the first clause!
This contract is longer than the Marx Brothers one !
"I don't want to believe. I want to know." (Carl Sagan)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I'll have to find out how could I connect my doc to Navision. Gonna snoop around the forum as I've never done such a thing.
"I don't want to believe. I want to know." (Carl Sagan)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
If you want to use a bigtext variable and to cut it in pieces to show it as lines on a report you can do this for instance:
Define a function FindSplitPosition like this:
FindSplitPosition(TextToSplit : Text[200]) CharPosition : Integer
CharPosition := 0;
MyCounter := STRLEN(TextToSplit);
REPEAT
IF COPYSTR(TextToSplit,MyCounter,1) IN THEN
CharPosition := MyCounter;
MyCounter := MyCounter - 1;
UNTIL (MyCounter = 0) OR (CharPosition > 0);
IF CharPosition = 0 THEN
CharPosition := STRLEN(TextToSplit);
This function will look in TextToSplit if there is a space, point or a comma beginning from the end of the sentence. You can use the function on your report like this :
If you have a variable to split called MyBigTxt, you want to split it in sentences and print it in the section of the report with TextToPrint for instance.
If you have a DataItem which is an integer for instance, put this code in the OnPreDataItem trigger:
Pos := 1;
Put next code in the OnAfterGetRecord trigger of the dataitem:
IF MyBigTxt.LENGTH <= 0 THEN
CurrReport.BREAK;
TextToPrint := '';
IF (MyBigTxt.LENGTH > Pos) THEN BEGIN
IF (MyBigTxt.LENGTH - Pos >= MAXSTRLEN(TextToPrint)) THEN
BEGIN
MyBigTxt.GETSUBTEXT(TextToPrint,Pos,MAXSTRLEN(TextToPrint));
Pos2 := FindSplitPosition(TextToPrint);
TextToPrint := COPYSTR(TextToPrint,1,Pos2);
Pos := Pos + Pos2;
END
ELSE
BEGIN
MyBigTxt.GETSUBTEXT(TextToPrint,Pos,MyBigTxt.LENGTH);
CLEAR(MyBigText);
END;
END ELSE
CurrReport.BREAK;
Put the control with TextToPrint on your section and you will be able to cut a BigText variable in sentences without cutting the words in the middle. I hope this help you.
Regards,
Giovanni