Browse Source

Start working on absolute and relative FileName's for Images

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5435 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 16 years ago
parent
commit
413ec91c9e
  1. 54
      samples/SharpDevelopReports/SampleReports/FormSheet/JCA.srd
  2. 1
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs
  3. 5
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs
  4. 10
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs
  5. 16
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs
  6. 5
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Exporter/Converters/RowConverter.cs
  7. 10
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs
  8. 1
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs
  9. 1
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs
  10. 2
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/ReportSettings.cs

54
samples/SharpDevelopReports/SampleReports/FormSheet/JCA.srd

@ -2,28 +2,28 @@ @@ -2,28 +2,28 @@
<ReportModel>
<ReportSettings>
<ReportSettings>
<GridSize>8, 8</GridSize>
<PageSize>827, 1169</PageSize>
<CommandText />
<Landscape>False</Landscape>
<GroupColumnsCollection />
<RightMargin>50</RightMargin>
<NoDataMessage>No Data for this Report</NoDataMessage>
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<ReportType>FormSheet</ReportType>
<DataModel>FormSheet</DataModel>
<FileName>Report1.srd</FileName>
<RightMargin>50</RightMargin>
<UseStandardPrinter>True</UseStandardPrinter>
<CommandType>Text</CommandType>
<GraphicsUnit>Millimeter</GraphicsUnit>
<TopMargin>50</TopMargin>
<ConnectionString />
<Padding>5, 5, 5, 5</Padding>
<LeftMargin>50</LeftMargin>
<SortColumnCollection />
<DataModel>FormSheet</DataModel>
<BottomMargin>50</BottomMargin>
<AvailableFieldsCollection />
<ReportName>Report1</ReportName>
<NoDataMessage>No Data for this Report</NoDataMessage>
<LeftMargin>50</LeftMargin>
<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>FormSheet</ReportType>
<ConnectionString />
</ReportSettings>
</ReportSettings>
<SectionCollection>
@ -42,7 +42,7 @@ @@ -42,7 +42,7 @@
<Size>582, 50</Size>
<ScaleImageToSize>False</ScaleImageToSize>
<BackColor>Window</BackColor>
<RelativeFileName>D:\SharpReportTester\TestReports\GoodFiles\Logos\Bannerbeige2.gif</RelativeFileName>
<RelativeFileName>D:\Reporting3.0_branches\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</RelativeFileName>
<ImageFileName>D:\Reporting3.0_branches\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName>
</BaseImageItem>
</Items>
@ -63,16 +63,16 @@ @@ -63,16 +63,16 @@
<StringTrimming>None</StringTrimming>
<Text>#develop Open Source Project
Joint Copyright Assignment by Contributor To AlphaSierraPapa</Text>
<Location>90, 10</Location>
<Location>92, 10</Location>
<ContentAlignment>TopCenter</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 14pt, style=Bold</Font>
<CanGrow>False</CanGrow>
<FormatString />
<Name>reportTextItem1</Name>
<FrameColor>WindowFrame</FrameColor>
<Size>599, 57</Size>
<Size>597, 57</Size>
<ForeColor>ControlText</ForeColor>
</BaseTextItem>
<BaseLineItem>
@ -115,7 +115,7 @@ ______________________________________ Telephone :____________________ @@ -115,7 +115,7 @@ ______________________________________ Telephone :____________________
Country:_______________________________ Facsimile :_________________________</Text>
<Location>50, 8</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>True</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
@ -135,7 +135,7 @@ Country:_______________________________ Facsimile :_______________ @@ -135,7 +135,7 @@ Country:_______________________________ Facsimile :_______________
incorporation into the technology made available under the #develop open source project.</Text>
<Location>50, 171</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>True</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
@ -158,7 +158,7 @@ Country:_______________________________ Facsimile :_______________ @@ -158,7 +158,7 @@ Country:_______________________________ Facsimile :_______________
assignments made by Contributor to AlphaSierraPapa under the #develop project.</Text>
<Location>50, 257</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>True</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
@ -176,7 +176,7 @@ Country:_______________________________ Facsimile :_______________ @@ -176,7 +176,7 @@ Country:_______________________________ Facsimile :_______________
Contribution that violates any law or breaches any contract.</Text>
<Location>50, 380</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
@ -197,7 +197,7 @@ Printed Name:__________________________________ @@ -197,7 +197,7 @@ Printed Name:__________________________________
Please send a signed copy of this assignment by facsimile to AlphaSierraPapa at:</Text>
<Location>50, 443</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>True</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
@ -222,7 +222,7 @@ Vordernbergerstrasse 27/8 @@ -222,7 +222,7 @@ Vordernbergerstrasse 27/8
AUSTRIA</Text>
<Location>50, 551</Location>
<ContentAlignment>TopLeft</ContentAlignment>
<Visible>False</Visible>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>

1
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/DesignerBinding/InternalReportLoader.cs

@ -78,6 +78,7 @@ namespace ICSharpCode.Reports.Addin @@ -78,6 +78,7 @@ namespace ICSharpCode.Reports.Addin
{
ReportDefinitionDeserializer rl = new ReportDefinitionDeserializer(this.host,stream);
this.reportModel = rl.LoadObjectFromFileDefinition();
// FilePathConverter.Absolut2RelativePath(this.reportModel);
}

5
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/ReportDesignerView.cs

@ -699,6 +699,8 @@ namespace ICSharpCode.Reports.Addin @@ -699,6 +699,8 @@ namespace ICSharpCode.Reports.Addin
base.Load(file, stream);
this.LoadDesigner(stream);
this.SetupSecondaryView();
ReportModel m = loader.CreateRenderableModel();
m.ReportSettings.FileName = file.FileName;
}
@ -709,8 +711,9 @@ namespace ICSharpCode.Reports.Addin @@ -709,8 +711,9 @@ namespace ICSharpCode.Reports.Addin
if (hasUnmergedChanges) {
this.MergeFormChanges();
}
ReportModel m = loader.CreateRenderableModel();
using(StreamWriter writer = new StreamWriter(stream)) {
Console.WriteLine (this.ReportFileContent);
writer.Write(this.ReportFileContent);
}
}

10
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/Project/ReportItems/BaseImageItem.cs

@ -25,7 +25,6 @@ namespace ICSharpCode.Reports.Addin @@ -25,7 +25,6 @@ namespace ICSharpCode.Reports.Addin
/// Description of BaseImageItem.
/// </summary>
[Designer(typeof(ICSharpCode.Reports.Addin.ImageDesigner))]
public class BaseImageItem:AbstractItem
{
private string imageFileName;
@ -183,20 +182,23 @@ namespace ICSharpCode.Reports.Addin @@ -183,20 +182,23 @@ namespace ICSharpCode.Reports.Addin
}
// [Category("Image")]
[Browsable(false)]
[Category("Image")]
// [Browsable(false)]
public string RelativeFileName {
get { return relativeFileName; }
set { relativeFileName = value; }
}
[XmlIgnoreAttribute]
// [XmlIgnoreAttribute]
[Category("Image")]
[Browsable(false)]
public string AbsoluteFileName
{
get {
string p1 = Path.GetDirectoryName(this.reportFileName);
string p2 = Path.GetFullPath(relativeFileName);
string s = FileUtility.GetRelativePath(p1,p2);
if (!string.IsNullOrEmpty(relativeFileName)) {
string testFileName = FileUtility.NormalizePath(Path.Combine(Path.GetDirectoryName(this.reportFileName),this.relativeFileName));
if (File.Exists(testFileName)){

16
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/BaseClasses/Printing/PrintHelper.cs

@ -23,27 +23,13 @@ namespace ICSharpCode.Reports.Core @@ -23,27 +23,13 @@ namespace ICSharpCode.Reports.Core
}
#region Layout
public static void SetLayoutForRow (Graphics graphics, ILayouter layouter,BaseSection section)
{
IContainerItem row = section.Items[0] as IContainerItem;
Size containerSize = new Size (section.Items[0].Size.Width,section.Items[0].Size.Height);
BaseReportItem item = row as BaseReportItem;
int extend = item.Size.Height - row.Items[0].Size.Height;
Rectangle textRect = layouter.Layout(graphics,row);
if (textRect.Height >= item.Size.Height) {
item.Size = new Size(item.Size.Width,textRect.Height + extend );
}
section.Items[0].Size = containerSize;
}
public static void SetLayoutForRow (Graphics graphics, ILayouter layouter,IContainerItem row)
{
BaseReportItem item = row as BaseReportItem;
Size containerSize = new Size (item.Size.Width,item.Size.Height);
int extend = item.Size.Height - row.Items[0].Size.Height;
Rectangle textRect = layouter.Layout(graphics,row);
if (textRect.Height >= item.Size.Height) {
if (textRect.Height > item.Size.Height) {
item.Size = new Size(item.Size.Width,textRect.Height + extend );
}
}

5
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Exporter/Converters/RowConverter.cs

@ -66,9 +66,12 @@ namespace ICSharpCode.Reports.Core.Exporter @@ -66,9 +66,12 @@ namespace ICSharpCode.Reports.Core.Exporter
section.Size = this.SectionBounds.DetailSectionRectangle.Size;
base.FireSectionRendering(section);
PrintHelper.SetLayoutForRow(base.Graphics,base.Layouter,section);
Size containerSize = new Size (section.Items[0].Size.Width,section.Items[0].Size.Height);
PrintHelper.SetLayoutForRow(base.Graphics,base.Layouter,row);
mylist.AddRange(this.ConvertTextOnlyRow(parent,item));
section.Items[0].Size = containerSize;
section.SectionOffset += section.Size.Height + 2 * base.SinglePage.SectionBounds.Gap;
Rectangle r = new Rectangle(section.Location.X,section.SectionOffset,
section.Size.Width,section.Size.Height);

10
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/AbstractDataRenderer.cs

@ -85,10 +85,14 @@ namespace ICSharpCode.Reports.Core @@ -85,10 +85,14 @@ namespace ICSharpCode.Reports.Core
if (section.Visible){
//Always set section.size to it's original value
section.Size = this.SectionBounds.DetailSectionRectangle.Size;
PrintHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics,base.Layout,section);
section.Size = this.SectionBounds.DetailSectionRectangle.Size;
Size containerSize = new Size (section.Items[0].Size.Width,section.Items[0].Size.Height);
IContainerItem row =(IContainerItem) section.Items[0];
PrintHelper.SetLayoutForRow(rpea.PrintPageEventArgs.Graphics,base.Layout,row);
section.Render (rpea);
foreach (BaseReportItem item in section.Items) {
if (item.Parent == null) {
item.Parent = section;
@ -100,9 +104,11 @@ namespace ICSharpCode.Reports.Core @@ -100,9 +104,11 @@ namespace ICSharpCode.Reports.Core
rpea.LocationAfterDraw = new Point (rpea.LocationAfterDraw.X,section.SectionOffset + section.Size.Height);
}
section.Items[0].Size = containerSize;
if ((section.CanGrow == false)&& (section.CanShrink == false)) {
return new Point(section.Location.X,section.Size.Height);
}
section.Items[0].Size = containerSize;
return drawPoint;
}

1
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/AbstractRenderer.cs

@ -189,7 +189,6 @@ namespace ICSharpCode.Reports.Core @@ -189,7 +189,6 @@ namespace ICSharpCode.Reports.Core
public static void PageBreak(ReportPageEventArgs pea)
{
System.Console.WriteLine("PageBreak");
if (pea == null) {
throw new ArgumentNullException("pea");
}

1
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/Printing/RenderDataReport.cs

@ -157,7 +157,6 @@ namespace ICSharpCode.Reports.Core { @@ -157,7 +157,6 @@ namespace ICSharpCode.Reports.Core {
tableContainer.DataNavigator = nav;
tableContainer.Parent = base.CurrentSection;
tableContainer.ExpressionEvaluatorFacade = base.ExpressionFassade;
// tableContainer.SinglePage = base.SinglePage;
tableContainer.RenderTable(base.CurrentSection,this.SectionBounds,rpea,this.Layout);
this.ReportDocument.DetailsDone = true;

2
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/ReportSettings.cs

@ -179,7 +179,7 @@ namespace ICSharpCode.Reports.Core{ @@ -179,7 +179,7 @@ namespace ICSharpCode.Reports.Core{
[Category("Base Settings")]
[DefaultValueAttribute ("")]
[XmlIgnoreAttribute]
// [XmlIgnoreAttribute]
public string FileName
{
get {

Loading…
Cancel
Save