Eyup Yilmaz
May 30, 2023 12:06 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
When I generate reports, shows group level all open. How get results in group level 1 when I generate the report?
Aleksandr Biryukov
Jun 01, 2023 08:45 PM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Hello Eyup, specify me please - do you make a report using "Data composition system"?
Eyup Yilmaz
Jun 02, 2023 04:25 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
Aleksandr Biryukov
Jun 05, 2023 06:43 PM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Hi Eyup, you should take the following steps: 1. open the report program module (screenshot 1) 2. and enter the following code there:
Code Procedure OnComposeResult(ResultDocument, DetailsData, StandardProcessing)
StandardProcessing = False;
TemplateComposer = New DataCompositionTemplateComposer;
Template = TemplateComposer.Execute(DataCompositionSchema, SettingsComposer.Settings, DetailsData);
CompositionProcessor = New DataCompositionProcessor;
CompositionProcessor.Initialize(Template, , DetailsData);
OutputProcessor = New DataCompositionResultSpreadsheetDocumentOutputProcessor;
OutputProcessor.SetDocument(ResultDocument);
OutputProcessor.Output(CompositionProcessor);
ResultDocument.ShowRowGroupLevel(1);
ResultDocument.ShowRowGroupLevel(0);
EndProcedure
Pay attention to the last lines - we can group the report levels we need.
Eyup Yilmaz
Jun 05, 2023 11:38 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
It is worked for just one table. I have nested reports. Here is the result;
Aleksandr Biryukov
Jun 06, 2023 09:04 AM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Attach your report here please
Eyup Yilmaz
Jun 06, 2023 04:27 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
Aleksandr Biryukov
Jun 06, 2023 06:08 PM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Hm... even when using nested reports, the code above collapses groupings... What platform version are you using?
Eyup Yilmaz
Jun 06, 2023 06:47 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
Aleksandr Biryukov
Jun 09, 2023 10:32 AM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Hello Eyup, I checked on platform 8.3.23 - nested reports are collapsed. Maybe can you give me a dump from your program, or something like that, so that I can see your code at work?
Eyup Yilmaz
Jun 09, 2023 09:17 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
Hi Mr. Biryukov, the dump is more than 200 Mb. Is it possible to send it with mail? I tried to understand what is happening and I realize that first nested schema is working and others cannot executed. I delete first nested schema and same result others can not work with this code. There are 3 nested schema and two of them can not execute with "TemplateComposer.Execute()".
Eyup Yilmaz
Jun 09, 2023 09:31 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
I found the problem, that two nested schemas have date parameters. If I gave it behind user interface it is working. So how can I make it work with user period choice?
Eyup Yilmaz
Jun 09, 2023 10:15 PM
Active user
Rating:
4
Joined: Mar 6, 2018
Company: Bodega LLC
Sir thank you for your kindly helps, I found the way, now it is working. Here is I add the code;
Code
StandardProcessing = False;
TemplateComposer = New DataCompositionTemplateComposer;
DataCompositionSchema.NestedDataCompositionSchemas.Get(1).Schema.Parameters.Bas.Value = ThisObject.SettingsComposer.UserSettings.Items[0].Value.StartDate;
DataCompositionSchema.NestedDataCompositionSchemas.Get(1).Schema.Parameters.Bit.Value = ThisObject.SettingsComposer.UserSettings.Items[0].Value.EndDate;
DataCompositionSchema.NestedDataCompositionSchemas.Get(2).Schema.Parameters.Bas.Value = ThisObject.SettingsComposer.UserSettings.Items[1].Value.StartDate;
DataCompositionSchema.NestedDataCompositionSchemas.Get(2).Schema.Parameters.Bit.Value = ThisObject.SettingsComposer.UserSettings.Items[1].Value.EndDate;
Template = TemplateComposer.Execute(DataCompositionSchema, SettingsComposer.Settings, DetailsData);
CompositionProcessor = New DataCompositionProcessor;
CompositionProcessor.Initialize(Template, , DetailsData);
OutputProcessor = New DataCompositionResultSpreadsheetDocumentOutputProcessor;
OutputProcessor.SetDocument(ResultDocument);
OutputProcessor.Output(CompositionProcessor);
ResultDocument.ShowRowGroupLevel(5);
ResultDocument.ShowRowGroupLevel(4);
ResultDocument.ShowRowGroupLevel(3);
ResultDocument.ShowRowGroupLevel(2);
ResultDocument.ShowRowGroupLevel(1);
ResultDocument.ShowRowGroupLevel(0);
Aleksandr Biryukov
Jun 12, 2023 03:57 PM
Administrator
Rating:
27
Joined: Oct 3, 2019
Company:
Hello Eyup, I'm glad you figured out the problem! And other developers will now be able to use your experience too!
Subscribe