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

export every list box field to a excel report tab

Can anybody help me with the following questions? Thanks upfront.

I tried to export an excel report with tab of fields of a list box. If I do it manually, it is like I select one value in list box and the real report will change with the list box. Then I export the Excel report. I will go though all the value in the list box.

I can use pass the variable into list box, but list box value will change with grey out which was not selected.

The expression in the list box is =If(PreferedField = GivenVariableValue, PreferedField) .

For example, if I give GivenVariableValue = Apple, the Apple will show in the list box display but not selected.

Can anyone help me with this issue please? Thanks again.

8 Replies
marcus_sommer

Not applicable
Author

Hi, Marcus,

Thank you very much for your fast response and help. I can export a report into 8 different regions, but the region selected was not affect the report as a filter. Can I know if I did anything wrong?

Thanks a lot

marcus_sommer

Maybe this happens because there are set analysis expressions in use which are independent from region- selection, like: sum({< Region = >} value) or sum({< Region = {'*'}>} value) or sum({1} value). Also the use of alternate states could cause such behaviour and of course you need to use the right region-field in cases you have several different ones and also the region-field must be proper associated within your datamodel.

- Marcus

Not applicable
Author

Thank you. Can I know if anyway it can work like a list box works? So I can select a region, and the selection will apply to all the chart.

marcus_sommer

The above mentioned methods of set analysis and alternate states are specialized approaches to break the normal associations between the fields related to whole datamodel. This could be very useful and has many advantages but of course there are disadvantages, too especially in this way that you need to take care to make clear what (didn't) happens by any selections and why.

To be more practically to your question - quite common and often the easiest way is the method of having separate objects for export and printing (maybe in a hidden sheet) which are specialized for only these purpose without (these) set analysis, alternate states and with different columns, layouts and so on. You will need to declare explicit which purpose and functionality each object has and use them appropriate.

- Marcus

Not applicable
Author

Hi, Marcus,

I did change the set analysis of the calculation and using a variable to give the region value. But when I was using for each loop, putting value into variable one by one. It exported only one report. I assuming that is because the exporting process happened only one. Am I on the right direction? Thank you.

Dave

marcus_sommer

It could be that something in your routine didn't work like you exprected it. I suggest to use various msgbox to see if your loop runs really through all region-values, like:

msgbox YourLoopCounter

msgbox YourRegion 'field-value or variablen-value

- Marcus

Not applicable
Author

Hi, Marcus,

Finally, I figure it out that I should pass the macro variable value into Qlikview variable. Then it will work. Thanks a lot.