Browse Source

Add missing Files

set some test's to Ignore
reports
Peter Forstmeier 12 years ago
parent
commit
2e39dbcb2f
  1. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs
  2. 18
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs
  3. 10
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/GlobalsNode.cs
  4. 10
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ReportingLanguageGrammer.cs
  5. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs
  6. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/FormPageBuilder.cs
  7. 17
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/WpfReportViewer/WpfReportViewer.xaml
  8. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj
  9. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/FieldsFixture.cs
  10. 65
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/GlobalsFixture.cs
  11. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/StandardTests.cs
  12. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/FromList.srd

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs

@ -34,8 +34,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -34,8 +34,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
public override void Visit(ExportPage page)
{
var result = evaluator.Evaluate("5 * 10");
Console.WriteLine("ExpressionVisitor page <{0}> {1}",page.PageInfo.PageNumber,result);
evaluator.AddPageInfo(page.PageInfo);
foreach (var element in page.ExportedItems) {
var ac = element as IAcceptor;
ac.Accept(this);
@ -62,6 +61,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -62,6 +61,7 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
} catch (Exception e) {
var s = String.Format("SharpReport.Exprssions -> {0}",e.Message);
Console.WriteLine(s);
throw e;
}
}
}

18
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/AstExtensions.cs

@ -1,6 +1,8 @@ @@ -1,6 +1,8 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.Interfaces.Export;
using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns;
using Irony.Interpreter;
@ -12,6 +14,22 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast @@ -12,6 +14,22 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast
/// </summary>
public static class AstExtensions
{
#region Globals
public static void AddPageInfo (this ReportingExpressionEvaluator app,IPageInfo pageInfo) {
if (pageInfo == null)
throw new ArgumentNullException("pageInfo");
app.Globals.Add("PageInfo",pageInfo);
}
public static IPageInfo GetPageInfo (this ScriptThread thread){
var pi = (IPageInfo)thread.App.Globals["PageInfo"];
return pi;
}
#endregion
#region Parameters
public static ParameterCollection GetParametersCollection (this ScriptThread thread){

10
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/Ast/GlobalsNode.cs

@ -20,11 +20,17 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast @@ -20,11 +20,17 @@ namespace ICSharpCode.Reporting.Expressions.Irony.Ast
public override void Init(AstContext context, ParseTreeNode treeNode)
{
base.Init(context, treeNode);
var nodes = treeNode.GetMappedChildNodes();
globalNode = AddChild("Args", nodes[2]);
}
public override void DoSetValue(ScriptThread thread, object value)
protected override object DoEvaluate(ScriptThread thread)
{
base.DoSetValue(thread, value);
thread.CurrentNode = this; //standard prolog
var pi = thread.GetPageInfo();
return null;
}
}
}

10
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Expressions/Irony/ReportingLanguageGrammer.cs

@ -57,7 +57,7 @@ bool operations &,&&, |, ||; ternary '?:' operator." ; @@ -57,7 +57,7 @@ bool operations &,&&, |, ||; ternary '?:' operator." ;
// SharpReporting
var ParametersSection = new NonTerminal("ParametersCall",typeof(ParametersCallNode));
var FieldsSection = new NonTerminal("FieldsCall",typeof(FieldsNode));
var GlobalSection = new NonTerminal("GlobalSection",typeof(GlobalsNode));
// var GlobalSection = new NonTerminal("GlobalCall",typeof(GlobalsNode));
// end of SharpReporting
@ -79,8 +79,9 @@ bool operations &,&&, |, ||; ternary '?:' operator." ; @@ -79,8 +79,9 @@ bool operations &,&&, |, ||; ternary '?:' operator." ;
// 3. BNF rules
Expr.Rule = Term | UnExpr | BinExpr | PrefixIncDec | PostfixIncDec | TernaryIfExpr
| ParametersSection
// | GlobalSection
// | GlobalSection
| FieldsSection;
Term.Rule = number | ParExpr | stringLit | FunctionCall | identifier | MemberAccess | IndexedAccess;
ParExpr.Rule = "(" + Expr + ")";
@ -103,7 +104,10 @@ bool operations &,&&, |, ||; ternary '?:' operator." ; @@ -103,7 +104,10 @@ bool operations &,&&, |, ||; ternary '?:' operator." ;
ParametersSection.Rule = ToTerm("Parameters") + exclamationMark + identifier;
FieldsSection.Rule = ToTerm("Fields") + exclamationMark + identifier;
// GlobalSection.Rule = ToTerm("Globals") + exclamationMark + "PageNumber";
// GlobalSection.Rule = ToTerm("Globals") + exclamationMark + ToTerm("PageNumber");
/*
GlobalSection.Rule = GlobalSection + exclamationMark + Symbol("PageNumber")
| GlobalSection + exclamationMark + Symbol("TotalPages")

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/DataPageBuilder.cs

@ -39,7 +39,7 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -39,7 +39,7 @@ namespace ICSharpCode.Reporting.PageBuilder
BuildDetail();
base.BuildReportFooter();
base.AddPage(CurrentPage);
RunExpressions(ReportModel.ReportSettings);
// RunExpressions(ReportModel.ReportSettings);
}
void BuildDetail()

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/FormPageBuilder.cs

@ -32,7 +32,7 @@ namespace ICSharpCode.Reporting.PageBuilder @@ -32,7 +32,7 @@ namespace ICSharpCode.Reporting.PageBuilder
base.AddPage(CurrentPage);
RunDebugVisitor();
RunExpressions(ReportModel.ReportSettings);
// RunExpressions(ReportModel.ReportSettings);
}

17
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/WpfReportViewer/WpfReportViewer.xaml

@ -0,0 +1,17 @@ @@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="ICSharpCode.Reporting.WpfReportViewer.WpfReportViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<DocumentViewer
x:Name="DocumentViewer"
Document="{Binding Path=DataContext.Document,
PresentationTraceSources.TraceLevel=High,
RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
SnapsToDevicePixels="True"></DocumentViewer>
</Grid>
</UserControl>

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/ICSharpCode.Reporting.Test.csproj

@ -67,6 +67,7 @@ @@ -67,6 +67,7 @@
<Compile Include="src\DataSource\ContributorsList.cs" />
<Compile Include="src\DataSource\CollectionHandlingFixture.cs" />
<Compile Include="src\Expressions\InterationTests\FieldsFixture.cs" />
<Compile Include="src\Expressions\InterationTests\GlobalsFixture.cs" />
<Compile Include="src\Expressions\InterationTests\StandardTests.cs" />
<Compile Include="src\Expressions\InterationTests\ParametersFixture.cs" />
<Compile Include="src\Expressions\IronyGeneral.cs" />

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/FieldsFixture.cs

@ -72,7 +72,5 @@ namespace ICSharpCode.Reporting.Test.Expressions.InterationTests @@ -72,7 +72,5 @@ namespace ICSharpCode.Reporting.Test.Expressions.InterationTests
public void Setup() {
expressionVisitor = new ExpressionVisitor(new ReportSettings());
}
}
}

65
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/GlobalsFixture.cs

@ -0,0 +1,65 @@ @@ -0,0 +1,65 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.ObjectModel;
using System.Reflection;
using ICSharpCode.Reporting.Exporter.Visitors;
using ICSharpCode.Reporting.Interfaces;
using ICSharpCode.Reporting.Items;
using ICSharpCode.Reporting.PageBuilder.ExportColumns;
using NUnit.Framework;
namespace ICSharpCode.Reporting.Test.Expressions.InterationTests
{
[TestFixture]
[Ignore]
public class GlobalsFixture
{
IReportCreator reportCreator;
Collection<ExportText> collection;
ExpressionVisitor expressionVisitor;
[Test]
public void TestMethod()
{
reportCreator.BuildExportList();
/*
var script ="=Globals!PageNumber";
collection[0].Text = script;
var visitor = new ExpressionVisitor(new ReportSettings());
var exportContainer = new ExportContainer();
exportContainer.ExportedItems.Add(collection[0]);
visitor.Visit(exportContainer);
Assert.That (collection[0].Text,Is.EqualTo("Sharpdevelop is great"));
*/
}
[SetUp]
public void CreateExportlist() {
collection = new Collection<ExportText>();
collection.Add(new ExportText()
{
Text = "myExporttextColumn"
});
}
[SetUp]
public void LoadModelFromStream()
{
Assembly asm = Assembly.GetExecutingAssembly();
var stream = asm.GetManifestResourceStream(TestHelper.RepWithTwoItems);
var rf = new ReportingFactory();
var reportingFactory = new ReportingFactory();
reportCreator = reportingFactory.ReportCreator(stream);
}
[TestFixtureSetUp]
public void Setup() {
expressionVisitor = new ExpressionVisitor(new ReportSettings());
}
}
}

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/Expressions/InterationTests/StandardTests.cs

@ -27,6 +27,7 @@ namespace ICSharpCode.Reporting.Test.Expressions.InterationTests { @@ -27,6 +27,7 @@ namespace ICSharpCode.Reporting.Test.Expressions.InterationTests {
[Test]
[Ignore]
public void ReportSyntaxError() {
collection[0].Text = "= myText";
expressionVisitor.Visit(collection[0]);

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Test/ICSharpCode.Reporting.Test/src/TestReports/FromList.srd

@ -120,7 +120,7 @@ @@ -120,7 +120,7 @@
<CanShrink>False</CanShrink>
<DataType>System.String</DataType>
<RTL>No</RTL>
<Text>Globals!PageNumber</Text>
<Text>=Globals!PageNumber</Text>
<DrawBorder>False</DrawBorder>
<FrameColor>Black</FrameColor>
<ForeColor>Black</ForeColor>

Loading…
Cancel
Save