Browse Source

Work on samples

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@5403 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Peter Forstmeier 16 years ago
parent
commit
0b073747e6
  1. 15
      samples/SharpDevelopReports/SampleReports/ProviderIndependend/NoConnectionReport.srd
  2. 47
      samples/SharpDevelopReports/TestProject/Form2.Designer.cs
  3. 32
      samples/SharpDevelopReports/TestProject/Form2.cs
  4. 31
      samples/SharpDevelopReports/TestProject/Properties/AssemblyInfo.cs
  5. 58
      samples/SharpDevelopReports/TestProject/TestProject.csproj
  6. 90
      samples/SharpDevelopReports/TestProject1/Form2.Designer.cs
  7. 124
      samples/SharpDevelopReports/TestProject1/Form2.cs
  8. 120
      samples/SharpDevelopReports/TestProject1/Form2.resx
  9. 23
      samples/SharpDevelopReports/TestProject1/Program.cs
  10. 31
      samples/SharpDevelopReports/TestProject1/Properties/AssemblyInfo.cs
  11. 68
      samples/SharpDevelopReports/TestProject1/TestProject.csproj
  12. 8
      samples/SharpDevelopReports/src/ReportSamples.sln
  13. 43
      samples/SharpDevelopReports/src/ReportSamples/EmployeesPushModel.cs
  14. 2
      samples/SharpDevelopReports/src/ReportSamples/MainForm.cs
  15. 2
      samples/SharpDevelopReports/src/ReportSamples/ReportSamples.csproj
  16. 18
      samples/SharpDevelopReports/src/SharpReportSamples/MainForm.Designer.cs
  17. 86
      samples/SharpDevelopReports/src/SharpReportSamples/MainForm.cs
  18. 24
      samples/SharpDevelopReports/src/SharpReportSamples/ReportViewerMessagesProvider.cs
  19. 1
      samples/SharpDevelopReports/src/SharpReportSamples/SharpReportSamples.csproj
  20. 2
      src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/ICSharpCode.Reports.Addin.csproj

15
samples/SharpDevelopReports/TestProject/NoConnectionReport.srd → samples/SharpDevelopReports/SampleReports/ProviderIndependend/NoConnectionReport.srd

@ -61,8 +61,8 @@ @@ -61,8 +61,8 @@
<BackColor>White</BackColor>
<CanShrink>False</CanShrink>
<StringTrimming>EllipsisCharacter</StringTrimming>
<Text>'Report1' + p1</Text>
<Location>313, 5</Location>
<Text>='Im a ' + p1 + ' Report'</Text>
<Location>194, 5</Location>
<ContentAlignment>MiddleLeft</ContentAlignment>
<Visible>True</Visible>
<DrawBorder>False</DrawBorder>
@ -71,7 +71,7 @@ @@ -71,7 +71,7 @@
<FormatString />
<Name>Report1</Name>
<FrameColor>WindowFrame</FrameColor>
<Size>100, 20</Size>
<Size>279, 20</Size>
<ForeColor>Black</ForeColor>
</BaseTextItem>
</Items>
@ -193,11 +193,12 @@ @@ -193,11 +193,12 @@
<BaseDataItem>
<DataType>System.Int32</DataType>
<Text>Kategorie-Nr</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>10, 10</Location>
<BaseTableName>Table</BaseTableName>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
<ForeColor>Black</ForeColor>
<StringTrimming>None</StringTrimming>
<ColumnName>Kategorie-Nr</ColumnName>
<DrawBorder>False</DrawBorder>
<CanShrink>False</CanShrink>
@ -212,11 +213,12 @@ @@ -212,11 +213,12 @@
<BaseDataItem>
<DataType>System.String</DataType>
<Text>Kategoriename</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>189, 10</Location>
<BaseTableName>Table</BaseTableName>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
<ForeColor>Black</ForeColor>
<StringTrimming>None</StringTrimming>
<ColumnName>Kategoriename</ColumnName>
<DrawBorder>False</DrawBorder>
<CanShrink>False</CanShrink>
@ -231,11 +233,12 @@ @@ -231,11 +233,12 @@
<BaseDataItem>
<DataType>System.String</DataType>
<Text>Beschreibung</Text>
<Font>Microsoft Sans Serif, 10pt</Font>
<Location>368, 10</Location>
<BaseTableName>Table</BaseTableName>
<Font>Microsoft Sans Serif, 10pt</Font>
<CanGrow>False</CanGrow>
<ForeColor>Black</ForeColor>
<StringTrimming>None</StringTrimming>
<ColumnName>Beschreibung</ColumnName>
<DrawBorder>False</DrawBorder>
<CanShrink>False</CanShrink>

47
samples/SharpDevelopReports/TestProject/Form2.Designer.cs generated

@ -1,47 +0,0 @@ @@ -1,47 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 18.11.2009
* Zeit: 19:29
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
namespace TestProject
{
partial class Form2
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
//
// Form2
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Text = "Form2";
this.Name = "Form2";
}
}
}

32
samples/SharpDevelopReports/TestProject/Form2.cs

@ -1,32 +0,0 @@ @@ -1,32 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 18.11.2009
* Zeit: 19:29
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace TestProject
{
/// <summary>
/// Description of Form2.
/// </summary>
public partial class Form2 : Form
{
public Form2()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
}
}

31
samples/SharpDevelopReports/TestProject/Properties/AssemblyInfo.cs

@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
#region Using directives
using System;
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestProject")]
[assembly: AssemblyCopyright("Copyright 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]

58
samples/SharpDevelopReports/TestProject/TestProject.csproj

@ -1,58 +0,0 @@ @@ -1,58 +0,0 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{925C1A19-F11D-4215-BF30-CEF262D7A749}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Exe</OutputType>
<RootNamespace>TestProject</RootNamespace>
<AssemblyName>TestProject</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="ICSharpCode.Reports.Core">
<HintPath>..\..\..\AddIns\AddIns\Misc\SharpDevelopReports\ICSharpCode.Reports.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form2.cs" />
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
</Project>

90
samples/SharpDevelopReports/TestProject1/Form2.Designer.cs generated

@ -1,90 +0,0 @@ @@ -1,90 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 18.11.2009
* Zeit: 19:29
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
namespace TestProject
{
partial class Form2
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.previewControl1 = new ICSharpCode.Reports.Core.ReportViewer.PreviewControl();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// previewControl1
//
this.previewControl1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.previewControl1.Location = new System.Drawing.Point(42, 35);
this.previewControl1.Messages = null;
this.previewControl1.Name = "previewControl1";
this.previewControl1.Padding = new System.Windows.Forms.Padding(5);
this.previewControl1.Size = new System.Drawing.Size(840, 411);
this.previewControl1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(42, 474);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 1;
this.button1.Text = "Preview";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.Button1Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(807, 474);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 2;
this.button2.Text = "Pdf";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2Click);
//
// Form2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(929, 517);
this.Controls.Add(this.button2);
this.Controls.Add(this.button1);
this.Controls.Add(this.previewControl1);
this.Name = "Form2";
this.Text = "Form2";
this.ResumeLayout(false);
}
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button1;
private ICSharpCode.Reports.Core.ReportViewer.PreviewControl previewControl1;
}
}

124
samples/SharpDevelopReports/TestProject1/Form2.cs

@ -1,124 +0,0 @@ @@ -1,124 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 18.11.2009
* Zeit: 19:29
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
using System.Windows.Forms;
using ICSharpCode.Reports.Core;
using ICSharpCode.Reports.Core.Exporter.ExportRenderer;
namespace TestProject
{
/// <summary>
/// Description of Form2.
/// </summary>
public partial class Form2 : Form
{
// string reportName = @"D:\SharpReport_TestReports\TestReports\FirstAggFunction.srd";
string reportName = @"D:\Reportdesigner3.0\TestProject\NoConnectionReport.srd";
string conOleDbString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\SharpReport_TestReports\TestReports\Nordwind.mdb;Persist Security Info=False";
ReportParameters parameters;
IReportCreator pageBuilder;
public Form2()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//D:\SharpReport_TestReports\TestReports
}
void Button1Click(object sender, EventArgs e)
{
parameters = ReportEngine.LoadParameters(reportName);
ConnectionObject con = ConnectionObject.CreateInstance(this.conOleDbString,
System.Data.Common.DbProviderFactories.GetFactory("System.Data.OleDb") );
parameters.ConnectionObject = con;
ReportEngine engine = new ReportEngine();
engine.SectionRendering += new EventHandler<SectionRenderEventArgs>(PushPrinting);
this.previewControl1.SetupAsynchron(reportName,parameters);
}
private void PushPrinting (object sender,SectionRenderEventArgs e) {
switch (e.CurrentSection) {
case GlobalEnums.ReportSection.ReportHeader:
break;
case GlobalEnums.ReportSection.ReportPageHeader:
break;
case GlobalEnums.ReportSection.ReportDetail:
BaseRowItem ri = e.Section.Items[0] as BaseRowItem;
// if (ri != null) {
// BaseDataItem r = (BaseDataItem)ri.Items.Find("unbound1");
// if (r != null) {
// System.Console.WriteLine("ubound1");
//
// }
// }
break;
case GlobalEnums.ReportSection.ReportPageFooter:
break;
case GlobalEnums.ReportSection.ReportFooter:
break;
default:
break;
}
}
void Button2Click(object sender, EventArgs e)
{
// get Filename to save *.pdf
string saveTo = this.SelectFilename();
// Create connectionobject
parameters = ReportEngine.LoadParameters(reportName);
ConnectionObject con = ConnectionObject.CreateInstance(this.conOleDbString,
System.Data.Common.DbProviderFactories.GetFactory("System.Data.OleDb") );
parameters.ConnectionObject = con;
// create a Pagebuilder
pageBuilder = ReportEngine.CreatePageBuilder(reportName,parameters);
pageBuilder.BuildExportList();
using (PdfRenderer pdfRenderer = PdfRenderer.CreateInstance(pageBuilder,saveTo,true)){
pdfRenderer.Start();
pdfRenderer.RenderOutput();
pdfRenderer.End();
}
}
private string SelectFilename()
{
using (SaveFileDialog saveDialog = new SaveFileDialog()){
saveDialog.FileName = "_pdf";
saveDialog.DefaultExt = "PDF";
saveDialog.ValidateNames = true;
if(saveDialog.ShowDialog() == DialogResult.OK){
return saveDialog.FileName;
} else {
return String.Empty;
}
}
}
}
}

120
samples/SharpDevelopReports/TestProject1/Form2.resx

@ -1,120 +0,0 @@ @@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

23
samples/SharpDevelopReports/TestProject1/Program.cs

@ -1,23 +0,0 @@ @@ -1,23 +0,0 @@
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 18.11.2009
* Zeit: 19:30
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
namespace TestProject
{
public static class Program
{
[STAThread]
public static void Main(string[] args)
{
Form2 frm = new Form2();
frm.ShowDialog();
}
}
}

31
samples/SharpDevelopReports/TestProject1/Properties/AssemblyInfo.cs

@ -1,31 +0,0 @@ @@ -1,31 +0,0 @@
#region Using directives
using System;
using System.Reflection;
using System.Runtime.InteropServices;
#endregion
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TestProject1")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TestProject1")]
[assembly: AssemblyCopyright("Copyright 2009")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// This sets the default COM visibility of types in the assembly to invisible.
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
[assembly: ComVisible(false)]
// The assembly version has following format :
//
// Major.Minor.Build.Revision
//
// You can specify all the values or you can use the default the Revision and
// Build Numbers by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]

68
samples/SharpDevelopReports/TestProject1/TestProject.csproj

@ -1,68 +0,0 @@ @@ -1,68 +0,0 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Exe</OutputType>
<RootNamespace>TestProject1</RootNamespace>
<AssemblyName>TestProject</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<AppDesignerFolder>Properties</AppDesignerFolder>
</PropertyGroup>
<PropertyGroup Condition=" '$(Platform)' == 'x86' ">
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<OutputPath>bin\Debug\</OutputPath>
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<DefineConstants>DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<OutputPath>bin\Release\</OutputPath>
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<ItemGroup>
<Reference Include="ICSharpCode.Reports.Core">
<HintPath>..\..\..\AddIns\AddIns\Misc\SharpDevelopReports\ICSharpCode.Reports.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Form2.cs" />
<Compile Include="Form2.Designer.cs">
<DependentUpon>Form2.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form2.resx">
<DependentUpon>Form2.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\ReportSamples\ReportSamples.csproj">
<Project>{9BFECB53-827E-44BF-9DFD-C15F0A6106BE}</Project>
<Name>ReportSamples</Name>
</ProjectReference>
</ItemGroup>
</Project>

8
samples/SharpDevelopReports/src/ReportSamples.sln

@ -1,13 +1,11 @@ @@ -1,13 +1,11 @@

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
# SharpDevelop 3.2.0.5366
# SharpDevelop 3.2.0.5394
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportSamples", "ReportSamples\ReportSamples.csproj", "{9BFECB53-827E-44BF-9DFD-C15F0A6106BE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpReportSamples", "SharpReportSamples\SharpReportSamples.csproj", "{BB5D34DA-3561-48B1-894A-46765C2A18C1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "..\TestProject1\TestProject.csproj", "{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -22,10 +20,6 @@ Global @@ -22,10 +20,6 @@ Global
{BB5D34DA-3561-48B1-894A-46765C2A18C1}.Debug|Any CPU.ActiveCfg = Debug|x86
{BB5D34DA-3561-48B1-894A-46765C2A18C1}.Release|Any CPU.Build.0 = Release|x86
{BB5D34DA-3561-48B1-894A-46765C2A18C1}.Release|Any CPU.ActiveCfg = Release|x86
{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}.Debug|Any CPU.Build.0 = Debug|x86
{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}.Debug|Any CPU.ActiveCfg = Debug|x86
{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}.Release|Any CPU.Build.0 = Release|x86
{DCB75A8C-ADD7-43E3-BF25-B7DA8D729521}.Release|Any CPU.ActiveCfg = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

43
samples/SharpDevelopReports/src/ReportSamples/EmployeesPushModel.cs

@ -1,43 +0,0 @@ @@ -1,43 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Peter Forstmeier" email="peter.forstmeier@t-online.de"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Data;
using ICSharpCode.Reports.Core;
namespace ReportSamples
{
/// <summary>
/// Description of EmployeesPushModel.
/// </summary>
public class StandartPushModel:BaseSample
{
DataTable dataTable;
public StandartPushModel(){
try {
base.Run();
this.dataTable = base.SelectData();
} catch (Exception e) {
throw e;
}
}
public ReportModel ReportModel
{
get {
return ReportEngine.LoadReportModel(base.ReportName);
}
}
public DataTable DataTable {
get { return dataTable; }
}
}
}

2
samples/SharpDevelopReports/src/ReportSamples/MainForm.cs

@ -40,7 +40,7 @@ namespace ReportSamples @@ -40,7 +40,7 @@ namespace ReportSamples
this.btnReportViewer.Checked = true;
// Localisation of ReportViewer
this.previewControl1.Messages = new ReportViewerMessagesProvider();
// this.previewControl1.Messages = new ReportViewerMessagesProvider();
ShowPath();
}

2
samples/SharpDevelopReports/src/ReportSamples/ReportSamples.csproj

@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
<ItemGroup>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="BaseSample.cs" />
<Compile Include="EmployeesPushModel.cs" />
<Compile Include="EventLogger.cs" />
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
@ -53,7 +52,6 @@ @@ -53,7 +52,6 @@
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="ReportViewerMessagesProvider.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>

18
samples/SharpDevelopReports/src/SharpReportSamples/MainForm.Designer.cs generated

@ -38,11 +38,13 @@ namespace SharpReportSamples @@ -38,11 +38,13 @@ namespace SharpReportSamples
{
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("FormSheet");
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("PullModel");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("IList");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Sample Reports", new System.Windows.Forms.TreeNode[] {
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("PushModel-IList");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Provider Independend");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("Sample Reports", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3});
treeNode3,
treeNode4});
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.treeView1 = new System.Windows.Forms.TreeView();
this.label1 = new System.Windows.Forms.Label();
@ -84,11 +86,13 @@ namespace SharpReportSamples @@ -84,11 +86,13 @@ namespace SharpReportSamples
treeNode2.Name = "PullModelItem";
treeNode2.Text = "PullModel";
treeNode3.Name = "iListNode";
treeNode3.Text = "IList";
treeNode3.Text = "PushModel-IList";
treeNode4.Name = "Knoten0";
treeNode4.Text = "Sample Reports";
treeNode4.Text = "Provider Independend";
treeNode5.Name = "Knoten0";
treeNode5.Text = "Sample Reports";
this.treeView1.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode4});
treeNode5});
this.treeView1.Size = new System.Drawing.Size(132, 444);
this.treeView1.TabIndex = 0;
this.treeView1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TreeView1MouseDoubleClick);
@ -109,7 +113,7 @@ namespace SharpReportSamples @@ -109,7 +113,7 @@ namespace SharpReportSamples
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.previewControl1.BackColor = System.Drawing.SystemColors.GradientActiveCaption;
this.previewControl1.Location = new System.Drawing.Point(13, 9);
this.previewControl1.Location = new System.Drawing.Point(68, 10);
this.previewControl1.Messages = null;
this.previewControl1.Name = "previewControl1";
this.previewControl1.Padding = new System.Windows.Forms.Padding(5);

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

@ -24,8 +24,9 @@ namespace SharpReportSamples @@ -24,8 +24,9 @@ namespace SharpReportSamples
private TreeNode formNode;
private TreeNode pullNode;
private TreeNode pushNode;
private TreeNode iListNode;
private TreeNode providerIndependend;
public MainForm()
{
//
@ -34,6 +35,7 @@ namespace SharpReportSamples @@ -34,6 +35,7 @@ namespace SharpReportSamples
InitializeComponent();
InitTree();
UpdateStatusbar (Application.StartupPath);
this.previewControl1.Messages = new ReportViewerMessagesProvider();
}
@ -52,14 +54,13 @@ namespace SharpReportSamples @@ -52,14 +54,13 @@ namespace SharpReportSamples
this.formNode = this.treeView1.Nodes[0].Nodes[0];
this.pullNode = this.treeView1.Nodes[0].Nodes[1];
// this.pushNode = this.treeView1.Nodes[0].Nodes[2];
this.iListNode = this.treeView1.Nodes[0].Nodes[2];
this.providerIndependend = this.treeView1.Nodes[0].Nodes[3];
AddNodesToTree (this.formNode,startPath + @"FormSheet\" );
AddNodesToTree (this.pullNode,startPath + @"PullModel\" );
// AddNodesToTree (this.pushNode,startPath + @"PushModel\" );
AddNodesToTree (this.iListNode,startPath + @"IList\" );
AddNodesToTree (this.providerIndependend,startPath + @"ProviderIndependend\" );
}
@ -92,7 +93,13 @@ namespace SharpReportSamples @@ -92,7 +93,13 @@ namespace SharpReportSamples
string s = Path.GetFileNameWithoutExtension(reportName);
if (s == "ContributorsList" ) {
this.RunContributors(reportName);
} else {
} else if (s == "NoConnectionReport") {
this.RunProviderIndependend(reportName);
}
else {
ReportParameters parameters = ReportEngine.LoadParameters(reportName);
@ -104,6 +111,21 @@ namespace SharpReportSamples @@ -104,6 +111,21 @@ namespace SharpReportSamples
}
}
#region ProviderIndependend
private void RunProviderIndependend (string reportName)
{
string conOleDbString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\SharpReport_TestReports\TestReports\Nordwind.mdb;Persist Security Info=False";
ReportParameters parameters = ReportEngine.LoadParameters(reportName);
ConnectionObject con = ConnectionObject.CreateInstance(conOleDbString,
System.Data.Common.DbProviderFactories.GetFactory("System.Data.OleDb") );
parameters.ConnectionObject = con;
parameters.SqlParameters[0].ParameterValue = "Provider Independend";
this.previewControl1.SetupAsynchron(reportName,parameters);
}
#endregion
#region Contributors
//
@ -160,30 +182,58 @@ namespace SharpReportSamples @@ -160,30 +182,58 @@ namespace SharpReportSamples
#endregion
private void SelectReport ()
{
void TreeView1MouseDoubleClick(object sender, MouseEventArgs e)
{
TreeNode selectedNode = this.treeView1.SelectedNode;
if ((selectedNode == null)|| (selectedNode.Tag == null)) {
return;
if (selectedNode != null) {
RunStandardReport(selectedNode.Tag.ToString());
}
}
/*
void Button2Click(object sender, EventArgs e)
{
// get Filename to save *.pdf
string saveTo = this.SelectFilename();
if (!String.IsNullOrEmpty(selectedNode.Tag.ToString())) {
if (selectedNode.Parent == this.pushNode) {
MessageBox.Show("PushModel reports not implemented yet");
} else {
RunStandardReport(selectedNode.Tag.ToString());
}
// Create connectionobject
parameters = ReportEngine.LoadParameters(reportName);
ConnectionObject con = ConnectionObject.CreateInstance(this.conOleDbString,
System.Data.Common.DbProviderFactories.GetFactory("System.Data.OleDb") );
parameters.ConnectionObject = con;
// create a Pagebuilder
pageBuilder = ReportEngine.CreatePageBuilder(reportName,parameters);
pageBuilder.BuildExportList();
using (PdfRenderer pdfRenderer = PdfRenderer.CreateInstance(pageBuilder,saveTo,true)){
pdfRenderer.Start();
pdfRenderer.RenderOutput();
pdfRenderer.End();
}
}
void TreeView1MouseDoubleClick(object sender, MouseEventArgs e)
private string SelectFilename()
{
SelectReport();
using (SaveFileDialog saveDialog = new SaveFileDialog()){
saveDialog.FileName = "_pdf";
saveDialog.DefaultExt = "PDF";
saveDialog.ValidateNames = true;
if(saveDialog.ShowDialog() == DialogResult.OK){
return saveDialog.FileName;
} else {
return String.Empty;
}
}
}
*/
}
}

24
samples/SharpDevelopReports/src/ReportSamples/ReportViewerMessagesProvider.cs → samples/SharpDevelopReports/src/SharpReportSamples/ReportViewerMessagesProvider.cs

@ -1,19 +1,20 @@ @@ -1,19 +1,20 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Peter Forstmeier" email="peter.forstmeier@t-online.de"/>
// <version>$Revision$</version>
// </file>
/*
* Erstellt mit SharpDevelop.
* Benutzer: Peter Forstmeier
* Datum: 14.01.2010
* Zeit: 20:08
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
namespace ReportSamples
namespace SharpReportSamples
{
/// <summary>
/// This class is used to localise ReportViewer
/// Description of ReportViewerMessagesProvider.
/// </summary>
internal class ReportViewerMessagesProvider:ICSharpCode.Reports.Core.ReportViewer.IReportViewerMessages
public class ReportViewerMessagesProvider:ICSharpCode.Reports.Core.ReportViewer.IReportViewerMessages
{
public ReportViewerMessagesProvider(){
}
@ -74,4 +75,3 @@ namespace ReportSamples @@ -74,4 +75,3 @@ namespace ReportSamples
}
}
}

1
samples/SharpDevelopReports/src/SharpReportSamples/SharpReportSamples.csproj

@ -57,6 +57,7 @@ @@ -57,6 +57,7 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ReportViewerMessagesProvider.cs" />
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>

2
src/AddIns/Misc/SharpReport/ICSharpCode.Reports.Addin/ICSharpCode.Reports.Addin.csproj

@ -25,6 +25,8 @@ @@ -25,6 +25,8 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>Full</DebugType>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<StartAction>Program</StartAction>
<StartProgram>..\..\..\..\..\bin\SharpDevelop.exe</StartProgram>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<Optimize>True</Optimize>

Loading…
Cancel
Save