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. 18
      src/AddIns/Misc/Reports/ICSharpCode.Reports.Core/Project/WPF/FixedDocumentCreator.cs

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

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

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

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

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

@ -153,9 +153,9 @@ namespace SharpReportSamples @@ -153,9 +153,9 @@ namespace SharpReportSamples
private void RunContributors (string fileName)
{
ReportModel model = ReportEngine.LoadReportModel(fileName);
Console.WriteLine(model.ReportSettings.PageSize);
model.ReportSettings.PageSize = new Size(model.ReportSettings.PageSize.Width,400);
Console.WriteLine(model.ReportSettings.PageSize);
// Console.WriteLine(model.ReportSettings.PageSize);
// model.ReportSettings.PageSize = new Size(model.ReportSettings.PageSize.Width,400);
// Console.WriteLine(model.ReportSettings.PageSize);
// 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

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

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

@ -58,6 +58,7 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -58,6 +58,7 @@ namespace ICSharpCode.Reports.Core.Exporter
{
ExporterCollection exporterCollection = new ExporterCollection();
base.CurrentPosition = base.SectionBounds.Offset;
var p = base.CurrentPosition;
BaseSection section = parent as BaseSection;
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 @@ -46,9 +46,12 @@ namespace ICSharpCode.Reports.Core.Exporter
{
if (base.Pages.Count == 0)
{
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);
base.SinglePage.Items.AddRange(convertedList);
Console.WriteLine("reportheader {0}",SectionBounds.Offset);
}
}
@ -57,13 +60,16 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -57,13 +60,16 @@ namespace ICSharpCode.Reports.Core.Exporter
if (SectionBounds.Offset.Y < 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);
base.SinglePage.Items.AddRange(convertedList);
base.SectionBounds.CalculatePageBounds(base.ReportModel);
Console.WriteLine("pageheader {0}",SectionBounds.Offset);
}
protected override void BuildDetailInternal(BaseSection section)
{
Console.WriteLine("a detail {0}",SectionBounds.Offset);
base.BuildDetailInternal(section);
SectionBounds.Offset = new Point(SectionBounds.Offset.X,base.ReportModel.DetailSection.Location.Y);
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 @@ -27,6 +27,9 @@ namespace ICSharpCode.Reports.Core.Exporter
for (int i = 0; i < section.Items.Count; 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);
}
@ -35,8 +38,15 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -35,8 +38,15 @@ namespace ICSharpCode.Reports.Core.Exporter
{
if (oldItem == item) {
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 @@ -31,6 +31,9 @@ namespace ICSharpCode.Reports.Core.Globals
private const string tableName = "Table";
private const int defaultZoomfactor = 1;
private const int gapBetweenRows = 1;
//WPF
private const double defaultCornerRadius = 2;
private static double defaulThickness = 2;
private GlobalValues()
{
@ -39,7 +42,6 @@ namespace ICSharpCode.Reports.Core.Globals @@ -39,7 +42,6 @@ namespace ICSharpCode.Reports.Core.Globals
#region some usefull functions and methodes
private static bool IsSpoolerRunning()
{
ServiceController[] services;
@ -74,22 +76,6 @@ namespace ICSharpCode.Reports.Core.Globals @@ -74,22 +76,6 @@ namespace ICSharpCode.Reports.Core.Globals
#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
/// <summary>
@ -107,12 +93,8 @@ namespace ICSharpCode.Reports.Core.Globals @@ -107,12 +93,8 @@ namespace ICSharpCode.Reports.Core.Globals
/// The default Size of a Section
/// used in <see cref="ReportGenerator"
/// </summary>
public static int DefaultSectionHeight
{
get {
return 60;
}
}
public static int DefaultSectionHeight {get {return 60;}}
/// <summary>
/// Default zoom Factor for all typ's of preview
@ -125,12 +107,7 @@ namespace ICSharpCode.Reports.Core.Globals @@ -125,12 +107,7 @@ namespace ICSharpCode.Reports.Core.Globals
public static Size PreferedSize
{
get {
return new Size(100,20);
}
}
public static Size PreferedSize {get {return new Size(100,20);}}
public static Size DefaultPageSize {get {return new Size(827,1169);}}
@ -142,15 +119,6 @@ namespace ICSharpCode.Reports.Core.Globals @@ -142,15 +119,6 @@ namespace ICSharpCode.Reports.Core.Globals
#region String Constant's
/*
public static string ReportString
{
get {
return reportString;
}
}
*/
public static string ReportExtension
{
get {
@ -172,10 +140,7 @@ namespace ICSharpCode.Reports.Core.Globals @@ -172,10 +140,7 @@ namespace ICSharpCode.Reports.Core.Globals
}
}
// public static string UnboundName
// {
// get {return unbound;}
// }
public static string TableName
{
@ -184,29 +149,9 @@ namespace ICSharpCode.Reports.Core.Globals @@ -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
#region Printing
public static int GapBetweenContainer {
@ -291,6 +236,15 @@ namespace ICSharpCode.Reports.Core.Globals @@ -291,6 +236,15 @@ namespace ICSharpCode.Reports.Core.Globals
#endregion
#region Wpf
public static double DefaultCornerRadius {get {return defaultCornerRadius;}}
public static double DefaultBorderThickness {get {return defaulThickness;}}
#endregion
#region Icons
/// <summary>

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

@ -79,8 +79,12 @@ namespace ICSharpCode.Reports.Core.WPF @@ -79,8 +79,12 @@ namespace ICSharpCode.Reports.Core.WPF
var text = column as ExportText;
if (text != null) {
var t = CreateTextBlock(text);
if (column.StyleDecorator.DrawBorder) {
border = CreateBorder(column.StyleDecorator as BaseStyleDecorator);
border = CreateBorder(column.StyleDecorator as BaseStyleDecorator,
GlobalValues.DefaultBorderThickness,
GlobalValues.DefaultCornerRadius );
border.Child = t;
element = border;
}
@ -104,12 +108,12 @@ namespace ICSharpCode.Reports.Core.WPF @@ -104,12 +108,12 @@ namespace ICSharpCode.Reports.Core.WPF
#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();
border.Padding = new Thickness(1);
border.BorderThickness = new Thickness(2);
border.CornerRadius = new CornerRadius(2);
border.BorderThickness = new Thickness(thickness);
border.CornerRadius = new CornerRadius(cornerRadius);
border.BorderBrush = ConvertBrush(column.ForeColor);
return border;
}
@ -157,13 +161,9 @@ namespace ICSharpCode.Reports.Core.WPF @@ -157,13 +161,9 @@ namespace ICSharpCode.Reports.Core.WPF
}
else
{
var border = CreateBorder(decorator as BaseStyleDecorator);
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.Background = ConvertBrush(decorator.BackColor);

Loading…
Cancel
Save