Different between Designer Preview and Rendering via SDK

Stimulsoft Reports.NET discussion
Post Reply
Ruslan Kadyrbaev
Posts: 15
Joined: Mon Aug 31, 2020 9:19 am

Different between Designer Preview and Rendering via SDK

Post 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)?
Attachments
wrong result.png
wrong result.png (58.65 KiB) Viewed 1183 times
expected result.png
expected result.png (66.95 KiB) Viewed 1183 times
wrong result.png
wrong result.png (58.65 KiB) Viewed 1186 times
expected result.png
expected result.png (66.95 KiB) Viewed 1186 times
GroupingBug.mrt
(112.9 KiB) Downloaded 154 times
Ruslan Kadyrbaev
Posts: 15
Joined: Mon Aug 31, 2020 9:19 am

Re: Different between Designer Preview and Rendering via SDK

Post 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
Andrew
Posts: 4107
Joined: Fri Jun 09, 2006 3:58 am

Re: Different between Designer Preview and Rendering via SDK

Post by Andrew »

Hello,

Thank you for sharing your way of solving the issue.
Post Reply