Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > The Report, DataSet – Object, Problem with Setting the Right Value of the Filter

Forum

Search UsersRules
The Report, DataSet – Object, Problem with Setting the Right Value of the Filter
#1
Active user
Points:: 1
Joined:: Jul 20, 2011

I filled a ValueTable with data from the external SQL and passed it to the Data Composition Schema DataSet of the Object type, set field names, outputted it into the SpreadsheetDocumentField. The report was generated, cool… But when I tried to make a filter and use the conditional appearance I’ve got a problem:
LeftValue = ID;
ComparisonType = equal;
RightValue lets to choose only fields which are listed in the DataSet and when I’m trying to input a number there an error is displayed: “Value ‘…’ is not found”.

Profile
#2
Active user
Points:: 32
Joined:: Sep 16, 2011

What is with your DataSet fields types? It is possibly happens due to the fact that when you are choosing the right value, the left value type is “Data Composition Field”. Thus it suggests choosing a field. Clear the type of the data and it will let you to choose a type first. But the better solution is to fill field types in the DataSet. In that case when you’re setting a filter the data will be allowed to be chosen.

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

I'd like to renew this question:

How to pass the custom-generated Data to the Object of Data Composition Schema? There's a field in the Data Composition Schema named "object name", but I can't figure out how to pass the object containing Data to this schema.

Profile
#4
Active user
Points:: 32
Joined:: Sep 16, 2011

I made an example for you, see the attached file.
You need to pass external data set to the composition processor. This script is in object module of the report:

Code
Procedure OnComposeResult(ResultDocument, DetailsData, StandardProcessing)
   
   StandardProcessing = False;
   
   ExternalDataSets = New Structure;
   ExternalDataSets.Insert("Data", GetData());
   
   TemplateComposer = New DataCompositionTemplateComposer;
   CompositionTemplate = TemplateComposer.Execute(ThisObject.DataCompositionSchema, 
      ThisObject.SettingsComposer.GetSettings(), DetailsData);
   
   CompositionProcessor = New DataCompositionProcessor;
   CompositionProcessor.Initialize(CompositionTemplate, ExternalDataSets, DetailsData);
   
   ResultDocument.Clear();
   
   OutputProcessor = New DataCompositionResultSpreadsheetDocumentOutputProcessor;
   OutputProcessor.SetDocument(ResultDocument);
   OutputProcessor.Output(CompositionProcessor);
   
EndProcedure

Function GetData()
   
   Data = New ValueTable;
   Data.Columns.Add("ID");
   Data.Columns.Add("Name");
   For I = 1 To 10 Do
      Row = Data.Add();
      Row.ID = I - 1;
      Row.Name = "Name " + I;
   EndDo;
   
   Return Data;
   
EndFunction

And these are settings of data composition schema:

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

Thank you very very much! :)
I'm going to try it right away!

Thank you again :)

Profile
#6
Active user
Points:: 32
Joined:: Sep 16, 2011

You're very welcome.

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.