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

Trouble with Detail Section Layout

5 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ChuckRock
Top achievements
Rank 1
ChuckRock asked on 04 Feb 2014, 10:31 PM
Hello,

I have searched the forums, but can't seem to find an answer to this problem.  I'm designing a report that is a bit tricky; I'm trying to get the data to populate two sections of the report from multiple data records.  It would seem logical to have multiple detail areas that could be filled to accomplish this layout; but I can't figure out how to do this...

I'm using the designer within Visual Studio.

See below for a generic example.

Sample layout using 3 data records:

Detail Section

Fields.Pool[From record 1]    Fields.Value0[From record 1]  
Fields.Pool[From record 2]    Fields.Value0[From record 2]  
Fields.Pool[From record 3]    Fields.Value0[From record 3]  

Fields.Value1[From Record 1]    Fields.UserName[From record 1]  
Fields.Value1[From Record 2]    Fields.UserName[From record 2] 

Fields.Value1[From Record 3]    Fields.UserName[From record 3] 

Thanks for taking the time to look at this; if you have any ideas on how I can accomplish this, I'd be very grateful!

-Chuck

5 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 07 Feb 2014, 01:54 PM
Hello Chuck,

There is no option to add a second Detail section to the report. Instead, to achieve your scenario, you can add multiple data items (Table/List) to the report.
For example, you can add two Table items to the report and set the same data source to both of them. The first one will display Fields.Pool and Fields.Value0 while the second one will display Fields.Value1 and Fields.UserName.

Please, let us know if you have additional questions.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
ChuckRock
Top achievements
Rank 1
answered on 07 Feb 2014, 03:10 PM
Nasko,

That suggestion worked wonderfully!

Thanks so much for your help on this, i greatly appreciate it.

-Chuck
0
ChuckRock
Top achievements
Rank 1
answered on 07 Feb 2014, 04:43 PM
Ok,  

I guess I have one more question.  I'm having trouble binding the data to the table items.

Here's the code I use to bind the data to the report, but I am at a loss as to where to bind the data to each table.

Private Sub FillReport()
    Dim ConnectionString As String = WebConfigurationManager.ConnectionStrings("DBString").ConnectionString
    Dim theAdapter As MySqlDataAdapter
    Dim sql As String = "SELECT * FROM Rpt1 WHERE SystemID = " & C.UserID
    theAdapter = New MySqlDataAdapter(sql, ConnectionString)
 
    Dim Report3 As New Reporting.StatisticalReport3x
 
    Report3.DataSource = theAdapter
 
    ReportViewer1.Report = Report3 ' Individual Statistics
 
    ReportViewer1.RefreshReport()
End Sub

Where would I attach the correct data to the tables?  It is the same data source as the main report.  I just can't figure out how to apply the datasource to each table.

Thanks!

-Chuck
0
Nasko
Telerik team
answered on 12 Feb 2014, 03:17 PM
Hello Chuck,

In order to access the table items from the calling application you can proceed directly following the report hierarchy e.g.:
Dim table As Telerik.Reporting.Table = TryCast(report.Items.Find("myTableName", True)(0), Telerik.Reporting.Table)
table.DataSource = myDataSource

Still our consideration is instead to use a declarative approach with the SqlDataSource that supports parameters and pass the user id with a report parameter to the report source.

Regards,
Nasko
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
ChuckRock
Top achievements
Rank 1
answered on 12 Feb 2014, 03:57 PM
Nasko,

As always, you are a great help!

Thanks so much for taking time to help me out.

Regards,

Chuck
Tags
General Discussions
Asked by
ChuckRock
Top achievements
Rank 1
Answers by
Nasko
Telerik team
ChuckRock
Top achievements
Rank 1
Share this question
or