public void ContextualObjectMemberAccess()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "ReportingEngine.ContextualObjectMemberAccess.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.ContextualObjectMemberAccess.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.ContextualObjectMemberAccess.docx", MyDir + @"\Golds\ReportingEngine.ContextualObjectMemberAccess Gold.docx"));
        }
        public void ExtensionMethods()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "ReportingEngine.ExtensionMethods.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.ExtensionMethods.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.ExtensionMethods.docx", MyDir + @"\Golds\ReportingEngine.ExtensionMethods Gold.docx"));
        }
        public void RestartingListNumberingDynamically()
        {
            Document template = new Document(MyDir + "Reporting engine template - List numbering.docx");

            BuildReport(template, Common.GetManagers(), "Managers", ReportBuildOptions.RemoveEmptyParagraphs);

            template.Save(ArtifactsDir + "ReportingEngine.RestartingListNumberingDynamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.RestartingListNumberingDynamically.docx", GoldsDir + "ReportingEngine.RestartingListNumberingDynamically Gold.docx"));
        }
        public void BubbleChartTest()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "ReportingEngine.TestBubbleChart.docx");

            BuildReport(doc, Common.GetManagers(), "managers");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.TestBubbleChart.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.TestBubbleChart.docx", MyDir + @"\Golds\ReportingEngine.TestBubbleChart Gold.docx"));
        }
        public void ExtensionMethods()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Extension methods.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(ArtifactsDir + "ReportingEngine.ExtensionMethods.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.ExtensionMethods.docx", GoldsDir + "ReportingEngine.ExtensionMethods Gold.docx"));
        }
        public void SetChartSeriesColorsDynamically()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "ReportingEngine.SetChartSeriesColorDinamically.docx");

            BuildReport(doc, Common.GetManagers(), "managers");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.SetChartSeriesColorDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.SetChartSeriesColorDinamically.docx", MyDir + @"\Golds\ReportingEngine.SetChartSeriesColorDinamically Gold.docx"));
        }
        public void Total()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Total.docx");

            BuildReport(doc, Common.GetContracts(), "Contracts");

            doc.Save(ArtifactsDir + "ReportingEngine.Total.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.Total.docx", GoldsDir + "ReportingEngine.Total Gold.docx"));
        }
        public void BubbleChartTest()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Bubble chart.docx");

            BuildReport(doc, Common.GetManagers(), "managers");

            doc.Save(ArtifactsDir + "ReportingEngine.TestBubbleChart.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.TestBubbleChart.docx", GoldsDir + "ReportingEngine.TestBubbleChart Gold.docx"));
        }
Ejemplo n.º 9
0
        public void TestNestedDataTable()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Nested data table.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(ArtifactsDir + "ReportingEngine.TestNestedDataTable.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.TestNestedDataTable.docx", GoldsDir + "ReportingEngine.TestNestedDataTable Gold.docx"));
        }
        public void DataTableTest()
        {
            Document doc = new Document(MyDir + "ReportingEngine.TestDataTable.docx");

            BuildReport(doc, Common.GetContracts(), "Contracts");
            doc.Save(MyDir + @"\Artifacts\ReportingEngine.TestDataTable.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.TestDataTable.docx",
                                                     MyDir + @"\Golds\ReportingEngine.TestDataTable Gold.docx"));
        }
Ejemplo n.º 11
0
        public void ExtensionMethods()
        {
            Document doc = new Document(MyDir + "ReportingEngine.ExtensionMethods.docx");
            DataSet  ds  = DataSet.AddTestData();

            BuildReport(doc, ds, "ds");
            doc.Save(MyDir + @"\Artifacts\ReportingEngine.ExtensionMethods.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.ExtensionMethods.docx", MyDir + @"\Golds\ReportingEngine.ExtensionMethods Gold.docx"));
        }
Ejemplo n.º 12
0
        public void ContextualObjectMemberAccess()
        {
            Document doc = new Document(MyDir + "ReportingEngine.ContextualObjectMemberAccess.docx");
            DataSet  ds  = DataSet.AddTestData();

            BuildReport(doc, ds, "ds");
            doc.Save(MyDir + @"\Artifacts\ReportingEngine.ContextualObjectMemberAccess.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.ContextualObjectMemberAccess.docx", MyDir + @"\Golds\ReportingEngine.ContextualObjectMemberAccess Gold.docx"));
        }
        public void ProgressiveTotal()
        {
            Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "ReportingEngine.Total.docx");

            BuildReport(doc, Common.GetContracts(), "Contracts");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.Total.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.Total.docx", MyDir + @"\Golds\ReportingEngine.Total Gold.docx"));
        }
Ejemplo n.º 14
0
        public void BubbleChartTest()
        {
            Document doc = new Document(MyDir + "ReportingEngine.TestBubbleChart.docx");
            DataSet  ds  = DataSet.AddTestData();

            BuildReport(doc, ds.Managers, "managers");
            doc.Save(MyDir + @"\Artifacts\ReportingEngine.TestBubbleChart.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.TestBubbleChart.docx", MyDir + @"\Golds\ReportingEngine.TestBubbleChart Gold.docx"));
        }
        public void InsertImageDinamicallyByUri()
        {
            Aspose.Words.Document template = DocumentHelper.CreateTemplateDocumentWithDrawObjects("<<image [src.ImageUri]>>", ShapeType.TextBox);
            ImageTestClass        imageUri = new ImageTestBuilder().WithImageUri("http://joomla-aspose.dynabic.com/templates/aspose/App_Themes/V3/images/customers/americanexpress.png").Build();

            BuildReport(template, imageUri, "src", ReportBuildOptions.None);
            template.Save(MyDir + @"\Artifacts\ReportingEngine.InsertImageDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.InsertImageDinamically.docx", MyDir + @"\Golds\ReportingEngine.InsertImageDinamically(uri) Gold.docx"), "Fail inserting document by bytes");
        }
        public void InsertImageDinamicallyByBytes()
        {
            Aspose.Words.Document template   = DocumentHelper.CreateTemplateDocumentWithDrawObjects("<<image [src.ImageBytes]>>", ShapeType.TextBox);
            ImageTestClass        imageBytes = new ImageTestBuilder().WithImageBytes(File.ReadAllBytes(this.mImage)).Build();

            BuildReport(template, imageBytes, "src", ReportBuildOptions.None);
            template.Save(MyDir + @"\Artifacts\ReportingEngine.InsertImageDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.InsertImageDinamically.docx", MyDir + @"\Golds\ReportingEngine.InsertImageDinamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by bytes");
        }
        public void ContextualObjectMemberAccess()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Contextual object member access.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(ArtifactsDir + "ReportingEngine.ContextualObjectMemberAccess.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.ContextualObjectMemberAccess.docx", GoldsDir + "ReportingEngine.ContextualObjectMemberAccess Gold.docx"));
        }
        public void SetChartSeriesColorsDynamically()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Chart series color.docx");

            BuildReport(doc, Common.GetManagers(), "managers");

            doc.Save(ArtifactsDir + "ReportingEngine.SetChartSeriesColorDynamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.SetChartSeriesColorDynamically.docx", GoldsDir + "ReportingEngine.SetChartSeriesColorDynamically Gold.docx"));
        }
        public void InsertDocumentDinamicallyByBytes()
        {
            Aspose.Words.Document template = DocumentHelper.CreateSimpleDocument("<<doc [src.DocumentBytes]>>");

            DocumentTestClass docBytes = new DocumentTestBuilder().WithDocumentBytes(File.ReadAllBytes(MyDir + "ReportingEngine.TestDataTable.docx")).Build();

            BuildReport(template, docBytes, "src", ReportBuildOptions.None);
            template.Save(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx", MyDir + @"\Golds\ReportingEngine.InsertDocumentDinamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by bytes");
        }
        public void InsertDocumentDinamicallyByUri()
        {
            Aspose.Words.Document template = DocumentHelper.CreateSimpleDocument("<<doc [src.DocumentUri]>>");

            DocumentTestClass docUri = new DocumentTestBuilder().WithDocumentUri("http://www.snee.com/xml/xslt/sample.doc").Build();

            BuildReport(template, docUri, "src", ReportBuildOptions.None);
            template.Save(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx", MyDir + @"\Golds\ReportingEngine.InsertDocumentDinamically(uri) Gold.docx"), "Fail inserting document by uri");
        }
        public void RemoveEmptyParagraphs()
        {
            Document doc = new Document(MyDir + "ReportingEngine.RemoveEmptyParagraphs.docx");

            BuildReport(doc, Common.GetManagers(), "Managers", ReportBuildOptions.RemoveEmptyParagraphs);

            doc.Save(ArtifactsDir + "ReportingEngine.RemoveEmptyParagraphs.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.RemoveEmptyParagraphs.docx",
                                                     GoldsDir + "ReportingEngine.RemoveEmptyParagraphs Gold.docx"));
        }
Ejemplo n.º 22
0
        public void DoNotRemoveEmptyParagraphs()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Remove empty paragraphs.docx");

            BuildReport(doc, Common.GetManagers(), "Managers");

            doc.Save(ArtifactsDir + "ReportingEngine.DoNotRemoveEmptyParagraphs.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.DoNotRemoveEmptyParagraphs.docx",
                                                     GoldsDir + "ReportingEngine.DoNotRemoveEmptyParagraphs Gold.docx"));
        }
        public void InsertDocumentDinamicallyByStream()
        {
            Aspose.Words.Document template = DocumentHelper.CreateSimpleDocument("<<doc [src.DocumentStream]>>");

            DocumentTestClass docStream = new DocumentTestBuilder().WithDocumentStream(new FileStream(this.mDocument, FileMode.Open, FileAccess.Read)).Build();

            BuildReport(template, docStream, "src", ReportBuildOptions.None);
            template.Save(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.InsertDocumentDinamically.docx", MyDir + @"\Golds\ReportingEngine.InsertDocumentDinamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by stream");
        }
        public void InsertImageDinamicallyByStream()
        {
            Document template =
                DocumentHelper.CreateTemplateDocumentWithDrawObjects("<<image [src.ImageStream]>>", ShapeType.TextBox);
            ImageTestClass imageStream = new ImageTestBuilder()
                                         .WithImageStream(new FileStream(mImage, FileMode.Open, FileAccess.Read)).Build();

            BuildReport(template, imageStream, "src", ReportBuildOptions.None);
            template.Save(ArtifactsDir + "ReportingEngine.InsertImageDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.InsertImageDinamically.docx", GoldsDir + "ReportingEngine.InsertImageDinamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by bytes");
        }
        public void InsertDocumentDinamically()
        {
            Document template = DocumentHelper.CreateSimpleDocument("<<doc [src.Document]>>");

            DocumentTestClass doc = new DocumentTestBuilder()
                                    .WithDocument(new Document(MyDir + "ReportingEngine.TestDataTable.docx")).Build();

            BuildReport(template, doc, "src", ReportBuildOptions.None);
            template.Save(ArtifactsDir + "ReportingEngine.InsertDocumentDinamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.InsertDocumentDinamically.docx", GoldsDir + "ReportingEngine.InsertDocumentDinamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by document");
        }
        public void ProgressiveTotal()
        {
            Document doc = new Document(MyDir + "ReportingEngine.Total.docx");

            DataSet ds = DataSet.AddTestData();

            BuildReport(doc, ds, "ds");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.Total.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.Total.docx", MyDir + @"\Golds\ReportingEngine.Total Gold.docx"));
        }
        public void NestedDataTableTest()
        {
            Document doc = new Document(MyDir + "ReportingEngine.TestNestedDataTable.docx");

            DataSet ds = DataSet.AddTestData();

            BuildReport(doc, ds, "ds");

            doc.Save(MyDir + @"\Artifacts\ReportingEngine.TestNestedDataTable.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.TestNestedDataTable.docx", MyDir + @"\Golds\ReportingEngine.TestNestedDataTable Gold.docx"));
        }
Ejemplo n.º 28
0
        public void InsertDocumentDynamicallyByBase64()
        {
            Document template       = DocumentHelper.CreateSimpleDocument("<<doc [src.DocumentString]>>");
            string   base64Template = File.ReadAllText(MyDir + "Reporting engine template - Data table (base64).txt");

            DocumentTestClass docBase64 = new DocumentTestBuilder().WithDocumentString(base64Template).Build();

            BuildReport(template, docBase64, "src", ReportBuildOptions.None);
            template.Save(ArtifactsDir + "ReportingEngine.InsertDocumentDynamically.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.InsertDocumentDynamically.docx", GoldsDir + "ReportingEngine.InsertDocumentDynamically(stream,doc,bytes) Gold.docx"), "Fail inserting document by uri");
        }
        public void ConditionalExpressionForLeaveChartSeries()
        {
            int condition = 3;

            Document doc = new Document(MyDir + "ReportingEngine.TestRemoveChartSeries.docx");

            BuildReport(doc, new object[] { Common.GetManagers(), condition }, new[] { "managers", "condition" });
            doc.Save(MyDir + @"\Artifacts\ReportingEngine.TestLeaveChartSeries.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(MyDir + @"\Artifacts\ReportingEngine.TestLeaveChartSeries.docx",
                                                     MyDir + @"\Golds\ReportingEngine.TestLeaveChartSeries Gold.docx"));
        }
        public void ConditionalExpressionForRemoveChartSeries()
        {
            Document doc = new Document(MyDir + "Reporting engine template - Chart series.docx");

            int condition = 2;

            BuildReport(doc, new object[] { Common.GetManagers(), condition }, new[] { "managers", "condition" });

            doc.Save(ArtifactsDir + "ReportingEngine.TestRemoveChartSeries.docx");

            Assert.IsTrue(DocumentHelper.CompareDocs(ArtifactsDir + "ReportingEngine.TestRemoveChartSeries.docx", GoldsDir + "ReportingEngine.TestRemoveChartSeries Gold.docx"));
        }