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

Report Book Report Parameters Not Working

5 Answers 233 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 17 Apr 2011, 02:00 AM
Hi,

I'm having trouble with the Report Book feature when adding multiple reports and setting their Parameter values. I'm adding the same report multiple times to the Report Book but setting different parameter values for each report added. In short, the generated report book contains the correct number of reports but is only using one of the parameter values supplied. Thus all of the report book items are showning exactly the same thing.

I've debugged the report book when it is being created/setup and each report paramater value is as it should be. For some reason the rendered report is only using one of the paramter values for all of the report book items. It doesn't seem to make sense.

Here is my code (VB.net 3.5):

Public despatchItems As New List(Of Integer)

despatchItems is just a List of integer values that is used to set the parameter value of each report.
 

Dim
batchDespatchNoteReport As New ReportBook
 For x As Integer = 0 To despatchItems.Count - 1
     batchDespatchNoteReport.Reports.Add(New DespatchReport())
     batchDespatchNoteReport.Reports(x).ReportParameters(0).Value = despatchItems.Item(x)
     batchDespatchNoteReport.Reports(x).PageNumberingStyle = PageNumberingStyle.ResetNumberingAndCount
 Next
 batchDespatchNoteReport.DocumentName = "Despatch Note(s)"
 rptViewer.Report = batchDespatchNoteReport

I'm using reporting version (latest version): Telerik_Reporting_Q1_2011_v5_0_11_316
This is done in WPF Vb.net 3.5 SP1 with the Telerik Reporting Viewer.

Any suggestions is greatly appreciated.

Thank you for your time.

5 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 17 Apr 2011, 02:17 AM
Ok, I've added the following MessageBox code after I set the ReportView.Report and it is displaying that the parameters of each report book item as the same value.

rptViewer.Report = batchDespatchNoteReport
For y As Integer = 0 To batchDespatchNoteReport.Reports.Count - 1
    MessageBox.Show(batchDespatchNoteReport.Reports(y).ReportParameters(0).Value.ToString, "UnitID")
Next

Maybe I should try setting the report parameters after 'rptView.Report' is set, then refresh the report.

I will post back my results.
0
Robert
Top achievements
Rank 1
answered on 17 Apr 2011, 02:30 AM
Ok, no luck there.

I guess the problem is coming because I'm adding a report multiple times that has the same name.

 
batchDespatchNoteReport.Reports.Add(New DespatchReport())

The example in the telerik documents shows that each report added has a different name:
reportBook.Reports.Add(New ReportA())
reportBook.Reports.Add(New ReportB())
reportBook.Reports.Add(New ReportC())


I'm open for suggestions.

Thanks.
0
Robert
Top achievements
Rank 1
answered on 21 Apr 2011, 03:44 AM
** bump **

Are there any ways around this problem?
0
Steve
Telerik team
answered on 21 Apr 2011, 01:35 PM
Hi Robert,

Have you set the Mergable property of the report parameter to false? You can find more information about the report book parameters in the Report Book help article.

Kind regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Robert
Top achievements
Rank 1
answered on 21 Apr 2011, 11:48 PM
Thank you Squire. That was exactly what I was looking for. Your helps is greatly appreciated.

batchDespatchNoteReport.Reports(x).ReportParameters(0).Mergeable = False

Thread closed.
Tags
General Discussions
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Steve
Telerik team
Share this question
or