Changing Margin.Right at Runtime does not effect

Stimulsoft Reports.BLAZOR discussion
Post Reply
SCP
Posts: 2
Joined: Wed Jul 15, 2026 1:39 pm

Changing Margin.Right at Runtime does not effect

Post 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" />
...
Lech Kulikowski
Posts: 7819
Joined: Tue Mar 20, 2018 5:34 am

Re: Changing Margin.Right at Runtime does not effect

Post 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.
SCP
Posts: 2
Joined: Wed Jul 15, 2026 1:39 pm

Re: Changing Margin.Right at Runtime does not effect

Post 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.
Lech Kulikowski
Posts: 7819
Joined: Tue Mar 20, 2018 5:34 am

Re: Changing Margin.Right at Runtime does not effect

Post by Lech Kulikowski »

Hello,

Please see the attachment.

Thank you.
Attachments
Recording 2026-07-17 095400.mp4
(5.73 MiB) Downloaded 4 times
Post Reply