The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 2, 2013
Company:

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?

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

Joined:
Company:

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.

 
#3
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 2, 2013
Company:

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...

 
#4
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 2, 2013
Company:

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;

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