Drilldown in reports

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Is it possible to implement drilldown in spreadsheet template based reports?

 
#2
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Hello Peter,

of course, there is such a possibility.

There are two ways: the standard one, when a certain value is opened from the report, for example, a product card, and the second method allows our to call our procedure when we double-click on the report.

For the first method, we need to specify the "DetailsPatameter" for the desired cell (pic.1).

The code may look like this (pic.2). Note that the "SpreadsheetDocument" must be in Read-Only mode!

The result looks like this: we generate a report and double-click on the cell. After that, the product card opens (pics 3 - 4).

The second method is more complicated, but also more interesting. I will describe it a little later.

Download Pic_2.png (10.71 KB)
Download Pic_4.png (10.93 KB)
 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Can I assign to DetailsParameter some procedure or function name I want to invoke on double click?

 
#4
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

Yes, you can. This is the second way.

I will try to make an example today or at least tomorrow.

 
#5
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

So, if we want to call the procedure with a double click, we need to do the following:

Firstly, it is necessary to display the "SpreadsheetDocument" on the form, and not show it separately (pic.1).

Similarly to the first example, we set the details parameter (pic.2)

But unlike the first example, we pass the Structure as a detail! Moreover, it can be a very complex structure in which you can put any data you need (pic. 3)

And most importantly, we have an event that allows us to process this structure with a double mouse click (pic.4)

For example, like this (pic.5)

But here everything depends on your imagination.

Download Pic_1.png (37.09 KB)
Download Pic_2.png (23.63 KB)
Download Pic_3.png (24.71 KB)
Download Pic_4.png (48.53 KB)
Download Pic_5.png (28.78 KB)
 
#6
People who like this:0Yes/0No
Administrator
Rating: 24
Joined: Oct 3, 2019
Company:

and I have attached the source code for your convenience.

 
#7
People who like this:0Yes/0No
Active user
Rating: 8
Joined: May 21, 2023
Company:

Thanks, Alex!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.