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. 21
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Core/Project/ReportViewer/ReportViewer.cs

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

@ -2,28 +2,27 @@
<ReportModel> <ReportModel>
<ReportSettings> <ReportSettings>
<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> <DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<ReportType>DataReport</ReportType> <DataModel>PushData</DataModel>
<RightMargin>50</RightMargin>
<UseStandardPrinter>True</UseStandardPrinter> <UseStandardPrinter>True</UseStandardPrinter>
<CommandType>Text</CommandType>
<GraphicsUnit>Millimeter</GraphicsUnit>
<TopMargin>50</TopMargin>
<ConnectionString />
<Padding>5, 5, 5, 5</Padding>
<LeftMargin>50</LeftMargin>
<SortColumnCollection /> <SortColumnCollection />
<DataModel>PushData</DataModel>
<BottomMargin>50</BottomMargin>
<AvailableFieldsCollection /> <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 /> <ParameterCollection />
<Landscape>False</Landscape>
<ReportName>Report1</ReportName>
<TopMargin>50</TopMargin>
<GroupColumnsCollection />
<GraphicsUnit>Millimeter</GraphicsUnit>
<CommandText />
<ReportType>DataReport</ReportType>
<ConnectionString />
</ReportSettings> </ReportSettings>
</ReportSettings> </ReportSettings>
<SectionCollection> <SectionCollection>
@ -87,8 +86,8 @@
<Size>661, 42</Size> <Size>661, 42</Size>
<ScaleImageToSize>False</ScaleImageToSize> <ScaleImageToSize>False</ScaleImageToSize>
<BackColor>Window</BackColor> <BackColor>Window</BackColor>
<RelativeFileName>D:\Reporting3.0_branches\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</RelativeFileName> <RelativeFileName>..\Logos\Bannerbeige2.gif</RelativeFileName>
<ImageFileName>D:\Reporting3.0_branches\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName> <ImageFileName>D:\SharpDevelop3.0_CHECKOUT\SharpDevelop\samples\SharpDevelopReports\SampleReports\Logos\Bannerbeige2.gif</ImageFileName>
</BaseImageItem> </BaseImageItem>
<BaseLineItem> <BaseLineItem>
<StartLineCap>Flat</StartLineCap> <StartLineCap>Flat</StartLineCap>

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

@ -2,25 +2,11 @@
<ReportModel> <ReportModel>
<ReportSettings> <ReportSettings>
<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> <DefaultFont>Microsoft Sans Serif, 10pt</DefaultFont>
<ReportType>DataReport</ReportType> <DataModel>PullData</DataModel>
<RightMargin>50</RightMargin>
<UseStandardPrinter>True</UseStandardPrinter> <UseStandardPrinter>True</UseStandardPrinter>
<CommandType>Text</CommandType>
<GraphicsUnit>Millimeter</GraphicsUnit>
<TopMargin>50</TopMargin>
<ConnectionString />
<Padding>5, 5, 5, 5</Padding>
<LeftMargin>50</LeftMargin>
<SortColumnCollection /> <SortColumnCollection />
<DataModel>PullData</DataModel>
<BottomMargin>50</BottomMargin>
<AvailableFieldsCollection> <AvailableFieldsCollection>
<AbstractColumn> <AbstractColumn>
<ColumnName>Kategorie-Nr</ColumnName> <ColumnName>Kategorie-Nr</ColumnName>
@ -39,13 +25,26 @@
<DataTypeName>System.Byte[]</DataTypeName> <DataTypeName>System.Byte[]</DataTypeName>
</AbstractColumn> </AbstractColumn>
</AvailableFieldsCollection> </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> <ParameterCollection>
<BasicParameter> <BasicParameter>
<ParameterName>p1</ParameterName> <ParameterName>p1</ParameterName>
<ParameterValue>aaaaa</ParameterValue> <ParameterValue>aaaaa</ParameterValue>
</BasicParameter> </BasicParameter>
</ParameterCollection> </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>
</ReportSettings> </ReportSettings>
<SectionCollection> <SectionCollection>
@ -311,7 +310,7 @@
<BackColor>Gainsboro</BackColor> <BackColor>Gainsboro</BackColor>
<CanShrink>False</CanShrink> <CanShrink>False</CanShrink>
<StringTrimming>None</StringTrimming> <StringTrimming>None</StringTrimming>
<Text>'This Report contains : ' + count() + ' DataRows'</Text> <Text>='This Report contains : ' + count() + ' DataRows'</Text>
<Location>5, 4</Location> <Location>5, 4</Location>
<ContentAlignment>MiddleCenter</ContentAlignment> <ContentAlignment>MiddleCenter</ContentAlignment>
<Visible>True</Visible> <Visible>True</Visible>

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

@ -135,7 +135,7 @@ namespace SharpReportSamples
{ {
this.RunProviderIndependent(reportName); this.RunProviderIndependent(reportName);
}; };
this.previewControl1.SetupAsynchron(reportName,parameters); this.previewControl1.RunReport(reportName,parameters);
} }
@ -153,6 +153,11 @@ namespace SharpReportSamples
{ {
ReportModel model = ReportEngine.LoadReportModel(fileName); 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 // Both variable declarations are valid
ContributorCollection contributorCollection = ContributorsReportData.CreateContributorsList(); ContributorCollection contributorCollection = ContributorsReportData.CreateContributorsList();

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

@ -353,6 +353,10 @@ namespace ICSharpCode.Reports.Core.ReportViewer
this.Invalidate(true); this.Invalidate(true);
this.Update(); this.Update();
this.AdjustDrawArea(); this.AdjustDrawArea();
if ((this.pages != null) && (pageNumber < pages.Count))
{
this.ShowSelectedPage();
}
EventHelper.Raise<EventArgs>(this.PreviewLayoutChanged,this,e); EventHelper.Raise<EventArgs>(this.PreviewLayoutChanged,this,e);
} }
@ -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) private void DrawingPanelPaint(object sender, PaintEventArgs e)
{ {
e.Graphics.Clear(this.drawingPanel.BackColor); e.Graphics.Clear(this.drawingPanel.BackColor);
CenterDisplayPanel();
if (this.bitmap != null) { if (this.bitmap != null) {
e.Graphics.DrawImage(this.bitmap,0,0); e.Graphics.DrawImage(this.bitmap,0,0);
} }
@ -726,15 +741,15 @@ namespace ICSharpCode.Reports.Core.ReportViewer
} }
this.ShowCompleted(); this.ShowCompleted();
} }
*/ */
/* /*
private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{ {
this.pageNumber = e.ProgressPercentage; this.pageNumber = e.ProgressPercentage;
this.ShowSelectedPage(); this.ShowSelectedPage();
} }
*/ */
#endregion #endregion
#region Worker #region Worker

Loading…
Cancel
Save