C#, WPF project
-
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
-
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
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
-
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
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
-
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
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.
-
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
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