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

Exported file contains a hidden field.

1 Answer 91 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Adil
Top achievements
Rank 1
Adil asked on 17 Apr 2012, 07:55 PM

Hi,

I am using Telerik Reporting Q2 2011 with Silverlight 4. In NeedDataSource event I am hiding a field at run-time if the data source returns a “Null” value for it. It works fine and report viewer does not show that field. However, when I export the report in any format then the exported file contains this field.

I also tried to do it in other way and set visible = false at design time for the field and set Visible = true at run-time, if data source have value for it. It displays the field successfully in the report viewer but does not show it at all in the exported file.

Please suggest a possible solution how I can overcome this problem.

Thanks!

Adil

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 18 Apr 2012, 08:41 AM
Hi,

The NeedDataSource event is meant to be used only for providing data source to the report. Once the report is bound, the data source is cached and NeedDataSource event is no longer fired, unless it depends on report or data source parameter. Every time the report is previewed, exported or printed through the viewer it is processed and rendered from scratch, and the data caching improves the performance for these operations. Any other code irrelevant to providing data to the report should be moved to ItemDataBinding event which is fired regardless of whether the report is bound or not.

Greetings,
Steve
the Telerik team
BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >
Tags
General Discussions
Asked by
Adil
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or