Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Exporting a Bar chart like a pivot table

Hi,

I have a bar chart, when i export this chart i get data in below format in xls

firstexport.JPG

And desired format is :

Expected_format.JPG

Please find the attached test report for more details.

Thanks.

10 Replies
luis_pimentel
Partner - Creator III
Partner - Creator III

Exporting the pivot table you also have is not an option? That way it works fine.

Not applicable
Author

No .. Bar chart needs to export in that way..

giakoum
Partner - Master II
Partner - Master II

Create a button that says "Export Bar Chart" but instead export the pivot. Who will know?

Otherwise you will have to create a macro to do so, something like :

SUB Excel

set obj = ActiveDocument.GetSheetObject( "CH01" )

w = obj.GetColumnCount

  if obj.GetRowCount>1001 then

  h=1000

  else h=obj.GetRowCount

  end if

Set objExcel = CreateObject("Excel.Application")

objExcel.Workbooks.Add

objExcel.Worksheets(1).select()

objExcel.Visible = True

set CellMatrix = obj.GetCells2(0,0,w,h)

column = 1

for cc=0 to 8

       objExcel.Cells(1,column).Value = CellMatrix(0)(cc).Text

       objExcel.Cells(1,column).EntireRow.Font.Bold = True

       column = column +1

next

c = 1

r =2

for RowIter=1 to h-1  

    for ColIter=0 to 8           

       objExcel.Cells(r,c).Value =  CellMatrix(RowIter)(ColIter).Text

        'msgbox(CellMatrix(RowIter)(ColIter).Text)

        c = c +1

    next

    r = r+1

       c = 1

next

END SUB

But I really do not see why.....

Not applicable
Author

Good trick .. but they dont want to have any button..

ashwanin
Specialist
Specialist

Hi Pallavi,

Are you using any macro to export this?

or you are just sending it send to excel option.

If its 2nd option then from Fast Change,change the Bar chart to Pivot Graph. and then do send to excel, which was already in your QV document. I know its not a proper way, but you will get the desired output.

Not applicable
Author

Hi,

I am using send to excel option. changing Bar chart to pivot and export it option is not available to me .

My requirement is to export Bar chart to mentioned xls format using send to excel option.

sujeetsingh
Master III
Master III

Pallavi,

see this

Anonymous
Not applicable
Author

Can you use the quick change property to allow the user to change the object from a Bar to a Pivot table. Then they can format it as desired and export to excel.

This is standard functionality and therefore requires no coding.

ashwanin
Specialist
Specialist

HI Pallavi,

It was available in your QV Application.

First click on fast change (Right hand from the send to excel option at chart)  and then do Send to excel and you are doing. It will provide you the desired output.