The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Jul 20, 2011
Company:

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

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

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.

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

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.

 
#4
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 16, 2011
Company: individual

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:

Download 1Cv8.cf (7.27 KB)
Edited: Samuel Harris - Feb 28, 2014 12:58 AM
 
#5
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 2, 2013
Company:

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

Thank you again :)

 
#6
People who like this: 0 Yes / 0 No
Active user
Rating: 3
Joined: Sep 16, 2011
Company: individual

You're very welcome.

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