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

Need to ad instance report to Textbox.ItemDefiniton.Action

4 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Aditya
Top achievements
Rank 1
Aditya asked on 05 Mar 2013, 07:41 AM
Hi,
I want to set instance report to textbox.itemdefinition.action from itemdatabound event in telerik report. Plz provide solution.
Regards,
Aditya

4 Answers, 1 is accepted

Sort by
0
Aditya
Top achievements
Rank 1
answered on 06 Mar 2013, 06:59 AM
Hi,
Please provide solution for the above issue.
Regards,
Aditya
0
IvanY
Telerik team
answered on 07 Mar 2013, 11:29 AM
Hello Aditya,

You will have to do this via binding. To do so first create a user function which will look like this:
public static IAction Navigate()
{
    return new NavigateToReportAction
    {
        ReportSource = new InstanceReportSource
        {
            ReportDocument = new Invoice()
        }
    };
}

Since the function is of type IAction you can create whatever action need and return it. Currently I am directly returning a new NavigateToReportAction. Then in your report click on the textbox and go to the property grid. Select Bindings, add new and choose Action for PropertyPath and your user function as the Expression.

I hope that helps.

Greetings,
IvanY
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

0
Aditya
Top achievements
Rank 1
answered on 08 Mar 2013, 09:36 AM
Hi,
Thanx for the reply. But how I'm I supposed to pass dynamic parameters to InstanceReportSource report programmatically..??
Scenario: When I click on textbox value, I haveto pass the adjacent textbox values(row as well as column value) as parameters to the report.

One more thing : I want to find textbox1 value in item databound event of textbox2.

Please provide solution

Regards,
Aditya

0
Elian
Telerik team
answered on 12 Mar 2013, 12:43 PM
Hello Aditya,

The parameters can be added directly to the ReportSource (their names should match the Report parameters names).
var reportSource = new InstanceReportSource
        {
            ReportDocument = new YourReport()
        };
reportSource.Parameters.Add(new Telerik.Reporting.Parameter("OrderNumber", "SO43659"));

To find adjacent controls on ItemDataBound, you should use the ElementTreeHelper
private void detail_ItemDataBound(object sender, EventArgs e)
{
    var txt1 = (Telerik.Reporting.Processing.TextBox)sender;
    var txt2 = (Telerik.Reporting.Processing.TextBox)
Telerik.Reporting.Processing.ElementTreeHelper.FindChildByName(txt1.ParentElement,
"textBox2", true)[0];
}

  

Kind regards,
Elian
the Telerik team

Telerik Reporting Q1 2013 available for download with impressive new visualizations. Download today from your account.

Tags
General Discussions
Asked by
Aditya
Top achievements
Rank 1
Answers by
Aditya
Top achievements
Rank 1
IvanY
Telerik team
Elian
Telerik team
Share this question
or