any help is appreciated.
4 Answers, 1 is accepted
Currently every time the report is previewed, paged or exported through the report viewer it is processed and rendered from scratch. That is why the most probable reason why the values are missing upon export is because they are set in event/method that is not invoked upon export. Set breakpoints and verify if this is indeed the case and if so, move the code to accessible place e.g. the report constructor (after InitializeComponent) or to the Page_Load event if you are setting the values from the calling application. If those values are coming from a database, you might consider using our Table item which is meant exactly for tabular layout and has its own Datasource property which can be accessed through the flexible Report API.
All the best,
Steve
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
var _raNumber = this.ReportParameters["RANumber"].Value.ToString();
that value is always null.
The second solution you posed - the report doesnt have a page load event - im working in silverlight - so if you were implying that use the page load on my aspx page i dont have access to that.
Any continued help is appreciated, I have a client that needs this done asap.
Thanks
The NeedDataSource event is meant to be used only for providing data source to the report and that data source is cached unless changed i.e. once cached the NeedDataSource event is not fired again. As you probably know every time the report is previewed, paged or exported through the viewer it is processed and rendered from scratch. During this processing, the cached data source is used, but NeedDataSource is not fired second time. That is why any other changes should be moved to ItemDataBinding event which is fired regardless.
All the best,Peter
the Telerik team
In your original post you did not mention that you use the report parameters for this purpose, on the contrary you gave example with txt25000.Value and that is why one of the suggestions was to use the report constructor. The fact that the report parameters return null in the constructor is expected behavior as they have just been initialized and do not have value yet.
The information in the docs you have found is correct - in case you set item values in NeedDataSource, you should use ItemDataBinding instead.
Kind regards,
Steve
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>