This is a migrated thread and some comments may be shown as answers.

BusinessObject binding and collection refresh

6 Answers 225 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rodion
Top achievements
Rank 1
Rodion asked on 07 Dec 2008, 11:49 AM
Hi,

I am using BusinessObject datasource biding and I have designed my report, now here is the challenge. I need to be able to modify my object collection every time they press a refresh.

I have highly complex statistical report which generates objects based on parameteres (report.ReportParameters[]) and every new set of parameters may imply a completely new set of objects in my collection

Hence, I need some sort of event or function override (I was expecting to use NeedDataSource event on report level) which gets fired every time new data is required. I cannot pre cache all data in constructor (as it is suggested in example) because my data is dependant on parameters that I don't know.

Your help is very much appreciated.

Rodion Pronin

6 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Dec 2008, 02:34 PM
Hello Rodion,

Reading your explanation, the NeedDataSource event is exactly what you would need. You can give it a spin and let us know if further help is needed.

Best wishes,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rodion
Top achievements
Rank 1
answered on 08 Dec 2008, 03:50 PM
Yes I kind of got it to work. Now the only problem I have is being able to plot charts against my data.

Here is the next challenge I am facing, and even though I have a workaround, this workaround is pretty messy, and I've love to see if there is a better solution.

I have a chart, which resides in a a group header (as I need to plot 3 series in one chart against an aggregate). When I run report, my report shows 4 charts, which is correct, as there are 4 aggregate groups on my dataset, and I get 4 NeedDataSource events fired. Now the challenge is that I don't know which object (or which aggregate group) is currently being rendered by chart to properly feed it the data it needs. Every time that event gets fired, I have an identical instance of the chart, and I don't know which aggregate group is being handled. The only way I found was to to access raw rendering data, that is:

((DataRowView)chart.DataItem).Row["FacilityId"])

where FacilityId is a property name on my object

 

 

 


which is pretty ugly, it's not strong typed. Now, I have to verify through reflection that the property is indeed present in that object.

Naturally, I would expect to see something like 'object DataBoundItem' (or something along those lines) property on the chart itself (which I can cast), passed on to NeedDataSource, in case of a DataTable binding, that item would be DataRow, in case of object databinding it would be an object itself. And give users access to that item so that we can modify it, to truely control datasource.

I hope my description makes sense, after sleepless night of trial/error :)

Best regards,
Rodion Pronin

 

0
Steve
Telerik team
answered on 09 Dec 2008, 08:27 AM
Hi Rodion,

Unfortunately this is the only available approach for the time being. We are available of this limitation and have in mind changes to the chart item for a subsequent version.

Please excuse us for the temporary inconvenience.

Kind regards,
Steve
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Rodion
Top achievements
Rank 1
answered on 09 Dec 2008, 03:36 PM
thank you
0
Rodion
Top achievements
Rank 1
answered on 09 Dec 2008, 04:42 PM
And final question (I hope), which may not really belong to this topic, but I don't want to duplicate forum threads:

Reporting chart perfomance, I have to present a relatively simple chart, that is I have to show 3 values per every day of the month.

I have a line chart with 3 series each of which has 28 - 31 values.

and I have 4 of those charts on a report, hence I have to render no more than 95 points 4 times per report. In statistical terms these information should be negligibly small and should be rendered almost instanteneously. Now I have a serious rendering issue, I wish I could upload my screenshots, but rendering of such report (and I am using winforms to test my reports, but ultimately those reports will be executed on the web) could take up to 5 - 10 minutes with huge CPU intensity. My Task manager CPU counter goes off the through the roof.

any suggestions are highly appreciated, worst case I'd have to drop any charts from report (which by the way makes report renerding almost instant, so I'm pretty certain it is the chart that makes it die)...

Rodion
0
Accepted
Chavdar
Telerik team
answered on 12 Dec 2008, 02:43 PM
Hi Rodion,

The rendering speed of the chart when there are many series items is mostly affected by the Intelligent Labels functionality. In order to improve the performance you can turn it off from the [chart].IntelligentLabelsEnabled property.

Hope this helps.

Greetings,
Chavdar
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Rodion
Top achievements
Rank 1
Answers by
Steve
Telerik team
Rodion
Top achievements
Rank 1
Chavdar
Telerik team
Share this question
or