query execuring several times

Options
lektuvas
edited February 11, 2022 in Analytics #1
hello,

I have two datasets in my report. Both of them return one row. I use a grid and a Data widget for each column to display on the report. I noticed that database query is executed several times. I suspect that BIRT executes the query for each data column I have on the grid. How do I make BIRT execute these queries only once and then fill all the Data elements?

Thanks

Comments

  • JMaleski
    edited December 31, 1969 #2
    Options
    Have you tried using a joint data set at all?
  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #3
    Options
    Hi lektuvas,

    Instead of using a grid, you can use a table. Basically, a grid has no binding to the data, so each element has to do the binding. Each time that happens, the query is run. To get around this, use a table control and bind it to the dataset. Then make sure each control is set to binding of None. This will only run the query once.
    Warning No formatter is installed for the format ipb
  • lektuvas
    edited December 31, 1969 #4
    Options
    Thanks for the reply.

    I thought about using the table instead of a grid. But I have requirements on report design so that the single row returned by each query is not supposed to result in a row in table but all the fields of those two rows need to be scattered around the grid. I tried to achieve this by having a hidden table on the report and binding data fields to this table instead of the dataset but it seems that I can't bind a single field to the whole table.
  • Virgil Dodson
    Virgil Dodson E admin
    edited December 31, 1969 #5
    Options
    Hi lektuvas,

    You could still hide the table if desired... and use the data item events to load global variables. I created a simple example that has a query with two rows of data... I then set a global variable for each element appending the row number to each to keep the two rows straight... I can then use these global variables anywhere in the grid that I like and the query is only executed once.
    Warning No formatter is installed for the format ipb