Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
after page break detailarea sips
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterForstmeier committed Jun 22, 2011
1 parent 37de3d2 commit 0db88b4
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ public void MeasurePageHeader (BaseSection section)
section.SectionOffset,
this.marginBounds.Width,
s.Height);
Console.WriteLine("\tSectionBounds pageheader {0} - loca {1}",pageHeaderRectangle,pageHeaderRectangle.Location);
}


Expand Down Expand Up @@ -205,6 +206,9 @@ public Rectangle ReportFooterRectangle
public Rectangle DetailArea
{
get {
Console.WriteLine("\tSectionBound Detailarea location {0}",new Rectangle (new Point (pageHeaderRectangle.X,pageHeaderRectangle.Bottom + GlobalValues.GapBetweenContainer),
new Size(pageFooterRectangle.Location.X,pageFooterRectangle.Top - GlobalValues.GapBetweenContainer)).Location);

return new Rectangle (new Point (pageHeaderRectangle.X,pageHeaderRectangle.Bottom + GlobalValues.GapBetweenContainer),
new Size(pageFooterRectangle.Location.X,pageFooterRectangle.Top - GlobalValues.GapBetweenContainer));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
var convertedSection = new ExporterCollection();
Offset = new Point(section.Location.X,section.SectionOffset);
Point startOffset = Offset;
if (section.Items.Count > 0) {
Console.WriteLine ("start ConvertSection {0}- {1}",section.Name,section.Size);

if (section.Items.Count > 0)
{
Size sectionSize = section.Size;

section.Items.SortByLocation();

IExpressionEvaluatorFacade evaluator = EvaluationHelper.CreateEvaluator(this.SinglePage,this.SinglePage.IDataNavigator);
Expand All @@ -101,7 +106,7 @@ protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
ISimpleContainer simpleContainer = item as ISimpleContainer;

Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] );

if (simpleContainer != null)
{
EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items);
Expand All @@ -114,19 +119,23 @@ protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
Rectangle rsec = new Rectangle(section.Location,section.Size);
Rectangle ro = new Rectangle(section.Location,simpleContainer.Size);
if (!rsec.Contains(ro)) {
Console.WriteLine ("Update Size");
section.Size = new Size(section.Size.Width,Offset.Y - startOffset.Y );
}
}
else
{
var converteditem = ExportHelper.ConvertLineItem(item,Offset);
convertedSection.Add(converteditem);
// Offset = new Point (Offset.X,Offset.Y + item.Size.Height);
convertedSection.Add(converteditem );
}
i ++;
}
Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap);
// section.Size = sectionSize;
}

Console.WriteLine ("leave ConvertSection {0}",section.Size);
Console.WriteLine();
return convertedSection;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,10 @@ public override ExporterCollection Convert(BaseReportItem parent, BaseReportItem

private ExporterCollection ConvertDataRow (ISimpleContainer simpleContainer)
{

ExporterCollection exporterCollection = new ExporterCollection();
// base.CurrentPosition = new Point(base.SectionBounds.DetailStart.X,base.SectionBounds.DetailStart.Y);
base.CurrentPosition = base.SectionBounds.DetailArea.Location;
// base.CurrentPosition = new Point (base.CurrentPosition.X,base.CurrentPosition.Y + 20);
Console.WriteLine("Convertdatarow start {0}",base.CurrentPosition);
BaseSection section = parent as BaseSection;

DefaultLeftPosition = parent.Location.X;
Expand Down Expand Up @@ -165,10 +164,14 @@ private Point CalculateStartPosition(BaseSection section)
{
var r = base.ReportModel;
base.SectionBounds.CalculatePageBounds(r);
return new Point(base.SectionBounds.DetailArea.X,base.SectionBounds.PageHeaderRectangle.Bottom + 1);
var rr = new Point(base.SectionBounds.DetailArea.X,base.SectionBounds.PageHeaderRectangle.Bottom + 1);
var p = base.SectionBounds.DetailArea.Location;
Console.WriteLine ("PageBreak {0} - detailareaa {1}",rr,p);
Console.WriteLine("-----------------");
return base.SectionBounds.DetailArea.Location;
}


private Point ConvertGroupHeader(ExporterCollection exportList,BaseSection section,Point offset)
{
var retVal = Point.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ protected override void BuildReportHeader ()

protected override void BuildPageHeader ()
{
base.DebugShowSections();
// base.DebugShowSections();
Console.WriteLine();
Console.WriteLine ("start BuildPageHeader DetailArea.Location {0} - offset {1}",SectionBounds.DetailArea.Location,base.Offset);
base.SectionBounds.CalculatePageBounds(base.ReportModel);
ConvertSectionInternal (base.ReportModel.PageHeader);
base.ReportModel.PageHeader.Size = new Size(base.ReportModel.PageHeader.Size.Width,base.Offset.Y - base.ReportModel.PageHeader.SectionOffset);
Size s = base.ReportModel.PageHeader.Size;

// base.ReportModel.PageHeader.Size = new Size(base.ReportModel.PageHeader.Size.Width,base.Offset.Y - base.ReportModel.PageHeader.SectionOffset);
s = base.ReportModel.PageHeader.Size;
base.SectionBounds.CalculatePageBounds(base.ReportModel);
base.DebugShowSections();
Console.WriteLine ("end BuildPageHeader DetailArea.Location {0} - offset {1}",SectionBounds.DetailArea.Location,base.Offset);
// base.DebugShowSections();
Console.WriteLine();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public sealed class GlobalValues
private static string reportFileName = "Report1";
private const string unbound = "unbound";
private const string tableName = "Table";
private const int enlargeControl = 5;
private const int defaultZoomfactor = 1;
private const int gapBetweenRows = 1;

Expand Down

0 comments on commit 0db88b4

Please sign in to comment.