Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
How can i create a Heading for the straight table like.
Volume YTD July | O/s | ||||||||||
Code | Details | Location | 2011 | 2012 | Growth | Dec-11 | Sep-11 | Sep-12 | NOC | % | Var |
Attach is a sample example.
Thanks
Ritul
Hi,
I hope below script helps u.
Sub Export
Path = "E:\"
FileName = "Export1.xlsx"
FullPath=Path&FileName
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(FullPath) then
objFSO.Deletefile FullPath
End if
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = False
set XLDoc = XLApp.Workbooks.Add
txt1=ActiveDocument.GetSheetObject("TX02").GetText
txt2=ActiveDocument.GetSheetObject("TX03").GetText
XLDoc.Sheets(1).Cells(1,1).Value=txt1
XLDoc.Sheets(1).Cells(1,3).Value=txt2
'XLDoc.Sheets(1).Paste()
XLDoc.Sheets(1).Range("A1:B1").Merge
XLDoc.Sheets(1).Range("C1:D1").Merge
XLDoc.Sheets(1).Range("A2").Select
ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard true
XLDoc.Sheets(1).paste()
'ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard true
'XLDoc.Sheets(1).paste()
XLDoc.Sheets(1).Name = "Export"
XLDoc.SaveAs Path & FileName
XLDoc.Close
MsgBox("Success!")
XLApp.Quit
end sub
PFA ...
Regards
Kabilan K.
Simple solution is to hide the heading of the straiht table and add the required headings as labels (text Object) on top Straight table
Hope this helps
Regards
Mallik
Hi,
Thanks, But i have to take report from this as send to excel option. The suggestion that you provide on that send to excel option hides.
Let me know how this could be achieve
Thanks
Hi
The workaround is to write a macro on click of button to export the Text obj and Straight table as well,but i am not sure on export how would be the alignment in excel
Give a try
Regards
Mallik
Hi,
Thanks can you provide any macro code for send to excel.
Thanks
Ritul
The link below could be help ful to you but you need to customise according to your need
http://www.qlikblog.at/971/qliktip-32-exporting-multiple-objects-single-excel-document/
http://quickdevtips.blogspot.in/2012/06/qlikview-macro-how-to-export-multiple.html
also search in qlikview community, you will get lots of post on this.
Hi,
I hope below script helps u.
Sub Export
Path = "E:\"
FileName = "Export1.xlsx"
FullPath=Path&FileName
Set objFSO = CreateObject("Scripting.FileSystemObject")
if objFSO.FileExists(FullPath) then
objFSO.Deletefile FullPath
End if
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = False
set XLDoc = XLApp.Workbooks.Add
txt1=ActiveDocument.GetSheetObject("TX02").GetText
txt2=ActiveDocument.GetSheetObject("TX03").GetText
XLDoc.Sheets(1).Cells(1,1).Value=txt1
XLDoc.Sheets(1).Cells(1,3).Value=txt2
'XLDoc.Sheets(1).Paste()
XLDoc.Sheets(1).Range("A1:B1").Merge
XLDoc.Sheets(1).Range("C1:D1").Merge
XLDoc.Sheets(1).Range("A2").Select
ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard true
XLDoc.Sheets(1).paste()
'ActiveDocument.GetSheetObject("CH03").CopyTableToClipboard true
'XLDoc.Sheets(1).paste()
XLDoc.Sheets(1).Name = "Export"
XLDoc.SaveAs Path & FileName
XLDoc.Close
MsgBox("Success!")
XLApp.Quit
end sub
PFA ...
Regards
Kabilan K.