Infinite Loop in Master/Detail Report

Stimulsoft Reports.NET discussion
Post Reply
AdrianFS
Posts: 16
Joined: Mon Jul 25, 2011 4:36 pm

Infinite Loop in Master/Detail Report

Post by AdrianFS »

Below is an example report using the Demo.xml data which results in an infinite loop when displaying. The number of pages keeps going up and never completes. When I stop the report I can see that the pages keep repeating the same data. I did some testing and found that it occurs when:

1. There is a master data band with one or more detail data bands.
2. There is not enough space on the first page for all of the detail records from the first master record.
3. There is a page header or group header (repeated on all pages) that has an event using an aggregate.


In this example report the page header is very large to force the situation where there is no enough space for all of the detail records from the first master record. GroupHeaderBand1 has Print on All Pages=True, and a text field (Text3) with the following Before Print event:
Text3.Enabled = Count(CustomerDataBand)>0


It seems that Count(CustomerDataBand) somehow resets the detail data set. Since the group header is printed on each page and the detail records don't fit on a single page, the detail data set is reset for each page and the report never completes.


Code: Select all


  
    
    
      
        Connection
        Connection
        C:\Development Tools\Stimulsoft Reports.Net 2011.3 Trial\Bin\Data\Demo.xml
        C:\Development Tools\Stimulsoft Reports.Net 2011.3 Trial\Bin\Data\Demo.xsd
      
    
    
      
        Auto
        
          Rank,System.Double
          Country,System.String
          Year2009,System.Double
          Year2005,System.Double
          Year2000,System.Double
        
        
        Auto
        Connection.Auto
      
      
        Categories
        
          CategoryID,System.Int32
          CategoryName,System.String
          Description,System.String
          Picture,System.Byte[]
        
        
        Categories
        Connection.Categories
      
      
        Countries
        
          CountriesID,System.Int32
          Flag,System.Byte[]
          CountryName,System.String
        
        
        Countries
        Connection.Countries
      
      
        Customers
        
          CustomerID,System.String
          CompanyName,System.String
          ContactName,System.String
          ContactTitle,System.String
          Address,System.String
          City,System.String
          Region,System.String
          PostalCode,System.String
          Country,System.String
          Phone,System.String
          Fax,System.String
        
        
        Customers
        Connection.Customers
      
      
        Employees
        
          EmployeeID,System.Int32
          LastName,System.String
          FirstName,System.String
          Title,System.String
          TitleOfCourtesy,System.String
          BirthDate,System.DateTime
          HireDate,System.DateTime
          Address,System.String
          City,System.String
          Region,System.String
          PostalCode,System.String
          Country,System.String
          HomePhone,System.String
          Extension,System.String
          Photo,System.Byte[]
          Notes,System.String
          ReportsTo,System.Int32
        
        
        Employees
        Connection.Employees
      
      
        GlobalGrowth
        
          Region,System.String
          Year2006,System.Double
          Year2007,System.Double
          Year2008,System.Double
          Year2009,System.Double
        
        
        GlobalGrowth
        Connection.GlobalGrowth
      
      
        Opec
        
          Year,System.Double
          Iran,System.Double
          Iraq,System.Double
          Kuwait,System.Double
          Saudi_x0020_Arabia,System.Double
          UAE,System.Double
          Venezuela,System.Double
          Libya,System.Double
          Nigeria,System.Double
        
        
        Opec
        Connection.Opec
      
      
        Order Details
        
          OrderID,System.Int32
          ProductID,System.Int32
          UnitPrice,System.Decimal
          Quantity,System.Int16
          Discount,System.Single
        
        
        Order Details
        Connection.Order Details
      
      
        Orders
        
          OrderID,System.Int32
          CustomerID,System.String
          EmployeeID,System.Int32
          OrderDate,System.DateTime
          RequiredDate,System.DateTime
          ShippedDate,System.DateTime
          ShipVia,System.Int32
          Freight,System.Decimal
          ShipName,System.String
          ShipAddress,System.String
          ShipCity,System.String
          ShipRegion,System.String
          ShipPostalCode,System.String
          ShipCountry,System.String
        
        
        Orders
        Connection.Orders
      
      
        Products
        
          ProductID,System.Int32
          ProductName,System.String
          SupplierID,System.Int32
          CategoryID,System.Int32
          QuantityPerUnit,System.String
          UnitPrice,System.Decimal
          UnitsInStock,System.Int16
          UnitsOnOrder,System.Int16
          ReorderLevel,System.Int16
          Discontinued,System.Boolean
        
        
        Products
        Connection.Products
      
      
        Shippers
        
          ShipperID,System.Int32
          CompanyName,System.String
          Phone,System.String
        
        
        Shippers
        Connection.Shippers
      
      
        States
        
          Name,System.String
          USPS,System.String
          Population,System.Int32
          Capital,System.String
        
        
        States
        Connection.States
      
      
        Suppliers
        
          SupplierID,System.Int32
          CompanyName,System.String
          ContactName,System.String
          ContactTitle,System.String
          Address,System.String
          City,System.String
          Region,System.String
          PostalCode,System.String
          Country,System.String
          Phone,System.String
          Fax,System.String
          HomePage,System.String
        
        
        Suppliers
        Connection.Suppliers
      
    
    
      
        Orders
        
          OrderID
        
        
        
        Orders
        Orders
        
          OrderID
        
        
      
      
        Order_Details
        
          OrderID
        
        
        
        Order_Details
        Order_Details
        
          OrderID
        
        
      
      
        Customers_Orders
        
          CustomerID
        
        
        
        Customers_Orders
        Customers_Orders
        
          CustomerID
        
        
      
      
        Orders_Customers
        
          CustomerID
        
        
        
        Orders_Customers
        Orders_Customers
        
          CustomerID
        
        
      
    
    
    
  
  EngineV2
  
  
  
    
      None;Black;2;Solid;False;4;Black
      Transparent
      
        
          Transparent
          0,0.2,7.72,8.6
          
          
          PageHeaderBand1
          
          
        
        
          Transparent
          0,9.2,7.72,0.3
          
            
              Text3.Enabled = Count(CustomerDataBand)>0
              Transparent
              2.8,0,1.4,0.2
              
              Arial,12
              0,0,0,0
              Text3
              
              
              {Count(CustomerDataBand)}
              Black
              Expression
            
          
          {Customers.CustomerID}
          
          GroupHeaderBand1
          True
          
          
          True
        
        
          Transparent
          
          0,9.9,7.72,0.2
          
            
              None;Transparent;1;Solid;False;4;Black
              Transparent
              0,0,2.1,0.2
              
              Arial,12,Bold
              0,0,0,0
              Text1
              
              
              {Customers.CustomerID}
              Black
              DataColumn
            
          
          
          
          Customers
          
          CustomerDataBand
          
          
          
        
        
          Transparent
          
          0,10.5,7.72,0.2
          
            
              None;Transparent;1;Solid;False;4;Black
              Transparent
              2.2,0,1.7,0.2
              
              Arial,12,Bold
              0,0,0,0
              Text2
              
              
              {Orders.OrderID}
              Black
            
          
          
          Customers_Orders
          Orders
          
          
          MasterDataBand
          
          
          
        
      
      
      d8885812eb6c4a3fb6f6490853025f5d
      True
      0.39,0.39,0.39,0.39
      Page1
      11
      8.5
      Letter
      
      
        Arial,100
        [50:0:0:0]
      
    
  
  
  
    System.Dll
    System.Drawing.Dll
    System.Windows.Forms.Dll
    System.Data.Dll
    System.Xml.Dll
    Stimulsoft.Controls.Dll
    Stimulsoft.Base.Dll
    Stimulsoft.Report.Dll
  
  Report
  1/4/2012 8:35:20 AM
  12/14/2011 4:48:55 PM
  C:\Development Tools\Stimulsoft Reports.Net 2011.3\Infinite Loop.mrt
  1195dfeeaad84335962b25cabf69f7fe
  Report
  Inches
  2011.3.1200
  using System;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using Stimulsoft.Controls;
using Stimulsoft.Base.Drawing;
using Stimulsoft.Report;
using Stimulsoft.Report.Dialogs;
using Stimulsoft.Report.Components;

namespace Reports
{
    public class Report : Stimulsoft.Report.StiReport
    {
        public Report()        {
            this.InitializeComponent();
        }

        #region StiReport Designer generated code - do not modify
        #endregion StiReport Designer generated code - do not modify
    }
}

  CSharp
  
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Infinite Loop in Master/Detail Report

Post by HighAley »

Hello.

We've reproduced your issue and need time to prepare an answer for you.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Infinite Loop in Master/Detail Report

Post by HighAley »

Hello.

We've fixed this bug.
Please, check our next prerelease build.

Thank you.
Post Reply