Bigtext in a report

dulaman
Member Posts: 73
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--?
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)
"I don't want to believe. I want to know." (Carl Sagan)
0
Comments
-
Well, you can make a textbox multiple line (see the property) but it is limited to 1024 characters. The variable type "BigText" cannot be used in visual components (SourceExpression, in message, confirm, error,...)
So probably there is not a better solution. Exept putting all in a table and printing the table.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Thanks kriki. I was afraid to know that -- but i didn't want to admit.
I think the 1024 chars limit is not enough even for the first clause!
This contract is longer than the Marx Brothers one !-- dulaman
"I don't want to believe. I want to know." (Carl Sagan)0 -
And you will have problem with word wrapping... Better is to connect the word doc. to Navision data and print it from word. You can use same functionality like in CRM module when creating letter...0
-
Yep, kine. That's my actual problem: wrapping. Helvetica fonts (and Arial, too) don't seem to understand that they should follow my wishes!
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.-- dulaman
"I don't want to believe. I want to know." (Carl Sagan)0 -
There exist some example, how to connect Word to Navision through C/AL code... check the download section or How to section...0
-
Hi,
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,
Giovanni0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions