Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Heading in Straight table

Hi All,

How can i create a Heading for the straight table like.




Volume YTD JulyO/s
CodeDetailsLocation20112012GrowthDec-11Sep-11Sep-12NOC%Var

Attach is a sample example.

Thanks

Ritul

1 Solution

Accepted Solutions
Not applicable

Re: Heading in Straight table

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("C1Smiley Very Happy1").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.

6 Replies
Not applicable

Re: Heading in Straight table

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

Not applicable

Re: Heading in Straight table

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

Not applicable

Re: Heading in Straight table

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

Not applicable

Re: Heading in Straight table

Hi,

Thanks can you provide any macro code for send to excel.

Thanks

Ritul

Not applicable

Re: Heading in Straight table

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.

Not applicable

Re: Heading in Straight table

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("C1Smiley Very Happy1").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.