I have a Report. report works on DCS. In that schema as usually some fileds are restrcited completely (as attibute and as field). So in default this fields do not viewed or not available completely in filter, grouping etc.
But, I want to manage this proccess by script. According to users works, I have to manage this proccess. For example, sometimes A1 field must be restricted, sometimes not.
Procedure ManageRestriction(Report,Restrict,FieldName,FieldDescription,FieldValueType) Export Schema = GetFromTempStorage(Report.SchemaID); SchemaFields = Schema.DataSets.DataSet1.Fields; EkSütun_S = SchemaFields.Find(FieldName); If TypeOf(EkSütun_S) = Type("DataCompositionSchemaDataSetField") Then EkSütun_S.AttributeUseRestriction.Condition = Restrict; EkSütun_S.AttributeUseRestriction.Field = Restrict; EkSütun_S.AttributeUseRestriction.Group = Restrict; EkSütun_S.AttributeUseRestriction.Order = Restrict; EkSütun_S.UseRestriction.Condition = Restrict; EkSütun_S.UseRestriction.Field = Restrict; EkSütun_S.UseRestriction.Group = Restrict; EkSütun_S.UseRestriction.Order = Restrict; EkSütun_S.Title = FieldDescription; EkSütun_S.ValueType = FieldValueType; EndIf; Report.SettingsComposer.Initialize(New DataCompositionAvailableSettingsSource(Schema)); Report.SettingsComposer.Refresh(DataCompositionSettingsRefreshMethod.Full); PutToTempStorage(Schema,Report.SchemaID); EndProcedure
I thought that it would work, but not. Or initializing of settings composer is not enough?