Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Change DataCompositionSchema for a report

Forum

Search UsersRules
Change DataCompositionSchema for a report
#1
Active user
Points:: 0
Joined:: Sep 2, 2013

Hi;

I'd like to change the DataCompositionSchema template for a Report based on some conditions. (I especially need to change the report query). How can I do it? Can I do it in Report form?

Profile
#2
Guest
Points::
Joined::

Hello, Joanna.
Normally it is better to create several reports or report variants with different queries and use filters and parameters to provide a user additional options.

Profile
#3
Active user
Points:: 0
Joined:: Sep 2, 2013

Yes, but I thought it would be more elegant to have only one report and change the query based on user role rather than create two reports...

Profile
#4
Active user
Points:: 0
Joined:: Sep 2, 2013

I've got this...

In Report object module, I've just put the lines:

Code
If IsInRole("MyRole") Then   
   
ThisObject.DataCompositionSchema = Reports.MyReport.GetTemplate("MainDataCompositionSchema1");
   
Else
   
ThisObject.DataCompositionSchema = Reports.MyReport.GetTemplate("MainDataCompositionSchema");
   
EndIf;

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.