Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. C#, WPF project

C#, WPF project

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpwpftestingtoolsquestion
5 Posts 5 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_16211985
    wrote on last edited by
    #1

    I have Report automation tool created in WPF and the code is written in C# in visual stdudio. I have many reports in my RA tool. Now I want to create Pitchbook from these reports. Say I already have a class called ABC which runs a report called ABC and has 3 slides. I want to create something like to pick 2 slides from this report and 2 slides from another report like xyz and create a book. This process should be automated. Please let me know how can I do this

    R L J W 4 Replies Last reply
    0
    • M Member_16211985

      I have Report automation tool created in WPF and the code is written in C# in visual stdudio. I have many reports in my RA tool. Now I want to create Pitchbook from these reports. Say I already have a class called ABC which runs a report called ABC and has 3 slides. I want to create something like to pick 2 slides from this report and 2 slides from another report like xyz and create a book. This process should be automated. Please let me know how can I do this

      R Offline
      R Offline
      Richard Deeming
      wrote on last edited by
      #2

      Well, for a start, you haven't defined what a "pitchbook" is. The term presumably means something to you, but means nothing to the rest of us. Then there's the issue that you don't appear to have worked out your precise requirements. You need to work out precisely what you want to do, all the edge case, etc. - some vague hand-waving "do something like ..." statements don't count. You also haven't told us what reporting tool you are using. If it's a custom tool you've written, then you are the only person who can possibly know how to do this.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      1 Reply Last reply
      0
      • M Member_16211985

        I have Report automation tool created in WPF and the code is written in C# in visual stdudio. I have many reports in my RA tool. Now I want to create Pitchbook from these reports. Say I already have a class called ABC which runs a report called ABC and has 3 slides. I want to create something like to pick 2 slides from this report and 2 slides from another report like xyz and create a book. This process should be automated. Please let me know how can I do this

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        I guess you need to create "reporting files" that you can query for your "book" instead of going "straight to print".

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        1 Reply Last reply
        0
        • M Member_16211985

          I have Report automation tool created in WPF and the code is written in C# in visual stdudio. I have many reports in my RA tool. Now I want to create Pitchbook from these reports. Say I already have a class called ABC which runs a report called ABC and has 3 slides. I want to create something like to pick 2 slides from this report and 2 slides from another report like xyz and create a book. This process should be automated. Please let me know how can I do this

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #4

          I doubt the solution has anything to do with WPF. Since you cannot define a page from the report until the report actually runs that means all that matters is how the output of the report is produced. Then something would need to process that output to pick out the necessary pages.

          Member 16211985 wrote:

          I have many reports in my RA tool

          Probably even more true because of this. Probably means the code was written by multiple people without following any modularization that you could take advantage of.

          1 Reply Last reply
          0
          • M Member_16211985

            I have Report automation tool created in WPF and the code is written in C# in visual stdudio. I have many reports in my RA tool. Now I want to create Pitchbook from these reports. Say I already have a class called ABC which runs a report called ABC and has 3 slides. I want to create something like to pick 2 slides from this report and 2 slides from another report like xyz and create a book. This process should be automated. Please let me know how can I do this

            W Offline
            W Offline
            Waqas Khan 2024
            wrote on last edited by
            #5

            To automate the creation of a Pitchbook by selecting specific slides from various reports in your Report Automation (RA) tool, you can follow these steps. Since your tool is created in WPF with C# code, the process involves manipulating PowerPoint slides programmatically. Here is a high-level approach:

            Install Required Libraries: Use a library like Open XML SDK or Microsoft PowerPoint Interop to manipulate PowerPoint presentations. For this example, I will use Open XML SDK.

            Extract Slides from Existing Reports: Write a method to extract the desired slides from the existing PowerPoint presentations generated by your RA tool.

            Create a New Pitchbook: Write a method to create a new PowerPoint presentation and add the extracted slides to it.

            Example Implementation
            Step 1: Install Open XML SDK
            You can install the Open XML SDK via NuGet Package Manager in Visual Studio:

            bash
            Copy code
            Install-Package DocumentFormat.OpenXml
            Step 2: Extract and Combine Slides
            Here’s a basic example of how you can achieve this:

            csharp
            Copy code
            using DocumentFormat.OpenXml.Packaging;
            using DocumentFormat.OpenXml.Presentation;
            using System;
            using System.Linq;

            public class PitchbookCreator
            {
            public void CreatePitchbook(string[] sourceFiles, int[][] slideIndices, string outputFilePath)
            {
            // Create a new presentation document
            using (PresentationDocument newPresentation = PresentationDocument.Create(outputFilePath, DocumentFormat.OpenXml.PresentationDocumentType.Presentation))
            {
            // Add a new presentation part to the presentation document
            PresentationPart presentationPart = newPresentation.AddPresentationPart();
            presentationPart.Presentation = new Presentation();

                    SlideIdList slideIdList = new SlideIdList();
            
                    for (int i = 0; i < sourceFiles.Length; i++)
                    {
                        using (PresentationDocument sourceDocument = PresentationDocument.Open(sourceFiles\[i\], false))
                        {
                            PresentationPart sourcePart = sourceDocument.PresentationPart;
                            int slideIndex = 256 + i;
            
                            foreach (int index in slideIndices\[i\])
                            {
                                SlidePart slidePart = (SlidePart)sourcePart.GetPartById(sourcePart.Presentation.SlideIdList.ChildElements\[index\].GetAttribute("id", "").Value);
                                SlidePart newSlidePart = presentationPart.AddNewPart();
                                newSlidePart.FeedDa
            
            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups