Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QlikView Add-In for PowerPoint C#

Hello,

I would like to write an Add-In for PowerPoint, which could import all QlikView objects and send them to PowerPoint.

I managed to do it for Word and it works fine so far.

I managed to import all objects to PowerPoint, but not the process of automatical update, means, if I change my report in PowerPoint it will search again all objects from my QlikView and update all the objects in PowerPoint with current selection in PowerPoint.

This is being done in C#.

Is there someone who could help me out with it?

    foreach (NetOffice.WordApi.InlineShape s in docWord.InlineShapes)

    {

                                        //save the html content to a file

                                        File.WriteAllText(temporaryFilePath, html);

                                        //insert the html file next to the shape

                                        s.Range.InsertFile(temporaryFilePath);

                                        //remove the shape preview

                                        s.Delete();

                                        fileToDelete.Add(temporaryFilePath);

     }

Now my issues is

                                        s.Range.InsertFile(temporaryFilePath);

                                        //remove the shape preview

Because for powerpoint I need following loop

    foreach (Microsoft.Office.Interop.PowerPoint.Slide slide in presentation.Slides)

    {

           foreach (Microsoft.Office.Interop.PowerPoint.Shape shape in slide.Shapes)

          {

And since Range.InsertFile doesn't exist for powerpoint I'm stuck and have no clue how to save the html file which will generate a table in powerpoint and import it again to Powerpoint as a real table.

I might ask in wrong Section of QlikView. But those from Microsoft Office have no clue too ....

So I hope being more lucky here.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I found it out.

                                               //save the html content to a file

                                                File.WriteAllText(temporaryFilePath, html);

                                                //insert the html file next to the shape

                                                shape.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;

                                                float oldshapewidth = shape.Width;

                                                float oldshapeheight = shape.Height;

                                                float oldshapetop = shape.Top;

                                                float oldshapeleft = shape.Left;

                                                shape.Select();

                                                Console.WriteLine(shape.Title);

                                                Console.WriteLine(shape.AlternativeText);

                                                //Console.Read();

                                                //remove the shape preview and read the html file stream and save as image

                                                shape.Delete();

                                                //we insert the real picture at the old shape position

                                                // http://msdn.microsoft.com/en-us/library/office/ff745953.aspx

                                                Console.WriteLine("temporary file path" + temporaryFilePath);

                                                WebsiteToImage websiteToImage = new WebsiteToImage(temporaryFilePath, @"C:\Users\admin\AppData\Local\Temp\2\image.jpg");

                                                websiteToImage.Generate();

                                                slide.Shapes.AddPicture(@"C:\Users\admin\AppData\Local\Temp\2\image.jpg", Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, oldshapeleft, oldshapetop, oldshapewidth, oldshapeheight);

                                                fileToDelete.Add(temporaryFilePath);

                                                fileToDelete.Add(@"C:\Users\admin\AppData\Local\Temp\2\image.jpg");

http://stackoverflow.com/questions/2715385/convert-webpage-to-image-from-asp-net

This website helped me to make a conversion from HTML -> Any Image I want to get as output.

View solution in original post

1 Reply
Not applicable
Author

Hi,

I found it out.

                                               //save the html content to a file

                                                File.WriteAllText(temporaryFilePath, html);

                                                //insert the html file next to the shape

                                                shape.Visible = Microsoft.Office.Core.MsoTriState.msoTrue;

                                                float oldshapewidth = shape.Width;

                                                float oldshapeheight = shape.Height;

                                                float oldshapetop = shape.Top;

                                                float oldshapeleft = shape.Left;

                                                shape.Select();

                                                Console.WriteLine(shape.Title);

                                                Console.WriteLine(shape.AlternativeText);

                                                //Console.Read();

                                                //remove the shape preview and read the html file stream and save as image

                                                shape.Delete();

                                                //we insert the real picture at the old shape position

                                                // http://msdn.microsoft.com/en-us/library/office/ff745953.aspx

                                                Console.WriteLine("temporary file path" + temporaryFilePath);

                                                WebsiteToImage websiteToImage = new WebsiteToImage(temporaryFilePath, @"C:\Users\admin\AppData\Local\Temp\2\image.jpg");

                                                websiteToImage.Generate();

                                                slide.Shapes.AddPicture(@"C:\Users\admin\AppData\Local\Temp\2\image.jpg", Microsoft.Office.Core.MsoTriState.msoTrue, Microsoft.Office.Core.MsoTriState.msoTrue, oldshapeleft, oldshapetop, oldshapewidth, oldshapeheight);

                                                fileToDelete.Add(temporaryFilePath);

                                                fileToDelete.Add(@"C:\Users\admin\AppData\Local\Temp\2\image.jpg");

http://stackoverflow.com/questions/2715385/convert-webpage-to-image-from-asp-net

This website helped me to make a conversion from HTML -> Any Image I want to get as output.