Page 1 of 1

Changing Margin.Right at Runtime does not effect

Posted: Wed Jul 15, 2026 1:43 pm
by SCP
Hi,
changing the right margin in code does not effect the viewer, if i change the left margin the viewer is updatet.
(Blazor Serverside)
...
var _WorkReport = Report.Clone() as StiReport;

foreach (StiPage page in _WorkReport.Pages)
{
page.Page.Margins.Top = repsettings.PageSettings.MarginTop ?? page.Page.Margins.Top;
page.Page.Margins.Left = repsettings.PageSettings.MarginLeft ?? page.Page.Margins.Left;
page.Page.Margins.Right = repsettings.PageSettings.MarginRight ?? page.Page.Margins.Right; <-- New Value here is the problem, has no effect
page.Page.Margins.Bottom = repsettings.PageSettings.MarginBottom ?? page.Page.Margins.Bottom;
}
Report = _WorkReport;
Report.Render(true);
...
<StiBlazorViewer Height="100%"
@key="_viewerKey"
ID="WebViewer1"
@ref=viewerComponent
Report="@Report"
OnViewerEvent="@OnViewerEvent"
OnViewerBeforeRender="@OnBeforeRenderViewer"
Options="@Options" />
...

Re: Changing Margin.Right at Runtime does not effect

Posted: Wed Jul 15, 2026 10:18 pm
by Lech Kulikowski
Hello,

This is correct behavior. When the left margin is changed, the components automatically snap to it; when the right margin is changed, empty space is simply created - in this case, the components should have DockStyle=Right set.

Thank you.

Re: Changing Margin.Right at Runtime does not effect

Posted: Thu Jul 16, 2026 5:49 am
by SCP
Thanks for your reply, but if i set the margin right in the designer the behaviour is different.
The margin is set like the left.

Re: Changing Margin.Right at Runtime does not effect

Posted: Fri Jul 17, 2026 7:55 am
by Lech Kulikowski
Hello,

Please see the attachment.

Thank you.