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

Saving a value

1 Answer 131 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chameleoki
Top achievements
Rank 2
Chameleoki asked on 16 Oct 2008, 09:11 PM
I'm sure this is just my understanding but it's driving me crazy.  I've reviewed all the documents I can find on page life, etc. but this is what I'm trying to do.

-Passing a value to the report via my website (working with a public property on the report).
-Based upon that passed value, set a string that renders to the header and footer (textbox).

I've tried doing this by:

Partial Public Class CustomerInvoice
    Inherits Report
    Public strCompanyName As String
...

but this doesn't work because of the lifecycle of the report (from what I've read it renders the header and footer after everything as a new report so that value is cleared/nothing)

So I tried ReportParameters to save the value (the OrderID is the one being passed and works):

Public WriteOnly Property OrderID() As Integer
        Set(ByVal value As Integer)
                Me.ReportParameters("CompanyName").Value = value
        End Set
 End Property

Private Sub tbxPayableTo_ItemDataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles tbxPayableTo.ItemDataBound
        Dim strCompanyName As String = Me.ReportParameters("CompanyName").Value
            Dim tbxPayableTo As Telerik.Reporting.Processing.TextBox = DirectCast(sender, Telerik.Reporting.Processing.TextBox)
            tbxPayableTo.Value = "Make all checks payable to " & strCompanyName
End Sub

But the value is blank.

So the question is, how can I save a value to make sure it's available over the life of the report to render in the header/footer?  I have read other topics and examples and I must be missing something.

A quick example would be great.

Thanks.


1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 21 Oct 2008, 09:04 AM
Hello Chameleoki,

Have you tried setting it directly to the Value property of the textbox item in design time and if so what is the result? We also noticed that you're not using the latest official version Q2 SP2 - please upgrade. If still having problems, please open a support ticket and send us your app that shows the issue at hand.

All the best,
Steve
the Telerik team

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