Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Column selection in spreadsheet row format region

Forum

Search UsersRules
Column selection in spreadsheet row format region
#1
Just came
Points:: 0
Joined:: Oct 11, 2012

I need to select one column to establish if it is visible or not (must be column type selection). I need to do that in a specific row format region, that is, a group of rows that has different column widths than those above or below. I can do this in designer, but how do I do it from code? Thanks.

Profile
#2
Guest
Points::
Joined::

Hello, Gelu.
I'm not sure what you mean. Could you please provide a screenshot: how you want to select cells in spreadsheet document?
To make a selection from the script please use Area() method of SpreadsheetDocument object.

Profile
#3
Just came
Points:: 0
Joined:: Oct 11, 2012

Here is a better illustration of what I do in designer and I need to do from code. The template is generated with wizard. I place cursor in line 10 or 11 and click header of column 4. The result is a colum selection from the row formatting region consisting of rows 10-11, that corresponds to the table header and table line and is not the same as any named area. I certainly can sel ect that column as a rectangular area from code, but I need it to be a column selection so I can set or test the visibility of that column.
I know I can create such formatting regions with SpreadsheetDocumentRange.CreateFormatOfRows(), but how do I select columns from them?

Profile
#4
Guest
Points::
Joined::

To change settings of entire the column use the following script:

Code
SpreadsheetDocument.Area("C1").BackColor = StyleColors.SpecialTextColor;

Profile
#5
Just came
Points:: 0
Joined:: Oct 11, 2012

Sigh... I am so misunderstood... OK, new picture, and simple question:

how do I distinghish fr om code between "C1" and "the other C1"?

The image shows how a different "C1" is selected in designer depending on the row format area wh ere the current cell is. "R4-R7" is one such area (wider columns), "R1 to R3 + R8 to end" is the other (default). Both selections appear as "C1" in designer.

Profile
#6
Just came
Points:: 0
Joined:: Oct 11, 2012

I got it, I got it.

It is documented in the explanation for the 3rd parameter of the SpreadsheetDocument.Area() function, version with 4 number arguments.
A call like:

Code
selection = SpreadsheetDocument.Area( , c1, r2, c2);


selects the columns c1 to c2 (because first row is missing) from the formatting region that contains r2. That russian enghish was not very helpful though. I probably wouldn't understand what it means if I didn't know in advance what I was looking for.

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.