Browse Source

use only DataItems in DataManager/Listhandling/CollectionSource.cs

reports
Peter Forstmeier 13 years ago
parent
commit
e50031284c
  1. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/MeasurementStrategy.cs
  2. 7
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionSource.cs
  3. 26
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ExportRenderer/FixedDocumentCreator.cs
  4. 3
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Arrange/MeasurementStrategy.cs

@ -35,9 +35,9 @@ namespace ICSharpCode.Reporting.Arrange @@ -35,9 +35,9 @@ namespace ICSharpCode.Reporting.Arrange
if (tbi != null) {
element.DesiredSize = MeasurementService.Measure(tbi,graphics);
}
Console.WriteLine("Measure -> {0} - {1}",element.Size,element.DesiredSize);
}
exportColumn.DesiredSize = exportColumn.Size;
return exportColumn.Size;
return exportColumn.DesiredSize;
}
}

7
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/DataManager/Listhandling/CollectionSource.cs

@ -131,12 +131,15 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling @@ -131,12 +131,15 @@ namespace ICSharpCode.Reporting.DataManager.Listhandling
public void Fill(List<IPrintableObject> collection)
{
foreach (IDataItem item in collection)
foreach (IPrintableObject item in collection)
{
FillInternal(item);
if (item is IDataItem) {
FillInternal(item as IDataItem);
}
}
}
void FillInternal (IDataItem item) {
item.DBValue = String.Empty;
var p = listProperties.Find(item.ColumnName,true);

26
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/ExportRenderer/FixedDocumentCreator.cs

@ -64,25 +64,27 @@ namespace ICSharpCode.Reporting.ExportRenderer @@ -64,25 +64,27 @@ namespace ICSharpCode.Reporting.ExportRenderer
public TextBlock CreateTextBlock(ExportText exportText)
{
var textBlock = new TextBlock();
textBlock.Text = exportText.Text;
// textBlock.Text = exportText.Text;
textBlock.Width = exportText.DesiredSize.Width;
textBlock.Height = exportText.DesiredSize.Height;
textBlock.Foreground = ConvertBrush(exportText.ForeColor);
SetFont(textBlock,exportText);
textBlock.Background = ConvertBrush(exportText.BackColor);
textBlock.TextWrapping = TextWrapping.WrapWithOverflow;
// string [] inlines = exportText.Text.Split(System.Environment.NewLine.ToCharArray());
// textBlock.TextWrapping = TextWrapping.NoWrap;
string [] inlines = exportText.Text.Split(System.Environment.NewLine.ToCharArray());
//string [] inlines = "jmb,.n,knn-.n.-n.n-.n.n.-";
// for (int i = 0; i < inlines.Length; i++) {
// if (inlines[i].Length > 0) {
// textBlock.Inlines.Add(new Run(inlines[i]));
//// textBlock.Inlines.Add(new LineBreak());
// }
// }
// var li = textBlock.Inlines.LastInline;
// textBlock.Inlines.Remove(li);
for (int i = 0; i < inlines.Length; i++) {
if (inlines[i].Length > 0) {
textBlock.Inlines.Add(new Run(inlines[i]));
textBlock.Inlines.Add(new LineBreak());
}
}
var li = textBlock.Inlines.LastInline;
textBlock.Inlines.Remove(li);
// SetDimension(textBlock,exportText.StyleDecorator);
// textBlock.Background = ConvertBrush(exportText.StyleDecorator.BackColor);
// SetContendAlignment(textBlock,exportText.StyleDecorator);

3
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/Converter/ContainerConverter.cs

@ -41,9 +41,8 @@ namespace ICSharpCode.Reporting.PageBuilder.Converter @@ -41,9 +41,8 @@ namespace ICSharpCode.Reporting.PageBuilder.Converter
public List<IExportColumn> CreateConvertedList(IReportContainer reportContainer,
Point position){
//Console.WriteLine("CreateConvertedList {0}",reportContainer.Name);
var itemsList = new List<IExportColumn>();
foreach (var item in reportContainer.Items) {
var exportColumn = ExportColumnFactory.CreateItem(item);

Loading…
Cancel
Save