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

Textbox loses value when returning from drill through report

4 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 12 Oct 2012, 05:27 AM
Hello,

I am using Telerik Reporting Q1 2012 (6.0.12.215).  I have a main report whose datasource is an object that returns a <List> collection. I also have two other fields in the report header that are set when the report is instantiated, these textboxes are set with parameters from my Winform application.  Also on this main report is a field that allows us to drill through to another report. When the field is clicked the drill through report opens fine however when I go back to the main report the value of the fields in the report header are gone however the datasource still maintains it result set.

How can I ensure that the values in the textboxes remain after I return to the main report...as it looks like their values are lost when navigating to the drill through report.

Thanks,

Kerry

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Oct 2012, 10:38 AM
Hello Kerry,

When you say "these textboxes are set with parameters from my Winform application" do you mean that you're using Report Parameters to set their values from your application? If yes, where and how do you set the report parameter value? We've tested this scenario with the latest official Reporting version and it worked as you expect - the value of the parameter was preserved upon returning to the original report. So we would appreciate if you try with the latest version and let us know if further help is needed.

Regards,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Kerry
Top achievements
Rank 1
answered on 16 Oct 2012, 12:55 PM
Hello,

My post was slightly confusing, the parameters are values on an overloaded constructor for the report, as you can see below I have a report called BalanceSheetReport.  In the code behind constructor I pass values from my winform application.


public BalanceSheetReport()
{
InitializeComponent();
}

 public BalanceSheetReport(List<BalanceSheet> balancesheetList, string dateRange, string firmName)
{
            //
            // Required for telerik Reporting designer support
            //
            InitializeComponent();
            this.objectDataSource1.DataSource = balancesheetList;
            this.txtDateRange.Value = dateRange;
            this.txtFirmName.Value = firmName;
}


When I call the report I pass the values.  Its the last two values 'dateRange' and 'firm.FirmName' which are displayed in the ReportHeader section.  These values are lost when I go 'back' from a drill through report.  Funny enough the Datasources <List> collection seems to remain intact as the details of the report are still shown.
BalanceSheetReport rpt = new BalanceSheetReport(balancesheetList, dateRange, firm.FirmName);
this.reportViewer1.Report = rpt;
this.reportViewer1.RefreshReport();

Thank you,

0
Steve
Telerik team
answered on 19 Oct 2012, 11:31 AM
Hello Kerry,

Thanks for the clarification, unfortunately your scenario would not work, as the reports instantiated in drill-through action would always be instantiated through the default parameterless constructor. This information is available in the Drillthrough Report Action help article. We suggest using Report Parameters if it is necessary to pass values from your application.

All the best,
Steve
the Telerik team

HAPPY WITH TELERIK REPORTING? Do you feel that it is fantastic? Or easy to use? Or better than Crystal Reports? Tell the world, and help fellow developers! Write a short review about Telerik Reporting and Telerik Report Designer in Visual Studio Gallery today!

0
Kerry
Top achievements
Rank 1
answered on 29 Oct 2012, 01:33 PM
Thanks for the response, actually its the overloaded constructor on the Main report that is not executed when you return from the drill through report by pressing back.  However I did follow your suggesting and used ReportParameters (set to visible=false) on the main report and they are holding there values when the returning back from the drill through.  Thank you.

GeneralLedger rpt = new GeneralLedger(GLList);
rpt.ReportParameters["Company"].Value = firm.FirmName;
rpt.ReportParameters["DateRange"].Value = dateRange;
this.reportViewer1.Report = rpt;
this.reportViewer1.RefreshReport();
Tags
General Discussions
Asked by
Kerry
Top achievements
Rank 1
Answers by
Steve
Telerik team
Kerry
Top achievements
Rank 1
Share this question
or