Page 1 of 1
PDF Export for Report with Group
Posted: Tue Apr 03, 2018 3:14 pm
by tpontow
Hello Stimulsoft-Team,
when exporting a report to PDF which has a Group the small + /- Icons / images are not exported. There is a space instead.
Is it possible to
1. Show the small Icon / image in the PDF file or
2 at least get rid of the white space in the PDF where the + / - Images uesd to be?
Thanks and Kind regards
Thorsten Pontow
Re: PDF Export for Report with Group
Posted: Thu Apr 05, 2018 7:15 pm
by Lech Kulikowski
Hello,
> 1. Show the small Icon / image in the PDF file or
We do not see the point, because this feature in pdf is impossible to implement, and that icon will only occur extra questions from the user.
> 2 at least get rid of the white space in the PDF where the + / - Images uesd to be?
We do not create an empty place, but you yourself are the design of the report.
as an option - change the report in the event before export (move the necessary components to the left).
Thank you.
Re: PDF Export for Report with Group
Posted: Wed Apr 11, 2018 1:50 pm
by tpontow
Thanks Lech,
that helped me to solve my Problem!
I overwrote OnExporting() and OnExported() i my own StiReport-Subclass as follows:
Code: Select all
protected override void OnExporting(StiExportEventArgs e)
{
m_marginAdjustedComponents = new List<string>();
foreach (StiPage renderedPage in RenderedPages)
{
foreach (StiComponent renderedPageComponent in renderedPage.Components)
{
if (renderedPageComponent is StiText textComponent && textComponent.Name.EndsWith("groupHeaderBandText"))
{
textComponent.Margins.Left = 1;
m_marginAdjustedComponents.Add(textComponent.Name);
}
}
}
base.OnExporting(e);
}
protected override void OnExported(StiExportEventArgs e)
{
base.OnExported(e);
foreach (StiPage renderedPage in RenderedPages)
{
foreach (StiComponent renderedPageComponent in renderedPage.Components)
{
if (renderedPageComponent is StiText textComponent && m_marginAdjustedComponents.Contains(textComponent.Name))
{
textComponent.Margins.Left = 12;
m_marginAdjustedComponents.Remove(textComponent.Name);
}
}
}
}
Greetings
Thorsten
Re: PDF Export for Report with Group
Posted: Thu Apr 12, 2018 2:27 am
by Edward
Hi Thorsten,
Amazing, it really is. Easy and efficient solution. Thank you for sharing your approach and the code snippet with the community, it will definitely help someone.
Kind Regards,
Edward