Add page configuration, extra bands, and fluent API improvements to R…#823
Open
ekondur wants to merge 1 commit intoFastReports:masterfrom
Open
Add page configuration, extra bands, and fluent API improvements to R…#823ekondur wants to merge 1 commit intoFastReports:masterfrom
ekondur wants to merge 1 commit intoFastReports:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New Features
Page layout configuration — new fluent methods on
ReportBuilder<T>:.Landscape()— sets page orientation to landscape (defaults totrue, accepts explicit bool).PaperSize(width, height)— sets paper dimensions in millimeters.Margins(left, top, right, bottom)— sets all four page margins in millimetersNew band types — each accepts a fluent configuration callback with
.Text(),.HorzAlign(),.VertAlign(),.TextColor(),.FillColor(),.Font(),.Height(),.Visible():.PageHeader(...)— renders text at the top of every page; supports FastReport expressions.PageFooter(...)— renders text at the bottom of every page; supports pagination expressions like[Page#]/[TotalPages#].ReportSummary(...)— renders text once after all data rowsReport title
Height()support —ReportTitleBuildernow inherits fromTextBandBuilderBase, making.Height()available to control the title band height. Previously the height was hardcoded to 1 cm and could not be changed through the fluent API.Bug Fixes
Report title alignment was hardcoded —
HorzAlignon the report title text object was always set toHorzAlign.Centerregardless of what.HorzAlign()was called on the builder.VertAlignwas also silently ignored. Both now correctly read from the builder configuration.Data header cells inherited alignment from report title — Data header column cells were reading
VertAlignandHorzAlignfrom_reportTitleinstead of_report. Report-level.HorzAlign()/.VertAlign()now correctly propagates to data header cells.Zero-width text objects in page bands —
PageHeader,PageFooter, andReportSummarytext objects were created withband.Width, which is0on a newly constructed band before FastReport lays it out. This made the bands invisible in exported PDFs while all object properties were set correctly, causing tests to pass but output to be blank. Fixed by computing the usable width from page dimensions:(PaperWidth - LeftMargin - RightMargin) / 10 * Units.Centimeters.Report title text not spanning full page — The title text object was hardcoded to
x=5cm, width=10cm, so.HorzAlign(HorzAlign.Center)centered text within that fixed box rather than the full page. Fixed by spanning the text object across the full usable page width using the same formula as above.New / Refactored Types
Project infrastructure:
FastReport.ReportBuilder.UnitTest.csprojfrom legacy packages.config format (net471) to SDK-style (net48,<PackageReference>)packages.config2025.2.12Employees.pdf)