GrowToHeight not repositioning other text fields

Stimulsoft Reports.NET discussion
Post Reply
JoshS
Posts: 9
Joined: Thu Aug 11, 2022 4:38 am

GrowToHeight not repositioning other text fields

Post by JoshS »

I am trying to solve a problem with GrowToHeight. I have a number of text fields running top to bottom. One of these can have a long value.

In the preview everything below gets pushed down, which is what I expect:
Image

However, when I run this export via C# render to PDF it doesn't work correctly:
Image

When I tried this on my actual report, even worse than this, it just overlaps the fields:
Image

I have attached a repro case. This is using Stimulsoft.Reports.Engine.NetCore 2022.3.5.
Attachments
ResizeRepro.zip
(113.21 KiB) Downloaded 22 times
Kirill Klimenkov
Posts: 18
Joined: Tue Mar 23, 2021 6:21 am

Re: GrowToHeight not repositioning other text fields

Post by Kirill Klimenkov »

Hello.

We have reproduced the issue and need some time to make an improvement.
We will let you know when we get any results.
For now you can use the next code to switch graphics engine:

Code: Select all

Stimulsoft.Drawing.Graphics.GraphicsEngine = Stimulsoft.Drawing.GraphicsEngine.Gdi;
Thank you.
#7975
JoshS
Posts: 9
Joined: Thu Aug 11, 2022 4:38 am

Re: GrowToHeight not repositioning other text fields

Post by JoshS »

Thanks Kirill.

Am I right in thinking that Gdi engine is only supported on Windows hosted services and will not work under Linux containers for example?
Kirill Klimenkov
Posts: 18
Joined: Tue Mar 23, 2021 6:21 am

Re: GrowToHeight not repositioning other text fields

Post by Kirill Klimenkov »

Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.
JoshS
Posts: 9
Joined: Thu Aug 11, 2022 4:38 am

Re: GrowToHeight not repositioning other text fields

Post by JoshS »

Kirill Klimenkov wrote: Thu Sep 08, 2022 8:12 am Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.
Thanks Kirill.

I've tried it with libgdiplus under Linux and I can render the report however it's not picking up my TTF files now.

Code: Select all

var fontBytesBold = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscBold.ttf"); ;
var fontBytesRegular = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscRegular.ttf");

StiFontCollection.AddFontBytes(fontBytesBold, "Noto Sans CJK SC Black", System.Drawing.FontStyle.Bold);
StiFontCollection.AddFontBytes(fontBytesRegular, "Noto Sans CJK SC Medium", System.Drawing.FontStyle.Regular);
There's no errors, the fonts are being loaded fine, but they are not being used in the rendered PDF. This works on Windows fine, and also works fine on Linux in the default ImageSharp renderer too.

Does the GDI renderer only support OTF fonts? I tried OTF and that seemed to work, but the file size was much larger (3MB vs. ~400KB for TTF).
JoshS
Posts: 9
Joined: Thu Aug 11, 2022 4:38 am

Re: GrowToHeight not repositioning other text fields

Post by JoshS »

Kirill Klimenkov wrote: Thu Sep 08, 2022 8:12 am Hello.

It will work on .NET 5.0 with libgdiplus library. For .NET 6.0 it should work with the same library but there may be some issues.
https://www.stimulsoft.com/en/blog/arti ... ting-tools

Thank you.
Thanks Kirill.

I've tried it with libgdiplus under Linux and I can render the report however it's not picking up my TTF files now.

Code: Select all

var fontBytesBold = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscBold.ttf"); ;
var fontBytesRegular = await File.ReadAllBytesAsync($"{Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory)}/Reports/ClientInvoice/NotoSansCJKscRegular.ttf");

StiFontCollection.AddFontBytes(fontBytesBold, "Noto Sans CJK SC Black", System.Drawing.FontStyle.Bold);
StiFontCollection.AddFontBytes(fontBytesRegular, "Noto Sans CJK SC Medium", System.Drawing.FontStyle.Regular);
There's no errors, the fonts are being loaded fine, but they are not being used in the rendered PDF. This code works on Windows fine, and also works fine on Linux in the default ImageSharp renderer too.

Does the GDI renderer only support OTF fonts? I tried OTF and that seemed to work, but the file size was much larger (3MB vs. ~400KB for TTF).
Kirill Klimenkov
Posts: 18
Joined: Tue Mar 23, 2021 6:21 am

Re: GrowToHeight not repositioning other text fields

Post by Kirill Klimenkov »

Hello.

Please check the Embedded Fonts property is enabled.

Thank you.
Attachments
fonts.png
fonts.png (27.23 KiB) Viewed 256 times
JoshS
Posts: 9
Joined: Thu Aug 11, 2022 4:38 am

Re: GrowToHeight not repositioning other text fields

Post by JoshS »

Kirill Klimenkov wrote: Wed Sep 07, 2022 9:32 am Hello.

We have reproduced the issue and need some time to make an improvement.
We will let you know when we get any results.
For now you can use the next code to switch graphics engine:

Code: Select all

Stimulsoft.Drawing.Graphics.GraphicsEngine = Stimulsoft.Drawing.GraphicsEngine.Gdi;
Thank you.
#7975
Hi Kirill, is there any update on this issue?
Kirill Klimenkov
Posts: 18
Joined: Tue Mar 23, 2021 6:21 am

Re: GrowToHeight not repositioning other text fields

Post by Kirill Klimenkov »

Hello.​​

We are still working on the issue.
We will let you know when we get any result.

Thank you.
Post Reply