Ticket T295918
Visible to All Users

Loading Saved Reports

created 9 years ago

I have a problem where the report designer works fine and previewing in the report designer works. Unfortunately actually viewing the report in the report viewer or with the ExportToPdf() the report is empty. attached is a sample project.

Comments (3)
DevExpress Support Team 9 years ago

    Hello Matt,
    It's likely that you get an empty report because there are no report controls in your EFPlaygroundReport. Please adjust the report layout (Using Report Controls) and let me know whether or not the issue is resolved.

    Thanks

      I have added controls in the web designer and in the designer I can successfully preview these controls. I then save the document with the save button which calls ReportController.ReportDesigner_Save(). I save the XML string that is passed by the report designer. I then try to open the report either for more editing or to display the report with ReportController.Display() or ReportController.Edit(). Both of these methods use report.LoadLayoutFromXml() however the report does not show changes. I have tried adding a label to EFPlaygroundReport and changing the label in the designer but those changes do not appear either.

        that this is a sample of the xml used in the loadlayoutfromxml():
        <?xml version="1.0" encoding="UTF-8"?>
        -<XtraReportsLayoutSerializer DataSource="#Ref-16" DataMember="Customers" PageHeight="1100" PageWidth="850" Name="EFPlaygroundReport" Version="15.1" ControlType="EFPlaygroundReport, DevExpressPlayground, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" SerializerVersion="15.1.5.0">
        -<Bands>
        <Item1 Name="TopMargin" ControlType="TopMarginBand" Ref="0" Padding="0,0,0,0,100" TextAlignment="TopLeft"/>
        -<Item2 Name="reportHeaderBand1" ControlType="ReportHeaderBand" Ref="2" HeightF="51">
        -<Controls>
        <Item1 Name="xrLabel1" ControlType="XRLabel" Ref="1" Padding="2,2,0,0,100" Text="Report Label" LocationFloat="10.00001, 10.00001" SizeF="100, 23"/>
        </Controls>
        </Item2>
        -<Item3 Name="Detail" ControlType="DetailBand" Ref="9" Padding="0,0,0,0,100" TextAlignment="TopLeft" HeightF="32">
        -<Controls>
        -<Item1 Name="table1" ControlType="XRTable" Ref="8" LocationFloat="0, 7.5" SizeF="650, 23">
        -<Rows>
        -<Item1 Name="tableRow1" ControlType="XRTableRow" Ref="7" Weight="1">
        -<Cells>
        -<Item1 Name="tableCell1" ControlType="XRTableCell" Ref="4" Text="tableCell1" Weight="1" WidthF="100">
        -<DataBindings>
        <Item1 DataMember="Customers.Id" Ref="3" PropertyName="Text"/>
        </DataBindings>
        </Item1>
        -<Item2 Name="tableCell2" ControlType="XRTableCell" Ref="6" Text="tableCell2" Weight="1" WidthF="100">
        -<DataBindings>
        <Item1 DataMember="Customers.Name" Ref="5" PropertyName="Text"/>
        </DataBindings>
        </Item2>
        </Cells>
        </Item1>
        </Rows>
        </Item1>
        </Controls>
        </Item3>
        <Item4 Name="pageFooterBand1" ControlType="PageFooterBand" Ref="10" HeightF="29"/>
        <Item5 Name="BottomMargin" ControlType="BottomMarginBand" Ref="11" Padding="0,0,0,0,100" TextAlignment="TopLeft"/>
        </Bands>
        -<StyleSheet>
        <Item1 Name="Title" Ref="12" BorderWidthSerializable="1" Sides="None" BorderColor="Black" BackColor="Transparent" ForeColor="Maroon" Font="Times New Roman, 20pt, style=Bold" StringFormat="Near;Near;0;None;Character;Default" BorderStyle="Inset"/>
        <Item2 Name="FieldCaption" Ref="13" BorderWidthSerializable="1" Sides="None" BorderColor="Black" BackColor="Transparent" ForeColor="Maroon" Font="Arial, 10pt, style=Bold" StringFormat="Near;Near;0;None;Character;Default" BorderStyle="Inset"/>
        <Item3 Name="PageInfo" Ref="14" BorderWidthSerializable="1" Sides="None" BorderColor="Black" BackColor="Transparent" ForeColor="Black" Font="Times New Roman, 10pt, style=Bold" StringFormat="Near;Near;0;None;Character;Default" BorderStyle="Inset"/>
        <Item4 Name="DataField" Ref="15" Padding="2,2,0,0,100" BorderWidthSerializable="1" Sides="None" BorderColor="Black" BackColor="Transparent" ForeColor="Black" Font="Times New Roman, 10pt" StringFormat="Near;Near;0;None;Character;Default" BorderStyle="Inset"/>
        </StyleSheet>
        -<ObjectStorage>
        <Item1 Name="efDataSource1" Ref="16" ObjectType="DevExpress.DataAccess.EntityFramework.EFDataSource,DevExpress.DataAccess.v15.1" Source="DevExpressPlayground.Models.PlayGroundDB, DevExpressPlayground, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" ConnectionStringName="Playground"/>
        </ObjectStorage>
        -<Extensions>
        <Item1 Ref="17" Value="DevExpress.XtraReports.Web.ReportDesigner.DefaultDataSerializer" Key="DataSerializationExtension"/>
        </Extensions>
        </XtraReportsLayoutSerializer>

        Answers approved by DevExpress Support

        created 9 years ago

        Hi Matt,
        Thank you for the clarification. It appears you're using the wrong method to restore the report layout - it should be XtraReport.LoadLayoutFromXml, not the extension one. Actually, I understand your confusion, because the XRControlExtensions.LoadFromXml method is for internal use only and it's not supposed to be there. I've addressed this issue to our R&D team so they can eliminate this shortcoming: The extension methods from the 'XRControlExtensions' namespace should not be visible to a user. Add that ticket to your 'Favorites' if you're interested in our progress in this regard.
        Should you have further questions or concerns, let us know.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.