New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header not working as expected #884
Comments
Moving the .ShowOnce() after Cell(), everything works as expected. private void ComposeHeader(IContainer container)
{
container.Background(Colors.Grey.Lighten3).Border(1).Column(column =>
{
column.Item().Table(table =>
{
table.ColumnsDefinition(columns =>
{
column.Spacing(10);
columns.RelativeColumn();
columns.RelativeColumn();
});
table.Cell().Row(1).Column(1)
.Component(new HeaderLabelTemplate("Shared", "Valore"));
table.Cell().Row(1).Column(2)
.Component(new HeaderLabelTemplate("Shared", "Valore"));
});
column.Item().Table(table =>
{
table.ColumnsDefinition(columns =>
{
column.Spacing(10);
columns.RelativeColumn();
columns.RelativeColumn();
});
table.Cell().Row(1).Column(1).ShowOnce()
.Component(new HeaderLabelTemplate("Inizio Lotto", "Valore"));
table.Cell().Row(1).Column(2).ShowOnce()
.Component(new HeaderLabelTemplate("Lotto", "Valore"));
table.Cell().Row(2).Column(1).ShowOnce()
.Component(new HeaderLabelTemplate("Fine Lotto", "Valore"));
table.Cell().Row(2).Column(2).ShowOnce()
.Component(new HeaderLabelTemplate("Tipologia", "Valore"));
});
});
} Is this behavior intentional? |
Thank you for finding and reporting this issue 😄 Indeed, this behavior is not correct. I investigated the problem, and I already understand the root cause. I am working on a fix. Do you know that you can simplify your code by replacing tables with a simpler element called .Row(row =>
{
row.RelativeItem().Component(new HeaderLabelTemplate("Shared", "Valore"));
row.RelativeItem().Component(new HeaderLabelTemplate("Shared", "Valore"));
}); |
Thank you so much for the work you do with this library and for the advice on simplifying the code. |
Describe the bug
I'm trying to generate a report with a different header on the first page. The headers on page 1 and page 2 are fine, but from page 3, the header is different from what I expected.
To Reproduce
This is the ComposeHeader method
Expected behavior
I expect to find both tables on the first page and only the first one from page 2 onwards.
Screenshots
Header of page 1
Header of page 2
Headers of subsequent pages
Environment
I'm using version 2024.3.2 of the library and Windows 11 (x64).
The text was updated successfully, but these errors were encountered: