Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > How to add text area from the template when it is not entirely inside one spreadsheet area?

Forum

Search UsersRules
How to add text area from the template when it is not entirely inside one spreadsheet area?
#1
Interested
Points:: 15
Joined:: Oct 27, 2011

I have some template, and there are some totals (which are mostly occupy the area to the right. So there are enough free space to the left. My client wants to put some notification there and it is seems reasonable to add a text area with the desired text inside. The problem that this area would not show until it completely inside spreadsheet area. How could I add this area to resulting document (without defining all the parameters inside the code, I know that this is possible, but what if another client wants a little different text.

Also please do not suggest to split it in 2 columns and show it separately. I have tried this technique and there are a lot of problems when column heights do not match.

The desired template:

Profile
#2
Guest
Points::
Joined::

Hello, Alexey!

And what if you after the spreadsheet document is generated, programmatically join several cells (depending on the number of rows in your document) and put that text inside that joined cell?

Code
Area = Spreadsheet.Area(2,2,3,3);
Area.Merge();
Area.Text = Constants.UserDefinedFormMessage.Get();

Profile
#3
Interested
Points:: 15
Joined:: Oct 27, 2011

It will be no user editable. Now I have all templates open to changes, so user can add or modify something. With this approach it will be hard-coded.
There is no way to display it just if there is only left corner inside the area?

Profile
#4
Active user
Points:: 0
Joined:: Apr 18, 2012

Hi Alexei.

You can programmatically display text box. In this case the text box always displays regardless of the spreadsheet's size.

Code
TextBox = Spreadsheet.Drawings.Add(SpreadsheetDocumentDrawingType.Text);
TextBox.Text = 
"This
|is
|multiline
|text.";
TextBox.Place(Spreadsheet.Area(Spreadsheet.TableHeight + 1, 1));
TextBox.Top = TextBox.Top + 2;
TextBox.Left = TextBox.Left + 2;
TextBox.Height = 20;
TextBox.Width = 100;

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.