Browse Source

work on GapList.cs

pull/15/head^2
peterforstmeier 14 years ago
parent
commit
5a414db606
  1. 305
      samples/SharpDevelopReports/SampleReports/Ilist/ContributorsList.srd
  2. 1
      samples/SharpDevelopReports/src/SharpReportSamples/ContributorsList.cs
  3. 6
      samples/SharpDevelopReports/src/SharpReportSamples/MainForm.cs
  4. 30
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs
  5. 1
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs
  6. 6
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/FormPageBuilder.cs
  7. 14
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/GapList.cs
  8. 80
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs
  9. 20
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/WPF/FixedDocumentCreator.cs

305
samples/SharpDevelopReports/SampleReports/Ilist/ContributorsList.srd

@ -2,282 +2,279 @@
<ReportModel> <ReportModel>
<ReportSettings> <ReportSettings>
<ReportSettings> <ReportSettings>
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont> <ReportName>Report1</ReportName>
<DataModel>PushData</DataModel> <ReportType>DataReport</ReportType>
<RightMargin>50</RightMargin> <BottomMargin>50</BottomMargin>
<UseStandardPrinter>True</UseStandardPrinter> <TopMargin>50</TopMargin>
<SortColumnCollection />
<AvailableFieldsCollection />
<NoDataMessage>No Data for this Report</NoDataMessage>
<LeftMargin>50</LeftMargin> <LeftMargin>50</LeftMargin>
<RightMargin>50</RightMargin>
<PageSize>827, 1169</PageSize> <PageSize>827, 1169</PageSize>
<Padding>5, 5, 5, 5</Padding>
<BottomMargin>50</BottomMargin>
<CommandType>Text</CommandType>
<ParameterCollection />
<Landscape>False</Landscape> <Landscape>False</Landscape>
<ReportName>Report1</ReportName>
<TopMargin>50</TopMargin>
<GroupColumnsCollection />
<GraphicsUnit>Millimeter</GraphicsUnit> <GraphicsUnit>Millimeter</GraphicsUnit>
<CommandText /> <Padding>5, 5, 5, 5</Padding>
<ReportType>DataReport</ReportType> <AvailableFieldsCollection />
<SortColumnsCollection />
<GroupColumnsCollection />
<ParameterCollection />
<ConnectionString /> <ConnectionString />
<CommandText />
<CommandType>Text</CommandType>
<DataModel>PushData</DataModel>
<NoDataMessage>No Data for this Report</NoDataMessage>
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<UseStandardPrinter>True</UseStandardPrinter>
</ReportSettings> </ReportSettings>
</ReportSettings> </ReportSettings>
<SectionCollection> <SectionCollection>
<BaseSection> <BaseSection>
<Location>50, 50</Location>
<Size>786, 35</Size> <Size>786, 35</Size>
<Name>ReportHeader</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>50</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<Items /> <SectionOffset>0</SectionOffset>
<Location>50, 50</Location> <SectionMargin>50</SectionMargin>
<DrawBorder>False</DrawBorder> <DrawBorder>False</DrawBorder>
<PageBreakAfter>False</PageBreakAfter>
<Items />
<FrameColor>Black</FrameColor>
<Name>ReportHeader</Name>
</BaseSection> </BaseSection>
<BaseSection> <BaseSection>
<Location>50, 100</Location>
<Size>786, 108</Size> <Size>786, 108</Size>
<Name>ReportPageHeader</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>50</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<SectionOffset>0</SectionOffset>
<SectionMargin>50</SectionMargin>
<DrawBorder>False</DrawBorder>
<PageBreakAfter>False</PageBreakAfter>
<Items> <Items>
<BaseTextItem> <BaseTextItem>
<Location>429, 63</Location>
<Size>100, 20</Size>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<CanShrink>False</CanShrink> <Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<StringTrimming>None</StringTrimming> <StringTrimming>None</StringTrimming>
<Text>Job</Text>
<Location>429, 63</Location>
<ContentAlignment>TopLeft</ContentAlignment> <ContentAlignment>TopLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>Job</Name> <Text>Job</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<Size>100, 20</Size>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<Name>Job</Name>
</BaseTextItem> </BaseTextItem>
<BaseTextItem> <BaseTextItem>
<Location>234, 63</Location>
<Size>100, 20</Size>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<CanShrink>False</CanShrink> <Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<StringTrimming>None</StringTrimming> <StringTrimming>None</StringTrimming>
<Text>Lastname</Text>
<Location>234, 63</Location>
<ContentAlignment>TopLeft</ContentAlignment> <ContentAlignment>TopLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>Lastname</Name> <Text>Lastname</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<Size>100, 20</Size>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<Name>Lastname</Name>
</BaseTextItem> </BaseTextItem>
<BaseImageItem> <BaseImageItem>
<ImageSource>File</ImageSource>
<Location>47, 6</Location> <Location>47, 6</Location>
<Name>ReportImageControl</Name>
<Size>661, 42</Size> <Size>661, 42</Size>
<ScaleImageToSize>False</ScaleImageToSize>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<RelativeFileName>..\..\..\..\..\..\SharpDevelop3.0_CHECKOUT\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</RelativeFileName> <ImageFileName>D:\git_Sharpdevelop_Reporting\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName>
<ImageFileName>D:\SharpDevelop3.0_CHECKOUT\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName> <ScaleImageToSize>False</ScaleImageToSize>
<ImageSource>File</ImageSource>
<RelativeFileName>..\..\Logos\Bannerbeige2.gif</RelativeFileName>
<Name>ReportImageControl</Name>
</BaseImageItem> </BaseImageItem>
<BaseLineItem> <BaseLineItem>
<StartLineCap>Flat</StartLineCap>
<FromPoint>0, 3</FromPoint>
<Location>47, 87</Location> <Location>47, 87</Location>
<Name />
<Size>661, 18</Size> <Size>661, 18</Size>
<EndLineCap>Flat</EndLineCap>
<DashStyle>Solid</DashStyle>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<DashLineCap>Flat</DashLineCap>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<FromPoint>0, 3</FromPoint>
<ToPoint>614, 3</ToPoint> <ToPoint>614, 3</ToPoint>
<StartLineCap>Flat</StartLineCap>
<EndLineCap>Flat</EndLineCap>
<DashLineCap>Flat</DashLineCap>
<DashStyle>Solid</DashStyle>
<Thickness>2</Thickness> <Thickness>2</Thickness>
<Name />
</BaseLineItem> </BaseLineItem>
<BaseTextItem> <BaseTextItem>
<Location>46, 63</Location>
<Size>109, 20</Size>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<CanShrink>False</CanShrink> <Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<StringTrimming>EllipsisCharacter</StringTrimming> <StringTrimming>EllipsisCharacter</StringTrimming>
<Text>Firstname</Text>
<Location>46, 63</Location>
<ContentAlignment>TopLeft</ContentAlignment> <ContentAlignment>TopLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 12pt, style=Bold</Font>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>reportTextItem1</Name> <Text>Firstname</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<Size>109, 20</Size>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<Name>reportTextItem1</Name>
</BaseTextItem> </BaseTextItem>
</Items> </Items>
<Location>50, 100</Location> <FrameColor>Black</FrameColor>
<DrawBorder>False</DrawBorder> <Name>ReportPageHeader</Name>
</BaseSection> </BaseSection>
<BaseSection> <BaseSection>
<Size>750, 51</Size> <Location>50, 223</Location>
<Name>ReportDetail</Name> <Size>750, 60</Size>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>50</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<SectionOffset>0</SectionOffset>
<SectionMargin>50</SectionMargin>
<DrawBorder>False</DrawBorder>
<PageBreakAfter>False</PageBreakAfter>
<Items> <Items>
<BaseRowItem> <BaseRowItem>
<Location>3, 10</Location> <Location>3, 10</Location>
<AlternateBackColor /> <Size>699, 47</Size>
<Name>Row</Name> <BackColor>White</BackColor>
<DrawBorder>False</DrawBorder>
<ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<FrameColor>WindowFrame</FrameColor>
<Items> <Items>
<BaseDataItem> <BaseDataItem>
<DataType>System.String</DataType>
<Text>First</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>43, 12</Location> <Location>43, 12</Location>
<Size>147, 25</Size>
<BackColor>White</BackColor>
<Font>Microsoft Sans Serif, 10pt</Font>
<StringTrimming>EllipsisCharacter</StringTrimming>
<ContentAlignment>MiddleLeft</ContentAlignment>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<DataType>System.String</DataType>
<Text>First</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<StringTrimming>EllipsisCharacter</StringTrimming> <Visible>True</Visible>
<ColumnName>First</ColumnName> <ColumnName>First</ColumnName>
<DrawBorder>False</DrawBorder>
<CanShrink>False</CanShrink>
<ContentAlignment>MiddleLeft</ContentAlignment>
<BackColor>White</BackColor>
<FormatString />
<Name>unbound1</Name> <Name>unbound1</Name>
<Visible>True</Visible>
<Size>147, 25</Size>
<FrameColor>WindowFrame</FrameColor>
</BaseDataItem> </BaseDataItem>
<BaseDataItem> <BaseDataItem>
<DataType>System.String</DataType>
<Text>last</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>231, 12</Location> <Location>231, 12</Location>
<CanGrow>False</CanGrow> <Size>139, 25</Size>
<ForeColor>ControlText</ForeColor> <BackColor>White</BackColor>
<Font>Microsoft Sans Serif, 10pt</Font>
<StringTrimming>EllipsisCharacter</StringTrimming> <StringTrimming>EllipsisCharacter</StringTrimming>
<ColumnName>last</ColumnName>
<DrawBorder>False</DrawBorder>
<CanShrink>False</CanShrink>
<ContentAlignment>MiddleLeft</ContentAlignment> <ContentAlignment>MiddleLeft</ContentAlignment>
<BackColor>White</BackColor> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>unbound2</Name> <DataType>System.String</DataType>
<Visible>True</Visible> <Text>Last</Text>
<Size>139, 25</Size> <DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<ColumnName>Last</ColumnName>
<Name>unbound2</Name>
</BaseDataItem> </BaseDataItem>
<BaseDataItem> <BaseDataItem>
<DataType>System.String</DataType>
<Text>Job</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>426, 10</Location> <Location>426, 10</Location>
<Size>216, 25</Size>
<BackColor>White</BackColor>
<Font>Microsoft Sans Serif, 10pt</Font>
<StringTrimming>EllipsisCharacter</StringTrimming>
<ContentAlignment>MiddleLeft</ContentAlignment>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<DataType>System.String</DataType>
<Text>Job</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<StringTrimming>EllipsisCharacter</StringTrimming> <Visible>True</Visible>
<ColumnName>Job</ColumnName> <ColumnName>Job</ColumnName>
<DrawBorder>False</DrawBorder>
<NullValue>--------------</NullValue> <NullValue>--------------</NullValue>
<CanShrink>False</CanShrink>
<ContentAlignment>MiddleLeft</ContentAlignment>
<BackColor>White</BackColor>
<FormatString />
<Name>unbound3</Name> <Name>unbound3</Name>
<Visible>True</Visible>
<Size>216, 25</Size>
<FrameColor>WindowFrame</FrameColor>
</BaseDataItem> </BaseDataItem>
</Items> </Items>
<DrawBorder>False</DrawBorder> <AlternateBackColor />
<ChangeBackColorEveryNRow>0</ChangeBackColorEveryNRow> <ChangeBackColorEveryNRow>0</ChangeBackColorEveryNRow>
<FrameColor>WindowFrame</FrameColor> <Name>Row</Name>
<Size>699, 40</Size>
<BackColor>White</BackColor>
<Visible>True</Visible>
<ForeColor>ControlText</ForeColor>
</BaseRowItem> </BaseRowItem>
</Items> </Items>
<Location>50, 223</Location> <FrameColor>Black</FrameColor>
<DrawBorder>False</DrawBorder> <Name>ReportDetail</Name>
</BaseSection> </BaseSection>
<BaseSection> <BaseSection>
<Location>50, 298</Location>
<Size>750, 49</Size> <Size>750, 49</Size>
<Name>ReportPageFooter</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>50</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<SectionOffset>0</SectionOffset>
<SectionMargin>50</SectionMargin>
<DrawBorder>False</DrawBorder>
<PageBreakAfter>False</PageBreakAfter>
<Items> <Items>
<BaseTextItem> <BaseTextItem>
<Location>45, 24</Location>
<Size>483, 20</Size>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<CanShrink>False</CanShrink> <Font>Microsoft Sans Serif, 8.25pt</Font>
<StringTrimming>None</StringTrimming> <StringTrimming>None</StringTrimming>
<Text>=Globals!ReportFolder</Text>
<Location>45, 24</Location>
<ContentAlignment>TopLeft</ContentAlignment> <ContentAlignment>TopLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 8.25pt</Font>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>=Globals!ReportFolder</Name> <Text>=Globals!ReportFolder</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<Size>483, 20</Size>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<Name>=Globals!ReportFolder</Name>
</BaseTextItem> </BaseTextItem>
<BaseLineItem> <BaseLineItem>
<StartLineCap>Flat</StartLineCap>
<FromPoint>0, 0</FromPoint>
<Location>45, 3</Location> <Location>45, 3</Location>
<Name>object_177a5444_b8e0_4202_87d2_05cdc7cd1194</Name>
<Size>663, 15</Size> <Size>663, 15</Size>
<EndLineCap>Flat</EndLineCap>
<DashStyle>Solid</DashStyle>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<DashLineCap>Flat</DashLineCap>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<FromPoint>0, 0</FromPoint>
<ToPoint>656, 0</ToPoint> <ToPoint>656, 0</ToPoint>
<StartLineCap>Flat</StartLineCap>
<EndLineCap>Flat</EndLineCap>
<DashLineCap>Flat</DashLineCap>
<DashStyle>Solid</DashStyle>
<Thickness>2</Thickness> <Thickness>2</Thickness>
<Name>object_177a5444_b8e0_4202_87d2_05cdc7cd1194</Name>
</BaseLineItem> </BaseLineItem>
<BaseTextItem> <BaseTextItem>
<Location>602, 24</Location>
<Size>100, 20</Size>
<BackColor>White</BackColor> <BackColor>White</BackColor>
<CanShrink>False</CanShrink> <Font>Microsoft Sans Serif, 8.25pt</Font>
<StringTrimming>None</StringTrimming> <StringTrimming>None</StringTrimming>
<Text>='Page ' + Globals!PageNumber</Text>
<Location>602, 24</Location>
<ContentAlignment>TopLeft</ContentAlignment> <ContentAlignment>TopLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 8.25pt</Font>
<CanGrow>False</CanGrow> <CanGrow>False</CanGrow>
<FormatString /> <CanShrink>False</CanShrink>
<Name>='Page ' + Globals!PageNumber</Name> <Text>='Page ' + Globals!PageNumber</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>WindowFrame</FrameColor> <FrameColor>WindowFrame</FrameColor>
<Size>100, 20</Size>
<ForeColor>ControlText</ForeColor> <ForeColor>ControlText</ForeColor>
<Visible>True</Visible>
<Name>='Page ' + Globals!PageNumber</Name>
</BaseTextItem> </BaseTextItem>
</Items> </Items>
<Location>50, 289</Location> <FrameColor>Black</FrameColor>
<DrawBorder>False</DrawBorder> <Name>ReportPageFooter</Name>
</BaseSection> </BaseSection>
<BaseSection> <BaseSection>
<Location>50, 362</Location>
<Size>750, 55</Size> <Size>750, 55</Size>
<Name>ReportFooter</Name>
<PageBreakAfter>False</PageBreakAfter>
<SectionMargin>50</SectionMargin>
<SectionOffset>0</SectionOffset>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<Items /> <SectionOffset>0</SectionOffset>
<Location>50, 353</Location> <SectionMargin>50</SectionMargin>
<DrawBorder>False</DrawBorder> <DrawBorder>False</DrawBorder>
<PageBreakAfter>False</PageBreakAfter>
<Items />
<FrameColor>Black</FrameColor>
<Name>ReportFooter</Name>
</BaseSection> </BaseSection>
</SectionCollection> </SectionCollection>
</ReportModel> </ReportModel>

1
samples/SharpDevelopReports/src/SharpReportSamples/ContributorsList.cs

@ -41,6 +41,7 @@ namespace SharpReportSamples
list.Add(new Contributor("Nathan","Allen","")); list.Add(new Contributor("Nathan","Allen",""));
list.Add(new Contributor("Troy","Simpson","Prg.")); list.Add(new Contributor("Troy","Simpson","Prg."));
list.Add(new Contributor("David","Alpert","Prg.")); list.Add(new Contributor("David","Alpert","Prg."));
list.Add(new Contributor("Fred","Flintstone",null));
return list; return list;
} }
} }

6
samples/SharpDevelopReports/src/SharpReportSamples/MainForm.cs

@ -153,9 +153,9 @@ namespace SharpReportSamples
private void RunContributors (string fileName) private void RunContributors (string fileName)
{ {
ReportModel model = ReportEngine.LoadReportModel(fileName); ReportModel model = ReportEngine.LoadReportModel(fileName);
Console.WriteLine(model.ReportSettings.PageSize); // Console.WriteLine(model.ReportSettings.PageSize);
model.ReportSettings.PageSize = new Size(model.ReportSettings.PageSize.Width,400); // model.ReportSettings.PageSize = new Size(model.ReportSettings.PageSize.Width,400);
Console.WriteLine(model.ReportSettings.PageSize); // Console.WriteLine(model.ReportSettings.PageSize);
// sorting is done here, but, be carefull, misspelled fieldnames will cause an exception // sorting is done here, but, be carefull, misspelled fieldnames will cause an exception

30
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/BasePager.cs

@ -18,6 +18,8 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
private PagesCollection pages; private PagesCollection pages;
private readonly object pageLock = new object(); private readonly object pageLock = new object();
// private Point currentBottom;
public event EventHandler<PageCreatedEventArgs> PageCreated; public event EventHandler<PageCreatedEventArgs> PageCreated;
public event EventHandler<SectionRenderEventArgs> SectionRendering; public event EventHandler<SectionRenderEventArgs> SectionRendering;
@ -75,9 +77,11 @@ namespace ICSharpCode.Reports.Core.Exporter
#region Converters #region Converters
protected ExporterCollection ConvertSection (BaseSection section,int dataRow) protected ExporterCollection ConvertSection (BaseSection section,int dataRow)
{ {
Point currentBottom = Point.Empty;
FireSectionRenderEvent (section ,dataRow); FireSectionRenderEvent (section ,dataRow);
PrintHelper.AdjustParent(section,section.Items); PrintHelper.AdjustParent(section,section.Items);
PrintHelper.AdjustSectionLocation(section); PrintHelper.AdjustSectionLocation(section);
@ -103,11 +107,10 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
ISimpleContainer simpleContainer = item as ISimpleContainer; ISimpleContainer simpleContainer = item as ISimpleContainer;
// Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] );
if (simpleContainer != null) if (simpleContainer != null)
{ {
Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] ); Offset = new Point(Offset.X,Offset.Y + gapCalculator.GapBetweenItems[i] );
// Offset = new Point(Offset.X,Offset.Y + 5);
var containerSize = simpleContainer.Size; var containerSize = simpleContainer.Size;
EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items); EvaluationHelper.EvaluateReportItems(evaluator,simpleContainer.Items);
@ -116,27 +119,40 @@ namespace ICSharpCode.Reports.Core.Exporter
LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer); LayoutHelper.SetLayoutForRow(Graphics,layouter, simpleContainer);
/* /*
* */ * */
// Console.WriteLine("--");
/*
section.Items.ForEach(delegate(BaseReportItem aitem) section.Items.ForEach(delegate(BaseReportItem aitem)
{ {
// Console.WriteLine(item.Location); // Console.WriteLine(item.Location);
}); });
var h = section.Items.FindHighestElement(); var h = section.Items.FindHighestElement();
section.MeasureOverride(section.Size); */
/* section.MeasureOverride(section.Size);
* */ /** */
Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset); Offset = BaseConverter.ConvertContainer(convertedSection,simpleContainer,Offset.X,Offset);
simpleContainer.Size = containerSize; simpleContainer.Size = containerSize;
} }
else else
{ {
var converteditem = ExportHelper.ConvertLineItem(item,Offset); var converteditem = ExportHelper.ConvertLineItem(item,Offset);
if (converteditem.StyleDecorator.DisplayRectangle.Bottom > currentBottom.Y) {
currentBottom = new Point(converteditem.StyleDecorator.Location.X,converteditem.StyleDecorator.DisplayRectangle.Bottom);
}
convertedSection.Add((BaseExportColumn)converteditem ); convertedSection.Add((BaseExportColumn)converteditem );
} }
i ++; i ++;
} }
Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap); Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap);
// Offset = new Point (Offset.X,Offset.Y + 5);
if (currentBottom.Y > Offset.Y) {
Offset = new Point (Offset.X,currentBottom.Y);
}
// Offset = new Point (Offset.X,Offset.Y + gapCalculator.LastGap);
} }
SectionBounds.Offset = Offset; SectionBounds.Offset = Offset;
return convertedSection; return convertedSection;

1
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/Converters/GroupedRowConverter.cs

@ -58,6 +58,7 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
ExporterCollection exporterCollection = new ExporterCollection(); ExporterCollection exporterCollection = new ExporterCollection();
base.CurrentPosition = base.SectionBounds.Offset; base.CurrentPosition = base.SectionBounds.Offset;
var p = base.CurrentPosition;
BaseSection section = parent as BaseSection; BaseSection section = parent as BaseSection;
DefaultLeftPosition = parent.Location.X; DefaultLeftPosition = parent.Location.X;

6
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/FormPageBuilder.cs

@ -46,9 +46,12 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
if (base.Pages.Count == 0) if (base.Pages.Count == 0)
{ {
SectionBounds.Offset = new Point(base.SectionBounds.MarginBounds.Left,base.SectionBounds.MarginBounds.Top); SectionBounds.Offset = new Point(base.SectionBounds.MarginBounds.Left,base.SectionBounds.MarginBounds.Top);
Console.WriteLine("a reportheader {0}",SectionBounds.Offset);
ExporterCollection convertedList = base.ConvertSection (base.ReportModel.ReportHeader,0); ExporterCollection convertedList = base.ConvertSection (base.ReportModel.ReportHeader,0);
base.SinglePage.Items.AddRange(convertedList); base.SinglePage.Items.AddRange(convertedList);
Console.WriteLine("reportheader {0}",SectionBounds.Offset);
} }
} }
@ -57,13 +60,16 @@ namespace ICSharpCode.Reports.Core.Exporter
if (SectionBounds.Offset.Y < base.ReportModel.PageHeader.SectionOffset) { if (SectionBounds.Offset.Y < base.ReportModel.PageHeader.SectionOffset) {
SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.PageHeader.SectionOffset); SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.PageHeader.SectionOffset);
} }
Console.WriteLine("a pageheader {0}",SectionBounds.Offset);
ExporterCollection convertedList = base.ConvertSection (base.ReportModel.PageHeader,0); ExporterCollection convertedList = base.ConvertSection (base.ReportModel.PageHeader,0);
base.SinglePage.Items.AddRange(convertedList); base.SinglePage.Items.AddRange(convertedList);
base.SectionBounds.CalculatePageBounds(base.ReportModel); base.SectionBounds.CalculatePageBounds(base.ReportModel);
Console.WriteLine("pageheader {0}",SectionBounds.Offset);
} }
protected override void BuildDetailInternal(BaseSection section) protected override void BuildDetailInternal(BaseSection section)
{ {
Console.WriteLine("a detail {0}",SectionBounds.Offset);
base.BuildDetailInternal(section); base.BuildDetailInternal(section);
SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.DetailSection.Location.Y); SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.DetailSection.Location.Y);
ExporterCollection convertedList = base.ConvertSection (base.ReportModel.DetailSection,0); ExporterCollection convertedList = base.ConvertSection (base.ReportModel.DetailSection,0);

14
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Exporter/GapList.cs

@ -27,6 +27,9 @@ namespace ICSharpCode.Reports.Core.Exporter
for (int i = 0; i < section.Items.Count; i++) { for (int i = 0; i < section.Items.Count; i++) {
GapBetweenItems[i] = CalculateGap(oldItem,section.Items[i]); GapBetweenItems[i] = CalculateGap(oldItem,section.Items[i]);
} }
for (int i = 0; i < section.Items.Count; i++) {
Console.WriteLine(GapBetweenItems[i]);
}
GapBetweenItems[section.Items.Count] = CalculateLastGap(section); GapBetweenItems[section.Items.Count] = CalculateLastGap(section);
} }
@ -35,8 +38,15 @@ namespace ICSharpCode.Reports.Core.Exporter
{ {
if (oldItem == item) { if (oldItem == item) {
return 0; return 0;
} else { }
return item.Location.Y - (oldItem.Location.Y + oldItem.Size.Height) ; else
{
if (oldItem.Location.Y + oldItem.Size.Height < item.Location.Y ) {
return item.Location.Y - (oldItem.Location.Y + oldItem.Size.Height) ;
} else
{
return 0;
}
} }
} }

80
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/Globals/GlobalValues.cs

@ -31,6 +31,9 @@ namespace ICSharpCode.Reports.Core.Globals
private const string tableName = "Table"; private const string tableName = "Table";
private const int defaultZoomfactor = 1; private const int defaultZoomfactor = 1;
private const int gapBetweenRows = 1; private const int gapBetweenRows = 1;
//WPF
private const double defaultCornerRadius = 2;
private static double defaulThickness = 2;
private GlobalValues() private GlobalValues()
{ {
@ -39,7 +42,6 @@ namespace ICSharpCode.Reports.Core.Globals
#region some usefull functions and methodes #region some usefull functions and methodes
private static bool IsSpoolerRunning() private static bool IsSpoolerRunning()
{ {
ServiceController[] services; ServiceController[] services;
@ -74,22 +76,6 @@ namespace ICSharpCode.Reports.Core.Globals
#endregion #endregion
#region Formatting
/// <summary>
/// Build a StringFormat witch is used allover the code to
/// Format all String's the same way.
/// </summary>
/// <returns>a StringFormat object</returns>
/*
public static StringFormat StandardStringFormat()
{
StringFormat sFormat = StringFormat.GenericTypographic;
sFormat.FormatFlags |= StringFormatFlags.LineLimit;
return sFormat;
}
*/
#endregion
#region numeric Constant #region numeric Constant
/// <summary> /// <summary>
@ -107,12 +93,8 @@ namespace ICSharpCode.Reports.Core.Globals
/// The default Size of a Section /// The default Size of a Section
/// used in <see cref="ReportGenerator" /// used in <see cref="ReportGenerator"
/// </summary> /// </summary>
public static int DefaultSectionHeight public static int DefaultSectionHeight {get {return 60;}}
{
get {
return 60;
}
}
/// <summary> /// <summary>
/// Default zoom Factor for all typ's of preview /// Default zoom Factor for all typ's of preview
@ -125,12 +107,7 @@ namespace ICSharpCode.Reports.Core.Globals
public static Size PreferedSize public static Size PreferedSize {get {return new Size(100,20);}}
{
get {
return new Size(100,20);
}
}
public static Size DefaultPageSize {get {return new Size(827,1169);}} public static Size DefaultPageSize {get {return new Size(827,1169);}}
@ -142,15 +119,6 @@ namespace ICSharpCode.Reports.Core.Globals
#region String Constant's #region String Constant's
/*
public static string ReportString
{
get {
return reportString;
}
}
*/
public static string ReportExtension public static string ReportExtension
{ {
get { get {
@ -172,10 +140,7 @@ namespace ICSharpCode.Reports.Core.Globals
} }
} }
// public static string UnboundName
// {
// get {return unbound;}
// }
public static string TableName public static string TableName
{ {
@ -184,29 +149,9 @@ namespace ICSharpCode.Reports.Core.Globals
} }
} }
/*
public static string FunctionStartTag
{
get {return "{=";}
}
public static string FunctionEndTag
{
get {return "}";}
}
*/
/*
public static string StringParserStartTag
{
get {return "${";}
}
*/
#endregion #endregion
#region Printing #region Printing
public static int GapBetweenContainer { public static int GapBetweenContainer {
@ -291,6 +236,15 @@ namespace ICSharpCode.Reports.Core.Globals
#endregion #endregion
#region Wpf
public static double DefaultCornerRadius {get {return defaultCornerRadius;}}
public static double DefaultBorderThickness {get {return defaulThickness;}}
#endregion
#region Icons #region Icons
/// <summary> /// <summary>

20
src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/WPF/FixedDocumentCreator.cs

@ -79,8 +79,12 @@ namespace ICSharpCode.Reports.Core.WPF
var text = column as ExportText; var text = column as ExportText;
if (text != null) { if (text != null) {
var t = CreateTextBlock(text); var t = CreateTextBlock(text);
if (column.StyleDecorator.DrawBorder) { if (column.StyleDecorator.DrawBorder) {
border = CreateBorder(column.StyleDecorator as BaseStyleDecorator); border = CreateBorder(column.StyleDecorator as BaseStyleDecorator,
GlobalValues.DefaultBorderThickness,
GlobalValues.DefaultCornerRadius );
border.Child = t; border.Child = t;
element = border; element = border;
} }
@ -104,12 +108,12 @@ namespace ICSharpCode.Reports.Core.WPF
#region GraphicsElement (Line etc) #region GraphicsElement (Line etc)
System.Windows.Controls.Border CreateBorder( BaseStyleDecorator column) System.Windows.Controls.Border CreateBorder( BaseStyleDecorator column,double thickness,double cornerRadius)
{ {
var border = new System.Windows.Controls.Border(); var border = new System.Windows.Controls.Border();
border.Padding = new Thickness(1); border.Padding = new Thickness(1);
border.BorderThickness = new Thickness(2); border.BorderThickness = new Thickness(thickness);
border.CornerRadius = new CornerRadius(2); border.CornerRadius = new CornerRadius(cornerRadius);
border.BorderBrush = ConvertBrush(column.ForeColor); border.BorderBrush = ConvertBrush(column.ForeColor);
return border; return border;
} }
@ -157,13 +161,9 @@ namespace ICSharpCode.Reports.Core.WPF
} }
else else
{ {
var border = CreateBorder(decorator as BaseStyleDecorator);
RectangleShape rs = decorator.Shape as RectangleShape; RectangleShape rs = decorator.Shape as RectangleShape;
border.CornerRadius = new CornerRadius(rs.CornerRadius); var border = CreateBorder(decorator as BaseStyleDecorator,decorator.Thickness,rs.CornerRadius);
border.BorderThickness = new Thickness(decorator.Thickness);
border.BorderBrush = ConvertBrush(decorator.ForeColor); border.BorderBrush = ConvertBrush(decorator.ForeColor);
border.Background = ConvertBrush(decorator.BackColor); border.Background = ConvertBrush(decorator.BackColor);

Loading…
Cancel
Save