Browse Source

Add patches from Alex Rednic , center page in ReportViewer, better drawing of bitmap

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5502 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 16 years ago
parent
commit
f39aff62c8
  1. 37
      samples/SharpDevelopReports/SampleReports/Ilist/ContributorsList.srd
  2. 35
      samples/SharpDevelopReports/SampleReports/ProviderIndependent/NoConnectionReport.srd
  3. 7
      samples/SharpDevelopReports/src/SharpReportSamples/MainForm.cs
  4. 15
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/ReportViewer/ReportViewer.cs

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

@ -2,28 +2,27 @@ @@ -2,28 +2,27 @@
<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>DataReport</ReportType>
<DataModel>PushData</DataModel>
<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>PushData</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>DataReport</ReportType>
<ConnectionString />
</ReportSettings>
</ReportSettings>
<SectionCollection>
@ -87,8 +86,8 @@ @@ -87,8 +86,8 @@
<Size>661, 42</Size>
<ScaleImageToSize>False</ScaleImageToSize>
<BackColor>Window</BackColor>
<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>
<RelativeFileName>..\Logos\Bannerbeige2.gif</RelativeFileName>
<ImageFileName>D:\SharpDevelop3.0_CHECKOUT\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName>
</BaseImageItem>
<BaseLineItem>
<StartLineCap>Flat</StartLineCap>

35
samples/SharpDevelopReports/SampleReports/ProviderIndependent/NoConnectionReport.srd

@ -2,25 +2,11 @@ @@ -2,25 +2,11 @@
<ReportModel>
<ReportSettings>
<ReportSettings>
<GridSize>8, 8</GridSize>
<PageSize>827, 1169</PageSize>
<CommandText>SELECT * FROM Kategorien</CommandText>
<Landscape>False</Landscape>
<GroupColumnsCollection />
<RightMargin>50</RightMargin>
<NoDataMessage>No Data for this Report</NoDataMessage>
<DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<ReportType>DataReport</ReportType>
<DataModel>PullData</DataModel>
<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>PullData</DataModel>
<BottomMargin>50</BottomMargin>
<AvailableFieldsCollection>
<AbstractColumn>
<ColumnName>Kategorie-Nr</ColumnName>
@ -39,13 +25,26 @@ @@ -39,13 +25,26 @@
<DataTypeName>System.Byte[]</DataTypeName>
</AbstractColumn>
</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>
<BasicParameter>
<ParameterName>p1</ParameterName>
<ParameterValue>aaaaa</ParameterValue>
</BasicParameter>
</ParameterCollection>
<Landscape>False</Landscape>
<ReportName>Report1</ReportName>
<TopMargin>50</TopMargin>
<GroupColumnsCollection />
<GraphicsUnit>Millimeter</GraphicsUnit>
<CommandText>SELECT * FROM Kategorien</CommandText>
<ReportType>DataReport</ReportType>
<ConnectionString />
</ReportSettings>
</ReportSettings>
<SectionCollection>
@ -311,7 +310,7 @@ @@ -311,7 +310,7 @@
<BackColor>Gainsboro</BackColor>
<CanShrink>False</CanShrink>
<StringTrimming>None</StringTrimming>
<Text>'This Report contains : ' + count() + ' DataRows'</Text>
<Text>='This Report contains : ' + count() + ' DataRows'</Text>
<Location>5, 4</Location>
<ContentAlignment>MiddleCenter</ContentAlignment>
<Visible>True</Visible>

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

@ -135,7 +135,7 @@ namespace SharpReportSamples @@ -135,7 +135,7 @@ namespace SharpReportSamples
{
this.RunProviderIndependent(reportName);
};
this.previewControl1.SetupAsynchron(reportName,parameters);
this.previewControl1.RunReport(reportName,parameters);
}
@ -153,6 +153,11 @@ namespace SharpReportSamples @@ -153,6 +153,11 @@ namespace SharpReportSamples
{
ReportModel model = ReportEngine.LoadReportModel(fileName);
// sorting is done here, but, be carefull, misspelled fieldnames will cause an exception
//ReportSettings settings = model.ReportSettings;
//settings.SortColumnCollection.Add(new SortColumn("First",System.ComponentModel.ListSortDirection.Ascending));
// Both variable declarations are valid
ContributorCollection contributorCollection = ContributorsReportData.CreateContributorsList();

15
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/ReportViewer/ReportViewer.cs

@ -353,6 +353,10 @@ namespace ICSharpCode.Reports.Core.ReportViewer @@ -353,6 +353,10 @@ namespace ICSharpCode.Reports.Core.ReportViewer
this.Invalidate(true);
this.Update();
this.AdjustDrawArea();
if ((this.pages != null) && (pageNumber < pages.Count))
{
this.ShowSelectedPage();
}
EventHelper.Raise<EventArgs>(this.PreviewLayoutChanged,this,e);
}
@ -437,9 +441,20 @@ namespace ICSharpCode.Reports.Core.ReportViewer @@ -437,9 +441,20 @@ namespace ICSharpCode.Reports.Core.ReportViewer
}
private void CenterDisplayPanel()
{
if (this.Width > drawingPanel.Width)
drawingPanel.Left = (this.Width - drawingPanel.Width) / 2;
else
drawingPanel.Left = 3;
}
private void DrawingPanelPaint(object sender, PaintEventArgs e)
{
e.Graphics.Clear(this.drawingPanel.BackColor);
CenterDisplayPanel();
if (this.bitmap != null) {
e.Graphics.DrawImage(this.bitmap,0,0);
}

Loading…
Cancel
Save