Convert a C# DevExpress XtraReport class (Report Designer output) into a PVADE design that opens
and is editable in pvad-designer — replacing the dead-end CANMIGDEVEXP020 "report export requires
manual migration" warning emitted by the code converter
(DevExpressPdfMigration.cs).
- Input: a C#
XtraReportsubclass + designer code (InitializeComponent()configuringXRLabel,XRLine,XRPictureBox,XRShape,XRTable, … viaLocationF/SizeF/Text/Font/ForeColor). - Output: a
DesignExportDto(pages +ElementDto[]) loaded into the visual designer — not a C# code string (this is distinct from the otherCode-Migration-*providers).
V1 shipped. C#-source XtraReports convert end-to-end and open in the designer: band flattening, unit conversion, real page size, repeating page headers/footers, tables, and data bindings. V2 below is the next, unstarted milestone.
- Static-content reports (literal
Text, fixed positions/sizes, fonts, colours). - Input is C# source (Roslyn).
.repxXML input is a V2 item.
- Unit conversion —
ReportUnitdefaultHundredthsOfAnInch(×0.72);Pixels(×0.75, 96 DPI);TenthsOfAMillimeter; defaults to hundredths-of-inch. - Band flattening — accumulate each band's
HeightF(canonical order) to turn band-relativeLocationF.Yinto absolute page coordinates. - Page size — from
PaperKind(A4/A3/A5/Letter/Legal/Tabloid), orPageWidth/PageHeight(report units) whenCustom;Landscapeswaps dimensions; defaults to A4. - Page header/footer →
DesignExportDto.SharedElements(repeat on every page); footer anchored to the page bottom (pageHeight − bottomMargin − footerHeight).
- Isolated project
src/Migrations/Report/PVAD.Migration.Report.Designer.DevExpress(refsPVAD.Core+ Roslyn); returns aDesignExportDto, not a code string. -
XtraReportToDesignConverter.Convert(string)→{ DesignExportDto Design, IReadOnlyList<MigrationDiagnostic> Diagnostics }. - Roslyn pre-scan: locate
: XtraReport; collect control field declarations; readInitializeComponent()assignments into per-control property bags; band membership + table rows/cells from*.Controls/Rows/Cells.Add(Range).
| XtraReport control | PVADE ElementDto.Type |
Status |
|---|---|---|
XRLabel / XRPageInfo |
text (+ font/colour/align style) |
[x] |
XRLine |
line |
[x] |
XRShape / XRPanel |
rect |
[x] |
XRPictureBox |
image (placeholder, CANMIGDEVREP013) |
[x] |
XRTable/XRTableRow/XRTableCell |
table (CellData from cell .Text) |
[x] |
XRBarCode |
barcode |
[x] |
XRRichText |
richtext |
[x] |
Data binding (ExpressionBindings/DataBindings) |
binding for [Field], expression otherwise |
[x] |
- Backend
POST /api/migration/report-to-design→{ design, diagnostics }(MigrationController.cs). - Frontend "DevExpress Reports" entry + Open in Designer (loads via
bulkReplaceContent, navigates to the editor) (MigrationsPage.tsx).
- Band-flattened + unit-converted coordinates; label style mapping; line/rect/image.
-
ReportUnit = Pixelsscaling; PaperKind/Custom/Landscape page sizes. - XRTable rows/cells; single-field binding + complex expression; page header/footer → shared.
- Unsupported control →
CANMIGDEVREP011. - End-to-end: a converted report (C# and
.repx) renders to a valid PDF through the real export pipeline (DesignJsonMapper→ToBytes) — inPVAD.Export.Tests.
| ID | Severity | Meaning |
|---|---|---|
CANMIGDEVREP001 |
Info | XtraReport + bands detected (N bands, M controls) |
CANMIGDEVREP002 |
Info | Per-control mapping (name (XRType) → PVADE type) |
CANMIGDEVREP010 |
Info / Warning | Text binding mapped — [X] → binding (Info); complex expression → expression (Warning) |
CANMIGDEVREP011 |
Warning | Unsupported control skipped |
CANMIGDEVREP012 |
Warning | Sub-report placeholder inserted, or report scripts/event handlers require manual migration |
CANMIGDEVREP013 |
Warning | Picture data not embeddable — placeholder inserted |
CANMIGDEVREP014 |
Warning | DetailReportBand / sub-detail layout flattened; data-repeat semantics require PVADE template wiring |
CANMIGDEVREP015 |
Warning | GroupHeaderBand / GroupFooterBand layout flattened; group/sort repeat semantics require PVADE template wiring |
CANMIGDEVREP016 |
Warning | CanGrow / CanShrink imported as PVADE text wrapping/overflow hints; dynamic band reflow requires review |
CANMIGDEVREP017 |
Warning | DevExpress anchoring imported as metadata; responsive positioning requires review |
CANMIGDEVREP018 |
Warning | XRChart imported as editable PVADE chart placeholder; XRGauge/XRPivotGrid imported as positioned placeholders |
CANMIGDEVREP019 |
Warning | XRShape arrow imported as PVADE arrow; direction/head style requires visual review |
CANMIGDEVREP020 |
Warning | DevExpress Visible expression preserved as PVADE visibleExpression; simple BookingReceipt-style cases are evaluated during PDF export |
CANMIGDEVREP021 |
Warning | C# designer image resource key preserved; .resx/resource payload is needed for automatic image embedding |
CANMIGDEVREP022 |
Warning | DevExpress MultiColumn band mode detected; repeated column flow requires manual review |
CANMIGDEVREP023 |
Warning | DevExpress TextFitMode / TextTrimming imported as metadata; text shrink/trimming requires manual review |
Pick from these, roughly in value order:
Current recommendation: make DevExpress the first fidelity pass because it is a core customer path and the gaps show up immediately in real designer files. Prioritize group/repeat semantics, once-at-end report footers, auto-sizing/anchoring, sub-detail bands, non-text bindings, and high-use visual controls before lower-value table styling.
- Parse the serialized DevExpress report XML (
.repx) — shares the band-flatten / unit / page-size / mapping / binding core via a neutralRawReportmodel.ConvertAutodetects XML vs C#; thereport-to-designendpoint accepts either. Covers page size, bands, label/line/shape/table controls, fonts/colours, alignment, expression bindings, and page header/footer → shared elements.
-
XRPictureBoxembedded image (.repxbase64ImageSource/Image→ PVADE imageContentdata URL), replacing theCANMIGDEVREP013placeholder when image data is present. - C#
XRPictureBox.ImageSource = new ImageSource("img", resources.GetString("..."))preserves the resource key asstyle.devExpressImageResourceKeyand emitsCANMIGDEVREP021when the.resxpayload is not available. - Optional
resourcespayload onPOST /api/migration/report-to-designresolvesresources.GetString(...)for C# designer image payloads and expression bindings, so.resximage base64 and binding strings can be embedded/mapped automatically. - Direct
.resxworkflow:POST /api/migration/report-to-designaccepts optionalresourceXml, parses<data name="..."><value>...</value></data>entries, and the Designer Migration UI can load a matching.resxfile while still allowing JSON overrides. -
XRCheckBox→checkmarkwithCheckState(fromCheckBoxState/Checked). -
XRShapeellipse →circle, line →line, otherwiserect. - Label
BackColor→ textbackgroundColor; fontUnderline/Strikeout→textDecoration. -
XRControlStyle/StyleName→ inherited PVADE font/colour/border/padding style hints. -
TextFitMode/TextTrimming→style.devExpressTextFitMode/style.devExpressTextTrimmingwithCANMIGDEVREP023. - Table column alignments from the header-row cell
TextAlignment→ColumnAlignments. - Per-cell font/colour table styling —
XRTableCellBackColor/ForeColor/TextAlignment/Font/Bordersare extracted into sparse PVADECellStyles(uniform + per-side borders) and rendered by the canvas/preview and all exporters. - Standard expressions are executable in the designer/preview: non-trivial bindings emit a
translated PVAD-grammar
ExpressionviaExpressionTranslator.TranslateDevExpress(raw kept onstyle.devExpressExpression). See Migration_RDL+DevExpress.md. Custom functions / aggregates remain out of scope. - P0 More controls:
XRChart→ editable PVADEchart;XRGauge/XRPivotGrid→ positioned placeholders withCANMIGDEVREP018diagnostics instead of layout holes. -
XRLine/XRShapeLineWidth→strokeWidth/borderWidth;XRLineLineStyle→dashStyle. - P1
XRShapearrow kinds; per-side.Bordersselection.
- [~]
Translate DevExpress expression syntax to the PVADE expression DSL.Not worth doing — PVADE'sExpressionEvaluator(src/Core/PVAD.Core/Primitives/ExpressionEvaluator.cs) is a stub (bare-identifier substitution +==/!=only; no arithmetic/functions), so there's no richer target to translate into. Single-field[X]→binding(done); other expressions are preserved verbatim onexpressionwith a warning. - Detect sub-reports (
XRSubreport) and insert positioned placeholders; report scripts/event handlers →CANMIGDEVREP012. - P0 Grouping/sorting bands (
GroupHeaderBand/GroupFooterBand) — group/footer layout is imported and stacked in band order; C#GroupFields/SortFieldsand.repx<GroupFields>/<SortFields>are captured inCANMIGDEVREP015diagnostics. Repeat semantics: each group-band control now carries PVADERepeatDto(data path from the first group field) plusstyle.devExpressGroup(name/role/band/fields/sorts), mirroring the RDL/Jasper group-repeat mapping, so the band can be wired as a repeating template. Runtime data-binding still needs PVADE template wiring. - P0
AnchorVertical/AnchorHorizontalandCanGrow/CanShrinkauto-sizing: imported as PVADE style hints (whiteSpace,overflow,verticalAlign) plus DevExpress metadata, withCANMIGDEVREP016/017diagnostics for dynamic reflow/anchoring review. - P0
ReportFooterBandonce-at-end semantics: report-footer elements are imported asPageScope = "last"so export renders them only on the final page while single-page designs still show them.
- Emit
CANMIGDEVREP002per mapped control (traceability beyond the001summary). - Nested controls inside an
XRPanelare flattened to absolute positions (container chain walked up to the owning band, accumulating panel offsets) — both C# and.repx. - P0 Map non-text data bindings instead of the generic warning:
XRBarCodetext/value bindings now updateBarcodeValue, andXRPictureBoximage bindings now update imageContent. - P0 Preserve
Visibleexpression bindings asvisibleExpressionmetadata withCANMIGDEVREP020diagnostics; PDF export evaluates simple cases such asLen([X]) > 0,[A].[B] == 'Value',[Collection].Count > 0, andIIF(condition, True, False). - P0 Multi-
DetailReportBand(sub-detail) handling: nested child bands are parsed from C#detailReport.Bands.AddRange(...)and.repxnested<Bands>, flattened below their parentDetailReportBand, withCANMIGDEVREP014warning for repeat semantics. - P1
MultiColumn.Modedetection on bands withCANMIGDEVREP022diagnostic.
- Use
PVAD.Migration.Report.Designer.DevExpress, separate fromPVAD.Migration.Pdf.Code.DevExpress. - Output target is PVADE design JSON (designer), not PVAD.Pdf C# code.
- Default page size A4 when the report declares none.