1 Reply Latest reply: Mar 18, 2013 11:17 AM by Micael Leal RSS

    QlikView Add-In for PowerPoint C#



      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


                                              //remove the shape preview





      Now my issues is



                                              //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.

        • Re: QlikView Add-In for PowerPoint C#



          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;





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


                                                          //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");


                                                          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);







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