Home
Analytics
Refresh Dataset
crowt999
All,
Iv'e used a suggestion from this forum for a "nested" table that is parameter bound to a value in an outer table, so that I can retrieve a dataset multiple times. In theory this is working, but it practice, it seems that once the dataset is retrieved the first time, it does not get retrieved the 2nd, 3rd, etc times...
I need to be able to retrieve the same set multiple times in one table - I am using BIRT 2.5.2...
Is there some setting, or some way to trigger a refresh of the data set ?
Many thanks -
Dean
Find more posts tagged with
Comments
mwilliams
Hi Dean,
What do you mean you want the data refreshed? I'm not sure I'm understanding. If you want your report data refreshed, you would just need to run the report again. Let me know. Thanks!
crowt999
I need to retrieve the dataset multiple times during 1 run of the report: More of the story is in my original post:
http://www.birt-exchange.org/org/forum/index.php/topic/20260-dataset-execution-through-event/
Thanks!
mwilliams
From your other thread, how do you determine if you have more benchmarks you need to retrieve data for? Where does this info come from?
crowt999
It is being passed in as a parameter... sort of like 1|2|3 (If I had 3 benchmarks to run. That means I need to run the process 3 times... Current plan is to create a scripted dataset to parse the "1|2|3" into 3 rows, with 1 column (BENCH_ORDER) then retrieve that in the outer table. Then bind the column (called BENCH_ORDER) to the parameter in my query that needs to reflect that number in the nested table.
mwilliams
If you create a scripted dataSet with 1|2|3 separated into:
Bench Order
1
2
3
And then use it as a table, then embed another table inside that with your SQL dataSet attached with a parameter (?) in the query, then use the DataSet parameter binding option on the binding tab for the inner table to pass the outer table value through, I don't see how you're not getting what I understand you're wanting. Maybe I'm still confused on something.
crowt999
If I am cycling through 3 times, it seems that the first time through, the parameter is applied, and the data is retrieved. Then when the 2nd row is retrieved in the outer table, the inner table is rendered again, BUT the data is NOT re-retrieved. same for the 3rd pass through. So is seems to me that once the data set is "retrieved" the first time, internally BIRT knows that the data is already there, so it does not make the call to retrieve the dataset again.
I've seen this behavior with our scripted datasets as well. Say you use the same data set in 2 different tables in your report. when the first table is rendered, the dataset is retrieved. when the second table is rendered, it uses the cached data retrieved from the first table. It does not "re-retrieve" the data.
We've recently upgraded from BIRT 2.1.2 to 2.5.2 and I know that in 2.1.2, the data is "retrieved" every time you use the dataset anywhere in the report. in 2.5.2 it seems to me that efficiencies were added to check if the data was there or not, as to avoid any unnecessary overhead.
Sorry if this is rambling.. Thanks again for looking into this, and please let me know if I am on the right track...
Tomorrow, I will try to recreate this for you using the classic cars data, and I will send that along...
Dean
mwilliams
Dean,
Ok, I am right in understanding what you're trying to do. What I don't understand is why you want to re-call the dataSet. Are there changes happening in the fractions of a second to your dataSet that you want rendered in the report? I guess my question is why you're not wanting the caching optimization. Maybe when you show your problem with the sample database, I'll understand more about what the issue with this is.
crowt999
The reason for recalling the data set is a limitation on the way that I can grab my data. I need to create a performance chart that compares the fund data to 1 or many benchmarks. The process that I use to get the data returns only the fund and 1 bench. Then I have to re-run for the second bench and so-on. If i could grab all data at once, this would not even be a problem, but unfortunately, that is not the case... If I could override the caching that would be what I need...
Dean
mwilliams
If you could attach your current report design, I could take a look at it. Then, if you can reproduce this with a simple scripted dataSet and the sample dataSet to closely resemble your current setup, I can actually see what you're seeing. The way I'm taking what you're saying is that the dataSet parameter binding isn't working at all as it should. I'll look forward to receiving your report!
crowt999
not sure I can attach it here, but can I email to you ? (corp stuff, y'know)
crowt999
I was able to create a SQL query against the cars database using a dataset parameter in the where clause, and then use a nested table to retrieve 3 times against the database for 3 different order numbers. It looks like that works, so in the SQL dataset, the parameter binding seems to be working correctly.
This leads me to believe that the issue lies with the ODA plugin that I am using to grab my data. It is not currently set up to look at parameters of the dataset, just parameters of the report. So my guess is that the birt engine does not know there is a dynamic parameter set, and does not retrieve the dataset everytime that parameter changes. So basically, our internal code seems to be the issue.
Not quite sure how to proceed at this point, but if I cannot force the retrieval of the ODA data somehow, I will have to come up with something else (that will no doubt be ugly)
Attached is the report using the cars database that actually works, so you might see what I was trying to accomplish... Thanks for all the help - if you think of anything, please let me know..
mwilliams
Dean,
I see. That sucks that it is not a simple design issue. I'll check into whether there is a property file variable that can be set to turn off the data caching. I'll let you know if I find anything. Feel free to email me your report design if you'd like. I don't know if it's necessary now because you've figured out it's not the BIRT report setup. Either way, my email is mwilliams@birt-exchange.com.
crowt999
Thanks again Michael!
mwilliams
Dean,
The following settings might help.
You can set these in script reportContext.getAppContext().put(setting, value);
DataEngine.DATA_SET_CACHE_ROW_LIMIT
This setting allows user to cache a data set in disk. If set to negative value, all rows in data set will be cached. If set to zero, the function is disabled. If set to positive number, specific number of rows will be cached. Should only be used in a design situation.
DataEngine.MEMORY_BUFFER_SIZE
Memory per Query that is used before caching to disk. Defaults to 10 MB. Used inside and outside of designer.
DataEngine.MEMORY_DATA_SET_CACHE
This setting allows user to cache a data set in memory. If set to a number equal or less than zero, the function is disabled. If set to a positive number, exactly that number of rows will be saved to memory. Should only be used in a design situation.
You may need to import this package:org.eclipse.birt.data.engine.api.
crowt999
Michael - I would need the setting to work on the server we have running, so I don't think these will do it, bu thanks anyway!...
Now for my next question... Since my benchmarks can be in number from 1 to X, i did a quick check for all my accounts, and right now, the max is 3. So if I plan for 5, then I should be ok. Now I am planning on adding 5 ODA datasets to my report, and setting up 5 tables to retrieve them all in advance. My question is this. Say I only get 1 or 2 benchmarks, is there anyway to prevent the 3rd, 4th, 5th tables from executing? I'm thinking that at run-time, maybe I can test for the number of benches, then would it be possible to delete the extra tables at run-time before they get retrieved. ?
Thanks in advance for your thoughts..
Dean
mwilliams
Dean,
You could separate your parameter into an array and check the length in your beforeFactory method of your report. You could then name your tables and drop the appropriate ones depending on the length of the parameter.
Hope this helps.
crowt999
that sounds like what I was thinking.. If you have a quick example of dropping a table in code - could you post it... Otherwise I will figure it out... Again - thanks...
mwilliams
Dean,
Here's an example from the devShare that shows how to drop a table based on a parameter. Hope it helps.
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1027-drop-a-table-based-on-a-report-parameter/
crowt999
Mike - I don't see the attachment or link ? Dean
mwilliams
Dean,
The link is there. I added it 5 seconds after I posted it and saw I forgot it, so if you were that quick at getting in, it might not have been there.
crowt999
Thanks again man....