Browse Source

Cleanup

reports
Peter Forstmeier 12 years ago
parent
commit
2240ff4bdf
  1. 2
      src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd
  2. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs
  3. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ReportingLanguageRuntime.cs
  4. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs
  5. 59
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs
  6. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs

2
src/AddIns/Analysis/CodeQuality/Reporting/DependencyReport.srd

@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@
<CanGrow>False</CanGrow>
<CanShrink>False</CanShrink>
<RTL>No</RTL>
<Text>=Today()</Text>
<Text>=Today</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>Black</FrameColor>
<ForeColor>ControlText</ForeColor>

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionDataSource.cs

@ -72,12 +72,8 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -72,12 +72,8 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
throw new ArgumentNullException("reportSettings");
baseList = CreateBaseList(list);
CurrentList = baseList;
// this.elementType = elementType;
this.reportSettings = reportSettings;
this.listProperties = this.baseList.GetItemProperties(null);
OrderGroup = OrderGroup.AsIs;
}
@ -130,7 +126,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -130,7 +126,6 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
var sortProperty = listProperties.Find(reportSettings.SortColumnsCollection[0].ColumnName,true);
if(reportSettings.SortColumnsCollection.Count == 1) {
sortedList = baseList.OrderBy(o => o.GetType().GetProperty(sortProperty.Name).GetValue(o, null) );
}
return sortedList;
}
@ -145,7 +140,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -145,7 +140,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
OrderGroup = OrderGroup.Grouped;
GroupedList = GroupInternal();
}
IEnumerable<IGrouping<object, object>> GroupInternal () {
var groupProperty = listProperties.Find(reportSettings.GroupColumnsCollection[0].ColumnName,true);
@ -160,6 +155,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -160,6 +155,7 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
return groupedList;
}
#endregion
public void Bind()

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ReportingLanguageRuntime.cs

@ -38,8 +38,7 @@ namespace ICSharpCode.Reporting.Expressions.Irony @@ -38,8 +38,7 @@ namespace ICSharpCode.Reporting.Expressions.Irony
base.Init();
//add built-in methods, special form IIF, import Math and Environment methods
// BuiltIns.AddMethod(BuiltInPrintMethod, "print");
// BuiltIns.AddMethod(BuiltInFormatMethod, "format");
http://irony.codeplex.com/discussions/446823
// BuiltIns.AddMethod(BuiltInFormatMethod, "format");
BuiltIns.AddSpecialForm(SpecialFormsLibrary.Iif, "iif", 3, 3);
BuiltIns.ImportStaticMembers(typeof(System.Math));
BuiltIns.ImportStaticMembers(typeof(Environment));

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/StandardFormatter.cs

@ -123,7 +123,7 @@ namespace ICSharpCode.Reporting.Globals @@ -123,7 +123,7 @@ namespace ICSharpCode.Reporting.Globals
CultureInfo.CurrentCulture.NumberFormat);
str = dec.ToString (format,CultureInfo.CurrentCulture);
} catch (FormatException e) {
} catch (FormatException) {
throw ;
}
return str;

59
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/BasePageBuilder.cs

@ -40,8 +40,7 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -40,8 +40,7 @@ namespace ICSharpCode.Reporting.PageBuilder
public class BasePageBuilder:IReportCreator
{
public BasePageBuilder(IReportModel reportModel)
{
public BasePageBuilder(IReportModel reportModel){
if (reportModel == null) {
throw new ArgumentNullException("reportModel");
}
@ -52,8 +51,7 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -52,8 +51,7 @@ namespace ICSharpCode.Reporting.PageBuilder
#region create Report Sections
void BuildReportHeader()
{
void BuildReportHeader(){
if (Pages.Count == 0) {
var header = CreateSection(ReportModel.ReportHeader,CurrentLocation);
var r = new Rectangle(header.Location.X, header.Location.Y, header.Size.Width, header.Size.Height);
@ -63,8 +61,7 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -63,8 +61,7 @@ namespace ICSharpCode.Reporting.PageBuilder
}
void BuildPageHeader()
{
void BuildPageHeader(){
var pageHeader = CreateSection(ReportModel.PageHeader,CurrentLocation);
DetailStart = new Point(ReportModel.ReportSettings.LeftMargin,pageHeader.Location.Y + pageHeader.DesiredSize.Height +1);
AddSectionToPage(pageHeader);
@ -76,38 +73,26 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -76,38 +73,26 @@ namespace ICSharpCode.Reporting.PageBuilder
ReportModel.ReportSettings.PageSize.Height - ReportModel.ReportSettings.BottomMargin - ReportModel.PageFooter.Size.Height);
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
Console.WriteLine("pagefooter at {0} ehight {1}",CurrentLocation, pageFooter.Size);
pageFooter.BackColor = System.Drawing.Color.LightGray;
var pageFooter = CreateSection(ReportModel.PageFooter,CurrentLocation);
DetailEnds = new Point(pageFooter.Location.X + pageFooter.Size.Width,pageFooter.Location.Y -1);
AddSectionToPage(pageFooter);
}
void AddSectionToPage(IExportContainer header)
{
void AddSectionToPage(IExportContainer header){
header.Parent = CurrentPage;
CurrentPage.ExportedItems.Add(header);
}
protected void BuildReportFooter()
{
protected void BuildReportFooter(){
var lastSection = CurrentPage.ExportedItems.Last();
// CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
// lastSection.Location.Y - lastSection.Size.Height - 1);
//
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
lastSection.Location.Y - ReportModel.ReportFooter.Size.Height - 2);
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
reportFooter.BackColor = Color.Red;
Console.WriteLine("reportfooter {0} - {1} ",reportFooter.Location,reportFooter.Size);
// if (reportFooter.ExportedItems.Any()) {
var reportFooter = CreateSection(ReportModel.ReportFooter,CurrentLocation);
if (reportFooter.ExportedItems.Any()) {
AddSectionToPage(reportFooter);
// }
}
}
@ -119,17 +104,12 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -119,17 +104,12 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
protected bool PageFull(IExportContainer container) {
if (container.DisplayRectangle.Bottom > DetailEnds.Y) {
return true;
}
return false;
return container.DisplayRectangle.Bottom > DetailEnds.Y;
}
#endregion
protected IExportContainer CreateSection(IReportContainer container,Point location)
{
protected IExportContainer CreateSection(IReportContainer container,Point location){
var containerConverter = new ContainerConverter(location);
var convertedContainer = containerConverter.ConvertToExportContainer(container);
@ -151,8 +131,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -151,8 +131,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
}
protected static void ArrangeContainer(IExportContainer exportContainer)
{
protected static void ArrangeContainer(IExportContainer exportContainer){
var exportArrange = exportContainer.GetArrangeStrategy();
exportArrange.Arrange(exportContainer);
}
@ -161,8 +140,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -161,8 +140,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
#region Pagehandling
IPageInfo CreatePageInfo()
{
IPageInfo CreatePageInfo(){
var pi = new PageInfo();
pi.PageNumber = Pages.Count +1;
pi.ReportName = ReportModel.ReportSettings.ReportName;
@ -176,8 +154,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -176,8 +154,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
}
protected virtual ExportPage CreateNewPage()
{
protected virtual ExportPage CreateNewPage(){
var page = InitNewPage();
CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,ReportModel.ReportSettings.TopMargin);
return page;
@ -191,8 +168,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -191,8 +168,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
}
public virtual void BuildExportList()
{
public virtual void BuildExportList(){
Pages.Clear();
CurrentPage = CreateNewPage ();
WriteStandardSections();
@ -215,8 +191,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin, @@ -215,8 +191,7 @@ CurrentLocation = new Point(ReportModel.ReportSettings.LeftMargin,
}
protected void RunDebugVisitor()
{
protected void RunDebugVisitor(){
var debugExporter = new DebugExporter(Pages);
debugExporter.Run();
}

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs

@ -159,9 +159,6 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -159,9 +159,6 @@ namespace ICSharpCode.Reporting.PageBuilder
sectionContainer.Location = pagePosition;
}
// sectionContainer.ExportedItems.AddRange(convertedItems);
// MeasureAndArrangeContainer(sectionContainer);
exportRows.Add(sectionContainer);
pagePosition = new Point(CurrentSection.Location.X, pagePosition.Y + sectionContainer.DesiredSize.Height + 1);
}

Loading…
Cancel
Save