Tag Archive: rdlc


If you have a entity with a nested entity, you can show the nested entity’s properties with a little trick.

For example if you have these business objects:

public class MyObj
{     
    public MyOtherObj MyProperty { get; set; }
}

public class MyOtherObj
{
     public int SomeProperty { get; set; }
}

If you want to show a field from MyProperty (e.g. MyOtherObj.SomeProperty), and MyObj is your report’s datasource, your report fieldbox will need to look like this:

First(Fields!MyProperty.Value.SomeProperty)

(NOTE: do not add “.Value” onto the end of the property name as normal, it will produce a #error at runtime).

Shows X-checked box or empty box in your RDLC report and displays correctly when exported to PDF (change the textbox’s font to Wingdings2):

=IIf( Fields!MyBooleanField.Value, Chr(83), Chr(163))

How to show report data in RDLC Page Header

You may have noticed that the compiler will bomb if you try to add a field directly to an RDLC’s Page Header. However, you can display field values in the Page Header like this:

1. Add the field column to the table (for a report) or a field box (for a form) with a value like this “=First(Fields!CtrName.Value)”.

2. Set the field box properties to CanShrink = true, CanGrow = false, Visibility-Hidden=true.

a. Warning: Don’t set the whole table column to Visibility-Hidden=true, for some reason the data won’t appear in the Page Header, you have to set the column header, footer, and textbox separately.

3. Add a textbox to the Page Header with the value of the textbox on your report/form body with a value like this: “=First(ReportItems!CtrName.Value)”

4. Shrink the width of the column or field to its smallest value.

© 2017 Robert Corvus