Page 1 of 1

Different between Designer Preview and Rendering via SDK

Posted: Mon Aug 31, 2020 9:55 am
by Ruslan Kadyrbaev
Hi all,

I have a report (attached) with a data source linked to the sample json-resource.
Data source has a master-detail structure (nested array fo childs) same as the json.

In the report childs are grouped by parent relation (parent group key) and each group is showed

If I try to open report in preview-mode - I see grouped result fine

If I try to generate report via SDK by C# code - then parent relations are empty and report shows only one empty group.

Code: Select all

var templateBody = request.TemplateBody;
report.Load(templateBody);
await report.Dictionary.SynchronizeAsync();
await report.RenderAsync(new StiRenderState(false));
What I have done wrong? How to render via C# right?
Why there is the such big different between outputs (same template)?

Re: Different between Designer Preview and Rendering via SDK

Posted: Tue Sep 01, 2020 5:59 am
by Ruslan Kadyrbaev
I've found solution: await report.Dictionary.ConnectAsync();

Code: Select all

            // sync data & render
            await report.Dictionary.ConnectAsync();
            report.Dictionary.SynchronizeBusinessObjects();
            report.Dictionary.SynchronizeRelations();
            await report.Dictionary.SynchronizeAsync();
            await report.RenderAsync(new StiRenderState(false));
Thanks

Re: Different between Designer Preview and Rendering via SDK

Posted: Tue Sep 01, 2020 8:57 am
by Andrew
Hello,

Thank you for sharing your way of solving the issue.