10 Replies Latest reply: Nov 22, 2011 4:47 AM by pramjathan13 RSS

    export QlikView Objects to *.BMP

    Thierry Theyskens

      Hello,

       

      I have a problem here trying to export QlikView Objects to images.

      I developped this macro:

       

      sub Exportation

      ActiveDocument.ClearAll

       

      DocSheet = ActiveDocument.Sheets("Sheet").Activate

       

      Objects = ActiveDocument.ActiveSheet.GetSheetObjects

       

      FOR i = lBound(Objects) TO uBound(Objects)

       

      SET obj = Objects(i)

       

      obj.ExportBitmapToFile "C:\ "&i&".bmp"

       

      next

       

      end sub

       

      It works fine but I'd like to:

      1. take the objects of every sheets

      2. rename the file with the name of the object.

       

      Does anyone can help me?

       

      Thanks a lot.

        • export QlikView Objects to *.BMP
          Daniel Rozental

          you can go through all sheets like this  

               for j= 0 to ActiveDocument.NoOfSheets - 1
                  set s=ActiveDocument.Sheets(j)

           

          and you can go through all objects in the sheet like this

           

          Objects = s.GetSheetObjects

          For i = lBound(Objects) To uBound(Objects)

           

          If you want to use the ID like this, or the title

           

          Object.GetObjectId

          Object.GetProperties.Title.v

          • Re: export QlikView Objects to *.BMP

            Hi,

             

            Please see if the attached sample can help you.

             

            Cheers.

            • export QlikView Objects to *.BMP

              Hi All,

               

              I am trying to use an export macro to get images of specific charts into "BMP" format in order to use them to update links on a PowerPoint presentation.

               

              The macro does work, but there instances where QlikView does not respond quick enough and a blank image gets exported.

               

              Heres the code I am currently using in my macro:

               

              set APP = ActiveDocument.GetApplication

                         set c=ActiveDocument.GetSheetObject("CH158")

                         APP.WaitForIdle

                         c.Restore

                         APP.WaitForIdle

                          APP.Sleep 1000

                         ActiveDocument.ClearAll

                         APP.WaitForIdle

                         APP.Sleep 1000

                         ActiveDocument.RecallDocBookmark "Slide2"

                         APP.WaitForIdle

                          APP.Sleep 1000

                        set obj = ActiveDocument.GetSheetObject("CH158")

                        obj.WriteToFile "C:\Insight\PPT Images\MetCash\" & "001 National - National - LAD’s by Manufacturer Share.bmp", 0

                         APP.Sleep 1000

                        APP.WaitForIdle

               

               

              It does this for about 10 images. Majority of them are fine, but there are a few that turn up blank now and again.

               

              Any suggestions?

              • Re: export QlikView Objects to *.BMP

                Hey thanks for the response.

                 

                I am using stacked bar charts so there quite a number data points. An average of around 30 on each chart.

                 

                I've tried this code and it seems to be working correctly thus far:

                 

                set APP = ActiveDocument.GetApplication

                                     set c=ActiveDocument.GetSheetObject("CH158")

                                      APP.WaitForIdle

                                      APP.Sleep 1000

                                     c.Restore

                                      APP.WaitForIdle

                               APP.Sleep 1000

                               ActiveDocument.ClearAll

                               APP.WaitForIdle

                               APP.Sleep 1000

                               ActiveDocument.RecallDocBookmark "Slide2"

                               APP.WaitForIdle

                               APP.Sleep 1000

                                        ActiveDocument.GetSheetObject("CH158").ExportBitmapToFile "C:\Insight\PPT Images\MetCash\" & "001 National - National - LAD’s by Manufacturer Share.bmp"