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

Refresh after preview button click

3 Answers 348 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SC
Top achievements
Rank 2
SC asked on 24 Jun 2009, 12:02 PM
Greetings,

As a parameter i am using a dropdown with organisations. Each organization has settings which i select in a NeeddataSource event for a chart.
When using these settings to update the background color of the header section, set a new picturebox image or use the parameters to fill textboxes in the detail section the report doesn't show these changes.
Only after a click on the refresh button of the reportviewer the changes are shown.

Any ideas how to get this to work?

With regards,

Peter

3 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 25 Jun 2009, 10:56 AM
Hi P. Brouwers,

Parameters are usually used for filtering the data that gets loaded into the report. Changing the appearance of the report is mainly controlled through conditional formatting. As long as the report has no datasource set i.e. this.DataSource = null in the constructor, its NeedDataSource event would be fired and any changes you've made to the processing objects (see processing vs. definition) would be applied. In this line of thoughts verify that your NeedDataSource event is fired when making changes.

Greetings,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
SC
Top achievements
Rank 2
answered on 25 Jun 2009, 01:33 PM
Hi Steve,

If i understand correctly i can't do:

this

 

.pageHeader.Style.BackgroundColor = System.Drawing.Color.FromName("Green"));

in the needdatasource event?

This works when i refresh the report.

Or is there a way to refresh it still?

This would be a pity, cause having this functionality would greatly enhance reporting possibilities.

With regards,

Peter

 

0
Steve
Telerik team
answered on 29 Jun 2009, 09:28 AM
Hello Peter,

In the current implementation changing the StyleName of the definition item will not change anything and this is by design. This property takes effect only if set before a report is being processed. However using the processing item instead should work:

 private void Report1_NeedDataSource(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.Report procReport = (Telerik.Reporting.Processing.Report)sender;
            Telerik.Reporting.Processing.PageSection procPage = (Telerik.Reporting.Processing.PageSection)procReport.ChildElements.Find("pageHeaderSection1", true)[0];
            procPage.Style.BackgroundColor = System.Drawing.Color.FromName("Green");
        }

Sincerely yours,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
SC
Top achievements
Rank 2
Answers by
Steve
Telerik team
SC
Top achievements
Rank 2
Share this question
or