The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Oct 11, 2012
Company: 1C Romania

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.

 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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.

 
#3
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Oct 11, 2012
Company: 1C Romania

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?

 
#4
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

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

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

 
#5
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Oct 11, 2012
Company: 1C Romania

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.

Download s1.png (27.22 KB)
 
#6
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Oct 11, 2012
Company: 1C Romania

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.

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