Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Export to excel using script

Hi folks,

i have a script that exports an object to excel.

i want to extend the script functionality to export only first 1000 records from the object.

Script:

SUB SendToExcel

SET chart = ActiveDocument.GetSheetObject("CH01")

SET p = chart.GetProperties

chart.SendToExcel

END SUB

Please advise me how do i can limit the export to 'n' no. of rows.

Thanks in advance.

regards,

Dathu

1 Solution

Accepted Solutions
Not applicable
Author

Using this script we can export only first 1000 rows from a chart even the chart displaying more than 1000.

View solution in original post

21 Replies
Anonymous
Not applicable
Author

try this p.GetContent.String < 50 like wise

luciancotea
Specialist
Specialist

Limit the rows inside the chart using a condition in your expressions or using the new "Dimension Limits" chart tab in QlikView 11.

Then the "Chart.SendToExcel" function will send only available rows to Excel.

Not applicable
Author

Hi Lucian, Thanks for your reply.

How to achive this in QV10. I am using QV10 version.

Please suggest me.

Thanks in Advance......

Regards,

Siri

luciancotea
Specialist
Specialist

Use RowNo() to count rows.

Not applicable
Author

Hi All,

thanks for your valuable suggestions. Unfortunately i couldn't limit the export.

Alternatively, i tried to show only 1000 rows in the straight table any time. but the option 'Max Number(1-100)'

showing upto 100 rows only. i need more than 100 rows.

please suggest me how do i can achieve this.

thank you,

Siri.

luciancotea
Specialist
Specialist

Here's an example:

Not applicable
Author

Hi Lucian,

Thanks for ur reply. If i am using more than one expression, the above logic didn't work.

Please suggest me how can achvive this?

Regards,

Siri

luciancotea
Specialist
Specialist

Of course it does not work if you change the problem. Ask the right question from the beginning.

Not applicable
Author

Hi Lucian,

Sorry for late reply.

Requirement: I need to use button to export to excel sheet the first 1000 rows in the straight table and stright table having multiple expressions. For this, I wrote one macro, but I stucked to limit the 1000 rows.

Script:

SUB SendToExcel

SET chart = ActiveDocument.GetSheetObject("CH01")

SET p = chart.GetProperties

chart.SendToExcel

END SUB

Ths is my problem.

Please suggest me.