Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: How to add dynamically selected columns to the report  (Read 2097 times)

ali

  • Newbie
  • *
  • Posts: 2
    • View Profile
How to add dynamically selected columns to the report
« on: September 19, 2019, 04:06:23 PM »
Can I use lime report to load dynamically selected columns?
As far as what I've understand I can only add the specific columns as a textItem to a dataBand in designer and it will be added to the report.(Am I right?).
let me explain more.
I have a `QAbstractListModel` and user can dynamically manipulate and select different items in it to be reported. I want to only show columns which are selected by the user inside the app (I don't know what it might be).
Can it be done by lime report?
Can you please point me to the right direction to start?
thanks in advance.
« Last Edit: September 19, 2019, 05:50:11 PM by ali »

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 992
    • View Profile
Re: How to add dynamically selected columns to the report
« Reply #1 on: September 22, 2019, 11:18:06 PM »
Hi!
For example, you can group TextItem in the horizontal layout and turnoff items visibility by scrip using variables.
Something like this you can write in the TextItems
Code: [Select]
$D{data.Test}
$S{THIS.isVisible = $V{columntTestVisible}}

ali

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: How to add dynamically selected columns to the report
« Reply #2 on: September 23, 2019, 10:39:46 AM »
Hi. Thanks for the reply.

As a matter of fact I don't know how many items I will have in the horizontal layout that you mentioned.
how many text items should I use in the designer?

regards

Arin Alex

  • Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 992
    • View Profile
Re: How to add dynamically selected columns to the report
« Reply #3 on: September 23, 2019, 10:52:58 AM »
Hi.
I will think about how to add the ability to add items on the band by code.