diff options
Diffstat (limited to 'src/app')
57 files changed, 2309 insertions, 0 deletions
diff --git a/src/app/PlayingWithActiveReports.Core/Domain/Answer.cs b/src/app/PlayingWithActiveReports.Core/Domain/Answer.cs new file mode 100644 index 0000000..0807a9a --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Domain/Answer.cs @@ -0,0 +1,33 @@ +using System;
+
+namespace PlayingWithActiveReports.Core.Domain {
+ public class Answer : IAnswer, IEquatable< Answer > {
+ public Answer( string answerText ) {
+ _answerText = answerText;
+ }
+
+ public string Text {
+ get { return _answerText; }
+ }
+
+ public bool Equals( Answer answer ) {
+ if( answer == null ) {
+ return false;
+ }
+ return Equals( _answerText, answer._answerText );
+ }
+
+ public override bool Equals( object obj ) {
+ if( ReferenceEquals( this, obj ) ) {
+ return true;
+ }
+ return Equals( obj as Answer );
+ }
+
+ public override int GetHashCode( ) {
+ return _answerText != null ? _answerText.GetHashCode( ) : 0;
+ }
+
+ private readonly string _answerText;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Domain/IAnswer.cs b/src/app/PlayingWithActiveReports.Core/Domain/IAnswer.cs new file mode 100644 index 0000000..b587b60 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Domain/IAnswer.cs @@ -0,0 +1,5 @@ +namespace PlayingWithActiveReports.Core.Domain {
+ public interface IAnswer {
+ string Text { get; }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Domain/IQuestion.cs b/src/app/PlayingWithActiveReports.Core/Domain/IQuestion.cs new file mode 100644 index 0000000..dd8ad1b --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Domain/IQuestion.cs @@ -0,0 +1,8 @@ +namespace PlayingWithActiveReports.Core.Domain {
+ public interface IQuestion {
+ string Text { get; }
+ string Id { get; }
+ IAnswer CurrentAnswer { get; }
+ void ChangeAnswerTo( string answer );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Domain/Question.cs b/src/app/PlayingWithActiveReports.Core/Domain/Question.cs new file mode 100644 index 0000000..d025dea --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Domain/Question.cs @@ -0,0 +1,32 @@ +using System;
+
+namespace PlayingWithActiveReports.Core.Domain {
+ public class Question : IQuestion {
+ public Question( string id, string text ) {
+ _id = id;
+ _text = text;
+ }
+
+ public Question( string text ) : this( Guid.NewGuid( ).ToString( ), text ) {}
+
+ public string Text {
+ get { return _text; }
+ }
+
+ public string Id {
+ get { return _id; }
+ }
+
+ public IAnswer CurrentAnswer {
+ get { return new Answer( _answer ); }
+ }
+
+ public void ChangeAnswerTo( string answer ) {
+ _answer = answer;
+ }
+
+ private readonly string _id;
+ private readonly string _text;
+ private string _answer;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Dto/DisplayReportQuestionDto.cs b/src/app/PlayingWithActiveReports.Core/Dto/DisplayReportQuestionDto.cs new file mode 100644 index 0000000..6a8411c --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Dto/DisplayReportQuestionDto.cs @@ -0,0 +1,19 @@ +namespace PlayingWithActiveReports.Core.Dto {
+ public class DisplayReportQuestionDto {
+ public DisplayReportQuestionDto( string text, string answer ) {
+ _text = text;
+ _answer = answer;
+ }
+
+ public string Text {
+ get { return _text; }
+ }
+
+ public string Answer {
+ get { return _answer; }
+ }
+
+ private readonly string _answer;
+ private readonly string _text;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/PlayingWithActiveReports.Core.csproj b/src/app/PlayingWithActiveReports.Core/PlayingWithActiveReports.Core.csproj new file mode 100644 index 0000000..15d9c0e --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/PlayingWithActiveReports.Core.csproj @@ -0,0 +1,108 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{B77DDEAC-6A13-4AA7-8C99-CD4234F7B105}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PlayingWithActiveReports.Core</RootNamespace>
+ <AssemblyName>PlayingWithActiveReports.Core</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ActiveReports.Viewer3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\lib\active.reports\ActiveReports.Viewer3.dll</HintPath>
+ </Reference>
+ <Reference Include="ActiveReports3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\lib\active.reports\ActiveReports3.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Domain\Answer.cs" />
+ <Compile Include="Domain\IAnswer.cs" />
+ <Compile Include="Domain\IQuestion.cs" />
+ <Compile Include="Dto\DisplayReportQuestionDto.cs" />
+ <Compile Include="Reports\IMainReport.cs" />
+ <Compile Include="Reports\IReportFooter.cs" />
+ <Compile Include="Reports\IReportHeader.cs" />
+ <Compile Include="Reports\IReportParameter.cs" />
+ <Compile Include="Reports\IReportSection.cs" />
+ <Compile Include="Reports\IResultsReport.cs" />
+ <Compile Include="Reports\IResultsSection.cs" />
+ <Compile Include="Reports\ISectionBuilder.cs" />
+ <Compile Include="Reports\ISpecification.cs" />
+ <Compile Include="Reports\MainReport.cs" />
+ <Compile Include="Reports\ReportFooterAdapter.cs" />
+ <Compile Include="Reports\ReportHeaderAdapter.cs" />
+ <Compile Include="Reports\ReportParameter.cs" />
+ <Compile Include="Reports\ReportSection.cs" />
+ <Compile Include="Reports\ResultsReport.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Reports\ResultsReport.Designer.cs">
+ <DependentUpon>ResultsReport.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Reports\ResultsSection.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="Reports\ResultsSection.Designer.cs">
+ <DependentUpon>ResultsSection.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Reports\ResultsSectionBuilder.cs" />
+ <Compile Include="Reports\Specification.cs" />
+ <Compile Include="Repositories\IQuestionBank.cs" />
+ <Compile Include="Repositories\IRepository.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Domain\Question.cs" />
+ <Compile Include="Repositories\QuestionBank.cs" />
+ <Compile Include="Task\IResultSectionTask.cs" />
+ <Compile Include="Task\IResultsReportTask.cs" />
+ <Compile Include="Task\StubResultsReportTask.cs" />
+ <Compile Include="View\IReportViewer.cs" />
+ <Compile Include="View\IResultsReportView.cs" />
+ <Compile Include="View\ResultsReportPresenter.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="Properties\licenses.licx" />
+ <EmbeddedResource Include="Reports\ResultsReport.resx">
+ <DependentUpon>ResultsReport.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Reports\ResultsSection.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>ResultsSection.cs</DependentUpon>
+ </EmbeddedResource>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Properties/AssemblyInfo.cs b/src/app/PlayingWithActiveReports.Core/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9529a17 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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( "PlayingWithActiveReports.Core" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "PlayingWithActiveReports.Core" )]
+[assembly: AssemblyCopyright( "Copyright © 2007" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible( false )]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid( "8f44e3c0-4bce-4125-a57b-84080f9f3161" )]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion( "1.0.0.0" )]
+[assembly: AssemblyFileVersion( "1.0.0.0" )]
diff --git a/src/app/PlayingWithActiveReports.Core/Properties/licenses.licx b/src/app/PlayingWithActiveReports.Core/Properties/licenses.licx new file mode 100644 index 0000000..5ab2d7a --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Properties/licenses.licx @@ -0,0 +1 @@ +DataDynamics.ActiveReports.ActiveReport3, ActiveReports3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IMainReport.cs b/src/app/PlayingWithActiveReports.Core/Reports/IMainReport.cs new file mode 100644 index 0000000..e391e72 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IMainReport.cs @@ -0,0 +1,7 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public interface IMainReport {
+ void AddSection( IReportSection section );
+ IMainReport Run( );
+ IReportSection FindBy( ISpecification< IReportSection > criteria );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IReportFooter.cs b/src/app/PlayingWithActiveReports.Core/Reports/IReportFooter.cs new file mode 100644 index 0000000..4dd7393 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IReportFooter.cs @@ -0,0 +1,5 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public interface IReportFooter {
+ string Name { get; }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IReportHeader.cs b/src/app/PlayingWithActiveReports.Core/Reports/IReportHeader.cs new file mode 100644 index 0000000..3affa57 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IReportHeader.cs @@ -0,0 +1,5 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public interface IReportHeader {
+ string Name { get; }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IReportParameter.cs b/src/app/PlayingWithActiveReports.Core/Reports/IReportParameter.cs new file mode 100644 index 0000000..44ee407 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IReportParameter.cs @@ -0,0 +1,6 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public interface IReportParameter {
+ string Key { get; }
+ string Value { get; }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IReportSection.cs b/src/app/PlayingWithActiveReports.Core/Reports/IReportSection.cs new file mode 100644 index 0000000..d245787 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IReportSection.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public interface IReportSection {
+ int ParametersCount { get; }
+ string Name { get; }
+ void BindTo( IEnumerable< IReportParameter > parameters );
+ IReportSection WithName( string name );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IResultsReport.cs b/src/app/PlayingWithActiveReports.Core/Reports/IResultsReport.cs new file mode 100644 index 0000000..9c68136 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IResultsReport.cs @@ -0,0 +1,11 @@ +using System.Collections.Generic;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public interface IResultsReport {
+ ResultsReport Report { get; }
+ int ParametersCount { get; }
+ IResultsReport BindTo( IEnumerable< IReportParameter > parameters );
+ IResultsReport Execute( );
+ IReportSection FindSectionBy( ISpecification< IReportSection > spectification );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/IResultsSection.cs b/src/app/PlayingWithActiveReports.Core/Reports/IResultsSection.cs new file mode 100644 index 0000000..af34d9a --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/IResultsSection.cs @@ -0,0 +1,9 @@ +using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Dto;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public interface IResultsSection : IReportSection {
+ int ResultsCount { get; }
+ IResultsSection BindTo( IEnumerable< DisplayReportQuestionDto > results );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ISectionBuilder.cs b/src/app/PlayingWithActiveReports.Core/Reports/ISectionBuilder.cs new file mode 100644 index 0000000..5f78aed --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ISectionBuilder.cs @@ -0,0 +1,8 @@ +using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Test.Reports {
+ public interface ISectionBuilder {
+ void BuildFrom( IMainReport report );
+ void BuildFrom( IMainReport report, IResultsSection section );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ISpecification.cs b/src/app/PlayingWithActiveReports.Core/Reports/ISpecification.cs new file mode 100644 index 0000000..18d8413 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ISpecification.cs @@ -0,0 +1,5 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public interface ISpecification< T > {
+ bool IsSatisfiedBy( T item );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/MainReport.cs b/src/app/PlayingWithActiveReports.Core/Reports/MainReport.cs new file mode 100644 index 0000000..5e387f6 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/MainReport.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Reports;
+using PlayingWithActiveReports.Test.Reports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public class MainReport : IMainReport {
+ public MainReport( ) : this( new List< ISectionBuilder >( ) ) {}
+
+ public MainReport( IList< ISectionBuilder > builders ) {
+ _builders = builders;
+ _sections = new List< IReportSection >( );
+ }
+
+ public void AddSection( IReportSection section ) {
+ _sections.Add( section );
+ }
+
+ public IMainReport Run( ) {
+ foreach( ISectionBuilder builder in _builders ) {
+ builder.BuildFrom( this );
+ }
+ return this;
+ }
+
+ public IReportSection FindBy( ISpecification< IReportSection > criteria ) {
+ foreach( IReportSection section in _sections ) {
+ if( criteria.IsSatisfiedBy( section ) ) {
+ return section;
+ }
+ }
+ return null;
+ }
+
+ private readonly IList< ISectionBuilder > _builders;
+ private List< IReportSection > _sections;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ReportFooterAdapter.cs b/src/app/PlayingWithActiveReports.Core/Reports/ReportFooterAdapter.cs new file mode 100644 index 0000000..b944ccf --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ReportFooterAdapter.cs @@ -0,0 +1,15 @@ +using DataDynamics.ActiveReports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ internal class ReportFooterAdapter : IReportFooter {
+ public ReportFooterAdapter( Section section ) {
+ _section = section;
+ }
+
+ public string Name {
+ get { return _section.Name; }
+ }
+
+ private readonly Section _section;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ReportHeaderAdapter.cs b/src/app/PlayingWithActiveReports.Core/Reports/ReportHeaderAdapter.cs new file mode 100644 index 0000000..201352d --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ReportHeaderAdapter.cs @@ -0,0 +1,15 @@ +using DataDynamics.ActiveReports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public class ReportHeaderAdapter : IReportHeader {
+ public ReportHeaderAdapter( Section header ) {
+ _header = header;
+ }
+
+ public string Name {
+ get { return _header.Name; }
+ }
+
+ private Section _header;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ReportParameter.cs b/src/app/PlayingWithActiveReports.Core/Reports/ReportParameter.cs new file mode 100644 index 0000000..db4af70 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ReportParameter.cs @@ -0,0 +1,19 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ public class ReportParameter : IReportParameter {
+ public ReportParameter( string key, string value ) {
+ _key = key;
+ _value = value;
+ }
+
+ public string Key {
+ get { return _key; }
+ }
+
+ public string Value {
+ get { return _value; }
+ }
+
+ private readonly string _key;
+ private readonly string _value;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ReportSection.cs b/src/app/PlayingWithActiveReports.Core/Reports/ReportSection.cs new file mode 100644 index 0000000..8f37d75 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ReportSection.cs @@ -0,0 +1,45 @@ +using System.Collections.Generic;
+using DataDynamics.ActiveReports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public class ReportSection : IReportSection {
+ public ReportSection( ) : this( new Section( ) ) {
+ _name = "Undefined";
+ }
+
+ public ReportSection( Section section ) {
+ _name = section.Name;
+ _parameters = new List< IReportParameter >( );
+ }
+
+ public void BindTo( IEnumerable< IReportParameter > parameters ) {
+ _parameters = new List< IReportParameter >( parameters );
+ }
+
+ public IReportSection WithName( string name ) {
+ _name = name;
+ return this;
+ }
+
+ public int ParametersCount {
+ get { return _parameters.Count; }
+ }
+
+ public string Name {
+ get { return _name; }
+ }
+
+ public static readonly ISpecification< IReportSection > Footer = new Specification< IReportSection >(
+ delegate( IReportSection section ) { return section.Name == "Footer"; }
+ );
+
+ public static readonly ISpecification< IReportSection > Header = new Specification< IReportSection >(
+ delegate( IReportSection section ) { return section.Name == "Header"; } );
+
+ public static ISpecification< IReportSection > Results = new Specification< IReportSection >(
+ delegate( IReportSection section ) { return section.Name == "Results"; } );
+
+ private string _name;
+ private List< IReportParameter > _parameters;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.Designer.cs b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.Designer.cs new file mode 100644 index 0000000..31adc9d --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.Designer.cs @@ -0,0 +1,169 @@ +namespace PlayingWithActiveReports.Core.Reports {
+ /// <summary>
+ /// Summary description for rptBound.
+ /// </summary>
+ partial class ResultsReport
+ {
+ private DataDynamics.ActiveReports.PageHeader pageHeader;
+ private DataDynamics.ActiveReports.Detail Results;
+ private DataDynamics.ActiveReports.PageFooter pageFooter;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing ) {
+ }
+ base.Dispose( disposing );
+ }
+
+ #region ActiveReport Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent( )
+ {
+ System.Resources.ResourceManager resources = new System.Resources.ResourceManager( typeof( ResultsReport ) );
+ this.pageHeader = new DataDynamics.ActiveReports.PageHeader( );
+ this.Results = new DataDynamics.ActiveReports.Detail( );
+ this.label1 = new DataDynamics.ActiveReports.Label( );
+ this.label2 = new DataDynamics.ActiveReports.Label( );
+ this.subReport1 = new DataDynamics.ActiveReports.SubReport( );
+ this.pageFooter = new DataDynamics.ActiveReports.PageFooter( );
+ this.reportInfo1 = new DataDynamics.ActiveReports.ReportInfo( );
+ ( (System.ComponentModel.ISupportInitialize)( this.label1 ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.label2 ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.reportInfo1 ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).BeginInit( );
+ //
+ // pageHeader
+ //
+ this.pageHeader.BackColor = System.Drawing.Color.SandyBrown;
+ this.pageHeader.Height = 0.25F;
+ this.pageHeader.Name = "pageHeader";
+ //
+ // Results
+ //
+ this.Results.ColumnSpacing = 0F;
+ this.Results.Controls.AddRange( new DataDynamics.ActiveReports.ARControl[] {
+ this.label1,
+ this.label2,
+ this.subReport1} );
+ this.Results.Height = 1.885417F;
+ this.Results.Name = "Results";
+ this.Results.NewPage = DataDynamics.ActiveReports.NewPage.After;
+ this.Results.Format += new System.EventHandler( this.OnFormatDetailSection );
+ //
+ // label1
+ //
+ this.label1.Border.BottomColor = System.Drawing.Color.Black;
+ this.label1.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label1.Border.LeftColor = System.Drawing.Color.Black;
+ this.label1.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label1.Border.RightColor = System.Drawing.Color.Black;
+ this.label1.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label1.Border.TopColor = System.Drawing.Color.Black;
+ this.label1.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label1.Height = 0.1875F;
+ this.label1.HyperLink = null;
+ this.label1.Left = 0.0625F;
+ this.label1.Name = "label1";
+ this.label1.Style = "";
+ this.label1.Text = "Q.";
+ this.label1.Top = 0.0625F;
+ this.label1.Width = 0.1875F;
+ //
+ // label2
+ //
+ this.label2.Border.BottomColor = System.Drawing.Color.Black;
+ this.label2.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label2.Border.LeftColor = System.Drawing.Color.Black;
+ this.label2.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label2.Border.RightColor = System.Drawing.Color.Black;
+ this.label2.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label2.Border.TopColor = System.Drawing.Color.Black;
+ this.label2.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.label2.Height = 0.1875F;
+ this.label2.HyperLink = null;
+ this.label2.Left = 0.0625F;
+ this.label2.Name = "label2";
+ this.label2.Style = "";
+ this.label2.Text = "A.";
+ this.label2.Top = 0.3125F;
+ this.label2.Width = 0.1875F;
+ //
+ // subReport1
+ //
+ this.subReport1.Border.BottomColor = System.Drawing.Color.Black;
+ this.subReport1.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.subReport1.Border.LeftColor = System.Drawing.Color.Black;
+ this.subReport1.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.subReport1.Border.RightColor = System.Drawing.Color.Black;
+ this.subReport1.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.subReport1.Border.TopColor = System.Drawing.Color.Black;
+ this.subReport1.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.subReport1.CloseBorder = false;
+ this.subReport1.Height = 1F;
+ this.subReport1.Left = 0.0625F;
+ this.subReport1.Name = "subReport1";
+ this.subReport1.Report = null;
+ this.subReport1.ReportName = "subReport1";
+ this.subReport1.Top = 0.625F;
+ this.subReport1.Width = 6.3125F;
+ //
+ // pageFooter
+ //
+ this.pageFooter.BackColor = System.Drawing.Color.SandyBrown;
+ this.pageFooter.Controls.AddRange( new DataDynamics.ActiveReports.ARControl[] {
+ this.reportInfo1} );
+ this.pageFooter.Height = 0.25F;
+ this.pageFooter.Name = "pageFooter";
+ //
+ // reportInfo1
+ //
+ this.reportInfo1.Border.BottomColor = System.Drawing.Color.Black;
+ this.reportInfo1.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.reportInfo1.Border.LeftColor = System.Drawing.Color.Black;
+ this.reportInfo1.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.reportInfo1.Border.RightColor = System.Drawing.Color.Black;
+ this.reportInfo1.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.reportInfo1.Border.TopColor = System.Drawing.Color.Black;
+ this.reportInfo1.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.reportInfo1.FormatString = null;
+ this.reportInfo1.Height = 0.1979167F;
+ this.reportInfo1.Left = 5.1875F;
+ this.reportInfo1.Name = "reportInfo1";
+ this.reportInfo1.Style = "";
+ this.reportInfo1.Top = 0F;
+ this.reportInfo1.Width = 1F;
+ //
+ // ResultsReport
+ //
+ this.PageSettings.PaperHeight = 11F;
+ this.PageSettings.PaperWidth = 8.5F;
+ this.Sections.Add( this.pageHeader );
+ this.Sections.Add( this.Results );
+ this.Sections.Add( this.pageFooter );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Arial; font-style: normal; text-decoration: none; font-weight: norma" +
+ "l; font-size: 10pt; color: Black; ", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 16pt; font-weight: bold; ", "Heading1", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Times New Roman; font-size: 14pt; font-weight: bold; font-style: ita" +
+ "lic; ", "Heading2", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 13pt; font-weight: bold; ", "Heading3", "Normal" ) );
+ ( (System.ComponentModel.ISupportInitialize)( this.label1 ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.label2 ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.reportInfo1 ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).EndInit( );
+
+ }
+ #endregion
+
+ private DataDynamics.ActiveReports.ReportInfo reportInfo1;
+ private DataDynamics.ActiveReports.Label label1;
+ private DataDynamics.ActiveReports.Label label2;
+ public DataDynamics.ActiveReports.SubReport subReport1;
+
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.cs b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.cs new file mode 100644 index 0000000..6b1cfa0 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.cs @@ -0,0 +1,55 @@ +using System;
+using System.Collections.Generic;
+using DataDynamics.ActiveReports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public partial class ResultsReport : ActiveReport3, IResultsReport {
+ public ResultsReport( ) {
+ InitializeComponent( );
+ this.pageHeader.Name = HeaderName;
+ this.pageFooter.Name = FooterName;
+ _parameters = new List< IReportParameter >( );
+ }
+
+ public ResultsReport Report {
+ get { return this; }
+ }
+
+ public int ParametersCount {
+ get { return _parameters.Count; }
+ }
+
+ //public IResultsReport BindTo< T >( IEnumerable< T > items ) {
+ // DataSource = items;
+ // return this;
+ //}
+
+ public IResultsReport Execute( ) {
+ Run( false );
+ return this;
+ }
+
+ public IReportSection FindSectionBy( ISpecification< IReportSection > spectification ) {
+ foreach( Section section in Sections ) {
+ ReportSection reportSection = new ReportSection( section );
+ if( spectification.IsSatisfiedBy( reportSection ) ) {
+ return reportSection;
+ }
+ }
+ return null;
+ }
+
+ public IResultsReport BindTo( IEnumerable< IReportParameter > parameters ) {
+ _parameters = new List< IReportParameter >( parameters );
+ return this;
+ }
+
+ private void OnFormatDetailSection( object sender, EventArgs e ) {
+ //Results.AddBookmark( uxQuestionText.Text );
+ }
+
+ private const string FooterName = "Footer";
+ private const string HeaderName = "Header";
+ private List< IReportParameter > _parameters;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.resx b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.resx new file mode 100644 index 0000000..121d63f --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsReport.resx @@ -0,0 +1,123 @@ +<?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>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.Designer.cs b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.Designer.cs new file mode 100644 index 0000000..a85be35 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.Designer.cs @@ -0,0 +1,121 @@ +namespace PlayingWithActiveReports.Core.Reports
+{
+ /// <summary>
+ /// Summary description for ResultsSection.
+ /// </summary>
+ partial class ResultsSection
+ {
+ private DataDynamics.ActiveReports.PageHeader pageHeader;
+ private DataDynamics.ActiveReports.Detail detail;
+ private DataDynamics.ActiveReports.PageFooter pageFooter;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing ) {
+ }
+ base.Dispose( disposing );
+ }
+
+ #region ActiveReport Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent( )
+ {
+ System.Resources.ResourceManager resources = new System.Resources.ResourceManager( typeof( ResultsSection ) );
+ this.pageHeader = new DataDynamics.ActiveReports.PageHeader( );
+ this.detail = new DataDynamics.ActiveReports.Detail( );
+ this.pageFooter = new DataDynamics.ActiveReports.PageFooter( );
+ this.uxQuestionTextBox = new DataDynamics.ActiveReports.Label( );
+ this.uxAnswerTextBox = new DataDynamics.ActiveReports.Label( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxQuestionTextBox ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxAnswerTextBox ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).BeginInit( );
+ //
+ // pageHeader
+ //
+ this.pageHeader.Height = 0F;
+ this.pageHeader.Name = "pageHeader";
+ //
+ // detail
+ //
+ this.detail.ColumnSpacing = 0F;
+ this.detail.Controls.AddRange( new DataDynamics.ActiveReports.ARControl[] {
+ this.uxQuestionTextBox,
+ this.uxAnswerTextBox} );
+ this.detail.Height = 0.7916667F;
+ this.detail.Name = "detail";
+ //
+ // pageFooter
+ //
+ this.pageFooter.Height = 0F;
+ this.pageFooter.Name = "pageFooter";
+ //
+ // uxQuestionTextBox
+ //
+ this.uxQuestionTextBox.Border.BottomColor = System.Drawing.Color.Black;
+ this.uxQuestionTextBox.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionTextBox.Border.LeftColor = System.Drawing.Color.Black;
+ this.uxQuestionTextBox.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionTextBox.Border.RightColor = System.Drawing.Color.Black;
+ this.uxQuestionTextBox.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionTextBox.Border.TopColor = System.Drawing.Color.Black;
+ this.uxQuestionTextBox.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionTextBox.DataField = "Text";
+ this.uxQuestionTextBox.Height = 0.1979167F;
+ this.uxQuestionTextBox.HyperLink = null;
+ this.uxQuestionTextBox.Left = 0.125F;
+ this.uxQuestionTextBox.Name = "uxQuestionTextBox";
+ this.uxQuestionTextBox.Style = "";
+ this.uxQuestionTextBox.Text = "label1";
+ this.uxQuestionTextBox.Top = 0.0625F;
+ this.uxQuestionTextBox.Width = 1F;
+ //
+ // uxAnswerTextBox
+ //
+ this.uxAnswerTextBox.Border.BottomColor = System.Drawing.Color.Black;
+ this.uxAnswerTextBox.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerTextBox.Border.LeftColor = System.Drawing.Color.Black;
+ this.uxAnswerTextBox.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerTextBox.Border.RightColor = System.Drawing.Color.Black;
+ this.uxAnswerTextBox.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerTextBox.Border.TopColor = System.Drawing.Color.Black;
+ this.uxAnswerTextBox.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerTextBox.DataField = "Answer";
+ this.uxAnswerTextBox.Height = 0.1979167F;
+ this.uxAnswerTextBox.HyperLink = null;
+ this.uxAnswerTextBox.Left = 0.125F;
+ this.uxAnswerTextBox.Name = "uxAnswerTextBox";
+ this.uxAnswerTextBox.Style = "";
+ this.uxAnswerTextBox.Text = "label2";
+ this.uxAnswerTextBox.Top = 0.3125F;
+ this.uxAnswerTextBox.Width = 1F;
+ //
+ // ResultsSection
+ //
+ this.PageSettings.PaperHeight = 11F;
+ this.PageSettings.PaperWidth = 8.5F;
+ this.Sections.Add( this.pageHeader );
+ this.Sections.Add( this.detail );
+ this.Sections.Add( this.pageFooter );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Arial; font-style: normal; text-decoration: none; font-weight: norma" +
+ "l; font-size: 10pt; color: Black; ", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 16pt; font-weight: bold; ", "Heading1", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Times New Roman; font-size: 14pt; font-weight: bold; font-style: ita" +
+ "lic; ", "Heading2", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 13pt; font-weight: bold; ", "Heading3", "Normal" ) );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxQuestionTextBox ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxAnswerTextBox ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).EndInit( );
+
+ }
+ #endregion
+
+ private DataDynamics.ActiveReports.Label uxQuestionTextBox;
+ private DataDynamics.ActiveReports.Label uxAnswerTextBox;
+ }
+}
diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.cs b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.cs new file mode 100644 index 0000000..e9c84d7 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.cs @@ -0,0 +1,38 @@ +using System;
+using System.Collections.Generic;
+using DataDynamics.ActiveReports;
+using PlayingWithActiveReports.Core.Dto;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public partial class ResultsSection : ActiveReport3, IResultsSection {
+ public ResultsSection( ) {
+ InitializeComponent( );
+ _results = new List< DisplayReportQuestionDto >( );
+ }
+
+ public int ResultsCount {
+ get { return _results.Count; }
+ }
+
+ public IResultsSection BindTo( IEnumerable< DisplayReportQuestionDto > results ) {
+ _results = ( null == results )
+ ? new List< DisplayReportQuestionDto >( )
+ : new List< DisplayReportQuestionDto >( results );
+ return this;
+ }
+
+ public int ParametersCount {
+ get { throw new NotImplementedException( ); }
+ }
+
+ public void BindTo( IEnumerable< IReportParameter > parameters ) {
+ throw new NotImplementedException( );
+ }
+
+ public IReportSection WithName( string name ) {
+ throw new NotImplementedException( );
+ }
+
+ private IList< DisplayReportQuestionDto > _results;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.resx b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.resx new file mode 100644 index 0000000..121d63f --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSection.resx @@ -0,0 +1,123 @@ +<?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>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/ResultsSectionBuilder.cs b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSectionBuilder.cs new file mode 100644 index 0000000..9965fd5 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/ResultsSectionBuilder.cs @@ -0,0 +1,19 @@ +using PlayingWithActiveReports.Test.Reports;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public class ResultsSectionBuilder : ISectionBuilder {
+ public ResultsSectionBuilder( IResultSectionTask task ) {
+ _task = task;
+ }
+
+ public void BuildFrom( IMainReport report ) {
+ BuildFrom( report, new ResultsSection( ) );
+ }
+
+ public void BuildFrom( IMainReport report, IResultsSection section ) {
+ report.AddSection( section.BindTo( _task.GetResults( ) ) );
+ }
+
+ private readonly IResultSectionTask _task;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Reports/Specification.cs b/src/app/PlayingWithActiveReports.Core/Reports/Specification.cs new file mode 100644 index 0000000..2188897 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Reports/Specification.cs @@ -0,0 +1,15 @@ +using System;
+
+namespace PlayingWithActiveReports.Core.Reports {
+ public class Specification< T > : ISpecification< T > {
+ public Specification( Predicate< T > predicate ) {
+ _predicate = predicate;
+ }
+
+ public bool IsSatisfiedBy( T item ) {
+ return _predicate( item );
+ }
+
+ private readonly Predicate< T > _predicate;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Repositories/IQuestionBank.cs b/src/app/PlayingWithActiveReports.Core/Repositories/IQuestionBank.cs new file mode 100644 index 0000000..1f342d6 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Repositories/IQuestionBank.cs @@ -0,0 +1,8 @@ +using PlayingWithActiveReports.Core.Domain;
+
+namespace PlayingWithActiveReports.Core.Repositories {
+ public interface IQuestionBank : IRepository< IQuestion > {
+ int Count { get; }
+ IQuestion CreateQuestion( string withText );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Repositories/IRepository.cs b/src/app/PlayingWithActiveReports.Core/Repositories/IRepository.cs new file mode 100644 index 0000000..440c1b6 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Repositories/IRepository.cs @@ -0,0 +1,7 @@ +using System.Collections.Generic;
+
+namespace PlayingWithActiveReports.Core.Repositories {
+ public interface IRepository< T > {
+ IEnumerable< T > FindAll( );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Repositories/QuestionBank.cs b/src/app/PlayingWithActiveReports.Core/Repositories/QuestionBank.cs new file mode 100644 index 0000000..92790c1 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Repositories/QuestionBank.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using PlayingWithActiveReports.Core.Domain;
+
+namespace PlayingWithActiveReports.Core.Repositories {
+ public class QuestionBank : IQuestionBank {
+ public QuestionBank( ) {
+ _questions = new List< IQuestion >( );
+ }
+
+ public IEnumerable< IQuestion > FindAll( ) {
+ return new ReadOnlyCollection< IQuestion >( _questions );
+ }
+
+ public int Count {
+ get { return _questions.Count; }
+ }
+
+ public IQuestion CreateQuestion( string withText ) {
+ IQuestion question = new Question( withText );
+ _questions.Add( question );
+ return question;
+ }
+
+ private IList< IQuestion > _questions;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs b/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs new file mode 100644 index 0000000..7b18c53 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Task/IResultSectionTask.cs @@ -0,0 +1,8 @@ +using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Dto;
+
+namespace PlayingWithActiveReports.Test.Reports {
+ public interface IResultSectionTask {
+ IEnumerable< DisplayReportQuestionDto > GetResults( );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs b/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs new file mode 100644 index 0000000..3367e6f --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Task/IResultsReportTask.cs @@ -0,0 +1,7 @@ +using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Core.Task {
+ public interface IResultsReportTask {
+ IResultsReport CreateReport( );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs b/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs new file mode 100644 index 0000000..d6ba5cf --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/Task/StubResultsReportTask.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic;
+using PlayingWithActiveReports.Core.Domain;
+using PlayingWithActiveReports.Core.Reports;
+using PlayingWithActiveReports.Core.Repositories;
+
+namespace PlayingWithActiveReports.Core.Task {
+ public class StubResultsReportTask : IResultsReportTask {
+ public StubResultsReportTask( ) : this( new QuestionBank( ) ) {}
+
+ public StubResultsReportTask( IQuestionBank bank ) {
+ _bank = bank;
+ }
+
+ public IResultsReport CreateReport( ) {
+ _bank.CreateQuestion( "What is your name?" ).ChangeAnswerTo( "mO" );
+ _bank.CreateQuestion( "How old are you?" ).ChangeAnswerTo( "23" );
+ return new ResultsReport( ).BindTo( CreateParameters( ) ).Execute( );
+ }
+
+ private IEnumerable< IReportParameter > CreateParameters( ) {
+ return new List< IQuestion >( _bank.FindAll( ) ).ConvertAll< IReportParameter >(
+ delegate( IQuestion input ) { return new ReportParameter( input.Text, input.CurrentAnswer.Text ); }
+ );
+ }
+
+ private IQuestionBank _bank;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/View/IReportViewer.cs b/src/app/PlayingWithActiveReports.Core/View/IReportViewer.cs new file mode 100644 index 0000000..6ad4d03 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/View/IReportViewer.cs @@ -0,0 +1,7 @@ +using PlayingWithActiveReports.Core.Reports;
+
+namespace PlayingWithActiveReports.Core.View {
+ public interface IReportViewer {
+ void BindTo( IResultsReport document );
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/View/IResultsReportView.cs b/src/app/PlayingWithActiveReports.Core/View/IResultsReportView.cs new file mode 100644 index 0000000..df5ee89 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/View/IResultsReportView.cs @@ -0,0 +1,5 @@ +namespace PlayingWithActiveReports.Core.View {
+ public interface IResultsReportView {
+ IReportViewer ReportViewer { get; }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Core/View/ResultsReportPresenter.cs b/src/app/PlayingWithActiveReports.Core/View/ResultsReportPresenter.cs new file mode 100644 index 0000000..586e3d8 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Core/View/ResultsReportPresenter.cs @@ -0,0 +1,20 @@ +using PlayingWithActiveReports.Core.Task;
+using PlayingWithActiveReports.Core.View;
+
+namespace PlayingWithActiveReports.Core.View {
+ public class ResultsReportPresenter {
+ public ResultsReportPresenter( IResultsReportView view ) : this( view, new StubResultsReportTask( ) ) {}
+
+ public ResultsReportPresenter( IResultsReportView view, IResultsReportTask task ) {
+ _view = view;
+ _task = task;
+ }
+
+ public void Initialize( ) {
+ _view.ReportViewer.BindTo( _task.CreateReport( ) );
+ }
+
+ private IResultsReportTask _task;
+ private IResultsReportView _view;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/Adapters/ReportViewer.cs b/src/app/PlayingWithActiveReports.Win.UI/Adapters/ReportViewer.cs new file mode 100644 index 0000000..b4a4e39 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Adapters/ReportViewer.cs @@ -0,0 +1,17 @@ +using DataDynamics.ActiveReports.Viewer;
+using PlayingWithActiveReports.Core.Reports;
+using PlayingWithActiveReports.Core.View;
+
+namespace PlayingWithActiveReports.Win.UI.Adapters {
+ public class ReportViewer : IReportViewer {
+ public ReportViewer( Viewer viewerControl ) {
+ _viewerControl = viewerControl;
+ }
+
+ public void BindTo( IResultsReport document ) {
+ _viewerControl.Document = document.Report.Document;
+ }
+
+ private Viewer _viewerControl;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/PlayingWithActiveReports.Win.UI.csproj b/src/app/PlayingWithActiveReports.Win.UI/PlayingWithActiveReports.Win.UI.csproj new file mode 100644 index 0000000..b9b15c7 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/PlayingWithActiveReports.Win.UI.csproj @@ -0,0 +1,114 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{09E6C76E-17AD-46F8-B09D-2C140942C9E5}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PlayingWithActiveReports.Win.UI</RootNamespace>
+ <AssemblyName>PlayingWithActiveReports.Win.UI</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="ActiveReports.Viewer3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\lib\active.reports\ActiveReports.Viewer3.dll</HintPath>
+ </Reference>
+ <Reference Include="ActiveReports3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\lib\active.reports\ActiveReports3.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Security" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ResultsReportView.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="ResultsReportView.Designer.cs">
+ <DependentUpon>ResultsReportView.cs</DependentUpon>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <EmbeddedResource Include="ResultsReportView.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>ResultsReportView.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Properties\licenses.licx" />
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ <EmbeddedResource Include="SimpleReport.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>SimpleReport.cs</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="SimpleReportView.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>SimpleReportView.cs</DependentUpon>
+ </EmbeddedResource>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <Compile Include="Adapters\ReportViewer.cs" />
+ <Compile Include="SimpleReport.cs">
+ <SubType>Component</SubType>
+ </Compile>
+ <Compile Include="SimpleReport.Designer.cs">
+ <DependentUpon>SimpleReport.cs</DependentUpon>
+ </Compile>
+ <Compile Include="SimpleReportView.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="SimpleReportView.Designer.cs">
+ <DependentUpon>SimpleReportView.cs</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\PlayingWithActiveReports.Core\PlayingWithActiveReports.Core.csproj">
+ <Project>{B77DDEAC-6A13-4AA7-8C99-CD4234F7B105}</Project>
+ <Name>PlayingWithActiveReports.Core</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/Program.cs b/src/app/PlayingWithActiveReports.Win.UI/Program.cs new file mode 100644 index 0000000..f7baa54 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Program.cs @@ -0,0 +1,17 @@ +using System;
+using System.Windows.Forms;
+
+namespace PlayingWithActiveReports.Win.UI {
+ internal static class Program {
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ private static void Main( ) {
+ Application.EnableVisualStyles( );
+ Application.SetCompatibleTextRenderingDefault( false );
+ //Application.Run( new ResultsReportView( ) );
+ Application.Run( new SimpleReportView( ) );
+ }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/AssemblyInfo.cs b/src/app/PlayingWithActiveReports.Win.UI/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b649d9d --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 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( "PlayingWithActiveReports.Win.UI" )]
+[assembly: AssemblyDescription( "" )]
+[assembly: AssemblyConfiguration( "" )]
+[assembly: AssemblyCompany( "" )]
+[assembly: AssemblyProduct( "PlayingWithActiveReports.Win.UI" )]
+[assembly: AssemblyCopyright( "Copyright © 2007" )]
+[assembly: AssemblyTrademark( "" )]
+[assembly: AssemblyCulture( "" )]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible( false )]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid( "0fe1cc6e-a4a3-42e5-a5f5-664c0d5a69eb" )]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion( "1.0.0.0" )]
+[assembly: AssemblyFileVersion( "1.0.0.0" )]
diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.Designer.cs b/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.Designer.cs new file mode 100644 index 0000000..d901300 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.Designer.cs @@ -0,0 +1,70 @@ +//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.832
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PlayingWithActiveReports.Win.UI.Properties
+{
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0" )]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute( )]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute( "Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode" )]
+ internal Resources( )
+ {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if( ( resourceMan == null ) ) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager( "PlayingWithActiveReports.Win.UI.Properties.Resources", typeof( Resources ).Assembly );
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute( global::System.ComponentModel.EditorBrowsableState.Advanced )]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.resx b/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.resx new file mode 100644 index 0000000..c40a448 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/Resources.resx @@ -0,0 +1,117 @@ +<?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.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: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" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </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" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </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>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.Designer.cs b/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.Designer.cs new file mode 100644 index 0000000..aac8847 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.832
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PlayingWithActiveReports.Win.UI.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute( )]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute( "Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0" )]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ( (Settings)( global::System.Configuration.ApplicationSettingsBase.Synchronized( new Settings( ) ) ) );
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.settings b/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.settings new file mode 100644 index 0000000..abf36c5 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/Settings.settings @@ -0,0 +1,7 @@ +<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
diff --git a/src/app/PlayingWithActiveReports.Win.UI/Properties/licenses.licx b/src/app/PlayingWithActiveReports.Win.UI/Properties/licenses.licx new file mode 100644 index 0000000..5ab2d7a --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/Properties/licenses.licx @@ -0,0 +1 @@ +DataDynamics.ActiveReports.ActiveReport3, ActiveReports3, Version=5.2.0.397, Culture=neutral, PublicKeyToken=cc4967777c49a3ff
diff --git a/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.Designer.cs b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.Designer.cs new file mode 100644 index 0000000..19fda50 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.Designer.cs @@ -0,0 +1,71 @@ +namespace PlayingWithActiveReports.Win.UI
+{
+ partial class ResultsReportView
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing && ( components != null ) ) {
+ components.Dispose( );
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent( )
+ {
+ this.viewer1 = new DataDynamics.ActiveReports.Viewer.Viewer( );
+ this.SuspendLayout( );
+ //
+ // viewer1
+ //
+ this.viewer1.Anchor = ( (System.Windows.Forms.AnchorStyles)( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
+ | System.Windows.Forms.AnchorStyles.Left )
+ | System.Windows.Forms.AnchorStyles.Right ) ) );
+ this.viewer1.BackColor = System.Drawing.SystemColors.Control;
+ this.viewer1.Document = new DataDynamics.ActiveReports.Document.Document( "ARNet Document" );
+ this.viewer1.Location = new System.Drawing.Point( 12, 12 );
+ this.viewer1.Name = "viewer1";
+ this.viewer1.ReportViewer.CurrentPage = 0;
+ this.viewer1.ReportViewer.MultiplePageCols = 3;
+ this.viewer1.ReportViewer.MultiplePageRows = 2;
+ this.viewer1.ReportViewer.ViewType = DataDynamics.ActiveReports.Viewer.ViewType.Normal;
+ this.viewer1.Size = new System.Drawing.Size( 831, 680 );
+ this.viewer1.TabIndex = 0;
+ this.viewer1.TableOfContents.Text = "Table Of Contents";
+ this.viewer1.TableOfContents.Width = 200;
+ this.viewer1.TabTitleLength = 35;
+ this.viewer1.Toolbar.Font = new System.Drawing.Font( "Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte)( 0 ) ) );
+ //
+ // Form1
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size( 855, 704 );
+ this.Controls.Add( this.viewer1 );
+ this.Name = "Form1";
+ this.Text = "Form1";
+ this.ResumeLayout( false );
+
+ }
+
+ #endregion
+
+ private DataDynamics.ActiveReports.Viewer.Viewer viewer1;
+
+ }
+}
+
diff --git a/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.cs b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.cs new file mode 100644 index 0000000..e7ad7d0 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.cs @@ -0,0 +1,26 @@ +using System.Windows.Forms;
+using PlayingWithActiveReports.Core.View;
+using PlayingWithActiveReports.Win.UI.Adapters;
+
+namespace PlayingWithActiveReports.Win.UI {
+ public partial class ResultsReportView : Form, IResultsReportView {
+ public ResultsReportView( ) {
+ InitializeComponent( );
+
+ //ResultsReport report = new ResultsReport( );
+ //report.subReport1.Report = new ResultsSection( );
+ //report.Run( false );
+
+ //this.viewer1.Document = report.Document;
+
+ _presenter = new ResultsReportPresenter( this );
+ _presenter.Initialize( );
+ }
+
+ public IReportViewer ReportViewer {
+ get { return new ReportViewer( viewer1 ); }
+ }
+
+ private ResultsReportPresenter _presenter;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.resx b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/ResultsReportView.resx @@ -0,0 +1,120 @@ +<?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>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.Designer.cs b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.Designer.cs new file mode 100644 index 0000000..c4abcf3 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.Designer.cs @@ -0,0 +1,122 @@ +namespace PlayingWithActiveReports.Win.UI
+{
+ /// <summary>
+ /// Summary description for SimpleReport.
+ /// </summary>
+ partial class SimpleReport
+ {
+ private DataDynamics.ActiveReports.PageHeader pageHeader;
+ private DataDynamics.ActiveReports.Detail detail;
+ private DataDynamics.ActiveReports.PageFooter pageFooter;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing ) {
+ }
+ base.Dispose( disposing );
+ }
+
+ #region ActiveReport Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent( )
+ {
+ System.Resources.ResourceManager resources = new System.Resources.ResourceManager( typeof( SimpleReport ) );
+ this.pageHeader = new DataDynamics.ActiveReports.PageHeader( );
+ this.detail = new DataDynamics.ActiveReports.Detail( );
+ this.pageFooter = new DataDynamics.ActiveReports.PageFooter( );
+ this.uxQuestionText = new DataDynamics.ActiveReports.Label( );
+ this.uxAnswerText = new DataDynamics.ActiveReports.Label( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxQuestionText ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxAnswerText ) ).BeginInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).BeginInit( );
+ //
+ // pageHeader
+ //
+ this.pageHeader.Height = 0.25F;
+ this.pageHeader.Name = "pageHeader";
+ //
+ // detail
+ //
+ this.detail.ColumnSpacing = 0F;
+ this.detail.Controls.AddRange( new DataDynamics.ActiveReports.ARControl[] {
+ this.uxQuestionText,
+ this.uxAnswerText} );
+ this.detail.Height = 0.7604167F;
+ this.detail.Name = "detail";
+ this.detail.NewPage = DataDynamics.ActiveReports.NewPage.After;
+ //
+ // pageFooter
+ //
+ this.pageFooter.Height = 0.25F;
+ this.pageFooter.Name = "pageFooter";
+ //
+ // uxQuestionText
+ //
+ this.uxQuestionText.Border.BottomColor = System.Drawing.Color.Black;
+ this.uxQuestionText.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionText.Border.LeftColor = System.Drawing.Color.Black;
+ this.uxQuestionText.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionText.Border.RightColor = System.Drawing.Color.Black;
+ this.uxQuestionText.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionText.Border.TopColor = System.Drawing.Color.Black;
+ this.uxQuestionText.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxQuestionText.DataField = "Text";
+ this.uxQuestionText.Height = 0.1875F;
+ this.uxQuestionText.HyperLink = null;
+ this.uxQuestionText.Left = 0.1875F;
+ this.uxQuestionText.Name = "uxQuestionText";
+ this.uxQuestionText.Style = "";
+ this.uxQuestionText.Text = "Question Text";
+ this.uxQuestionText.Top = 0.125F;
+ this.uxQuestionText.Width = 6F;
+ //
+ // uxAnswerText
+ //
+ this.uxAnswerText.Border.BottomColor = System.Drawing.Color.Black;
+ this.uxAnswerText.Border.BottomStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerText.Border.LeftColor = System.Drawing.Color.Black;
+ this.uxAnswerText.Border.LeftStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerText.Border.RightColor = System.Drawing.Color.Black;
+ this.uxAnswerText.Border.RightStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerText.Border.TopColor = System.Drawing.Color.Black;
+ this.uxAnswerText.Border.TopStyle = DataDynamics.ActiveReports.BorderLineStyle.None;
+ this.uxAnswerText.DataField = "Answer";
+ this.uxAnswerText.Height = 0.1875F;
+ this.uxAnswerText.HyperLink = null;
+ this.uxAnswerText.Left = 0.1875F;
+ this.uxAnswerText.Name = "uxAnswerText";
+ this.uxAnswerText.Style = "";
+ this.uxAnswerText.Text = "Answer Text";
+ this.uxAnswerText.Top = 0.4375F;
+ this.uxAnswerText.Width = 6F;
+ //
+ // SimpleReport
+ //
+ this.PageSettings.PaperHeight = 11F;
+ this.PageSettings.PaperWidth = 8.5F;
+ this.Sections.Add( this.pageHeader );
+ this.Sections.Add( this.detail );
+ this.Sections.Add( this.pageFooter );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Arial; font-style: normal; text-decoration: none; font-weight: norma" +
+ "l; font-size: 10pt; color: Black; ", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 16pt; font-weight: bold; ", "Heading1", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-family: Times New Roman; font-size: 14pt; font-weight: bold; font-style: ita" +
+ "lic; ", "Heading2", "Normal" ) );
+ this.StyleSheet.Add( new DDCssLib.StyleSheetRule( "font-size: 13pt; font-weight: bold; ", "Heading3", "Normal" ) );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxQuestionText ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this.uxAnswerText ) ).EndInit( );
+ ( (System.ComponentModel.ISupportInitialize)( this ) ).EndInit( );
+
+ }
+ #endregion
+
+ private DataDynamics.ActiveReports.Label uxQuestionText;
+ private DataDynamics.ActiveReports.Label uxAnswerText;
+ }
+}
diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.cs b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.cs new file mode 100644 index 0000000..7a6276e --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.cs @@ -0,0 +1,11 @@ +using DataDynamics.ActiveReports;
+
+namespace PlayingWithActiveReports.Win.UI {
+ public partial class SimpleReport : ActiveReport3 {
+ public SimpleReport( ) {
+ InitializeComponent( );
+
+ this.detail.Format += delegate { detail.AddBookmark( uxQuestionText.Value.ToString( ) ); };
+ }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.resx b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.resx new file mode 100644 index 0000000..121d63f --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReport.resx @@ -0,0 +1,123 @@ +<?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>
+ <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+ <value>True</value>
+ </metadata>
+</root>
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.Designer.cs b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.Designer.cs new file mode 100644 index 0000000..daaffb9 --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.Designer.cs @@ -0,0 +1,69 @@ +namespace PlayingWithActiveReports.Win.UI
+{
+ partial class SimpleReportView
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing && ( components != null ) ) {
+ components.Dispose( );
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent( )
+ {
+ this.uxReportViewerControl = new DataDynamics.ActiveReports.Viewer.Viewer( );
+ this.SuspendLayout( );
+ //
+ // viewer1
+ //
+ this.uxReportViewerControl.Anchor = ( (System.Windows.Forms.AnchorStyles)( ( ( ( System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom )
+ | System.Windows.Forms.AnchorStyles.Left )
+ | System.Windows.Forms.AnchorStyles.Right ) ) );
+ this.uxReportViewerControl.BackColor = System.Drawing.SystemColors.Control;
+ this.uxReportViewerControl.Document = new DataDynamics.ActiveReports.Document.Document( "ARNet Document" );
+ this.uxReportViewerControl.Location = new System.Drawing.Point( 0, 0 );
+ this.uxReportViewerControl.Name = "uxReportViewerControl";
+ this.uxReportViewerControl.ReportViewer.CurrentPage = 0;
+ this.uxReportViewerControl.ReportViewer.MultiplePageCols = 3;
+ this.uxReportViewerControl.ReportViewer.MultiplePageRows = 2;
+ this.uxReportViewerControl.ReportViewer.ViewType = DataDynamics.ActiveReports.Viewer.ViewType.Normal;
+ this.uxReportViewerControl.Size = new System.Drawing.Size( 799, 552 );
+ this.uxReportViewerControl.TabIndex = 0;
+ this.uxReportViewerControl.TableOfContents.Text = "Table Of Contents";
+ this.uxReportViewerControl.TableOfContents.Width = 200;
+ this.uxReportViewerControl.TabTitleLength = 35;
+ this.uxReportViewerControl.Toolbar.Font = new System.Drawing.Font( "Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ( (byte)( 0 ) ) );
+ //
+ // SimpleReportView
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F );
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size( 811, 564 );
+ this.Controls.Add( this.uxReportViewerControl );
+ this.Name = "SimpleReportView";
+ this.Text = "SimpleReportView";
+ this.ResumeLayout( false );
+
+ }
+
+ #endregion
+
+ private DataDynamics.ActiveReports.Viewer.Viewer uxReportViewerControl;
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.cs b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.cs new file mode 100644 index 0000000..ca0fd8a --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic;
+using System.Windows.Forms;
+using PlayingWithActiveReports.Core.Dto;
+
+namespace PlayingWithActiveReports.Win.UI {
+ public partial class SimpleReportView : Form {
+ public SimpleReportView( ) {
+ InitializeComponent( );
+
+ SimpleReport report = new SimpleReport( );
+ report.DataSource = CreateDtosList( );
+ report.Run( false );
+ this.uxReportViewerControl.Document = report.Document;
+ }
+
+ private IEnumerable< DisplayReportQuestionDto > CreateDtosList( ) {
+ List< DisplayReportQuestionDto > dtos = new List< DisplayReportQuestionDto >( );
+ dtos.Add( new DisplayReportQuestionDto( "How are you?", "good" ) );
+ dtos.Add( new DisplayReportQuestionDto( "How old are you?", "23" ) );
+ return dtos;
+ }
+ }
+}
\ No newline at end of file diff --git a/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.resx b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.resx new file mode 100644 index 0000000..ff31a6d --- /dev/null +++ b/src/app/PlayingWithActiveReports.Win.UI/SimpleReportView.resx @@ -0,0 +1,120 @@ +<?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>
\ No newline at end of file |
