pandeysk_13 0 Newbie Poster

hi all,

i am in trouble to solve this.

i want to show the report in the manner in which the tablix column 1 record should continue in the

same page in column 2.

LIKE THIS:

column1 column 2

1 6

2 7

3 8

4 9

5 10

and if their is space in the page just continues.

and if not go to next page.

i am filling my report with this code:

Conn.Open()
                Dim sReportDataSource As New ReportDataSource
                Dim drow As DataRow
                Dim row As DataRow = Nothing
                Dim DS As New DataSet
                Dim dt As New DataTable
                DS.Tables.Add("tblstudentsregistrationBA")
                drow = dt.NewRow
                'ADD THE COLUMNS TO THE TABLE
                With DS.Tables(0).Columns
                                      .Add("BA_I_roll_number", Type.GetType("System.String"))

                End With
                For Each dr As DataGridViewRow In DGVfinal.Rows

                    row("BA_I_roll_number") = dr.Cells("rollnumber").Value.ToString                   

                    DS.Tables(0).Rows.Add(row)
                Next
                'Create a report parameter for the sales order number 
                sReportDataSource.Name = "DataSet1"
                sReportDataSource.Value = DS.Tables(0)
                RDLCreportview.ReportViewer1.LocalReport.ReportPath = Application.StartupPath & "\Reports\classsubjectlistBA.rdlc"
                RDLCreportview.ReportViewer1.LocalReport.DataSources.Add(sReportDataSource)
                Dim rpEmployeeSSN As New ReportParameter()
                rpEmployeeSSN.Name = "course"
                rpEmployeeSSN.Values.Add(" Course :- " & cmbcourse.Text & "")

                'Set the report parameters for the report
                Dim parameters() As ReportParameter = {rpEmployeeSSN}
                RDLCreportview.ReportViewer1.LocalReport.SetParameters(parameters)

                RDLCreportview.ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
                RDLCreportview.ReportViewer1.RefreshReport()
                DS.Dispose()
                DS = Nothing
                RDLCreportview.ShowDialog()
                RDLCreportview.Dispose()
                Conn.Close()

SOME one suggest me to use two tablix with expression:

the expression i used in first tablix: =iif(rownumber(nothing)<30,Fields!BA_I_roll_number.Value,"")

but it is not giving result
for second the expression used: =iif(rownumber(nothing)>=30,"",Fields!BA_I_roll_number.Value)
kindly help me for this.

thanks in Advance

Dani AI

Generated

For — two reliable ways to get the detail rows to flow down column 1 and continue in column 2 on the same page.

The easiest, designer-side option is to use the report's multi‑column layout (newspaper style). Open the .rdlc in the report designer, click the gray area outside the body to expose the Report properties, set Columns = 2 and a ColumnSpacing. Make sure the body/tablix width is no wider than the calculated column width. Use this formula to size things precisely:
ColumnWidth = (PageWidth − LeftMargin − RightMargin − (Columns−1)×ColumnSpacing) / Columns.
For example, Letter (8.5") with 0.5" margins and 0.2" spacing gives ColumnWidth = (8.5 − 1.0 − 0.2)/2 = 3.65". Preview in Print Layout or export to PDF to see the multi‑column flow.

If designer columns are not desirable, reshape the data before binding so one tablix row contains the two side‑by‑side values. Build a DataTable with two columns (Col1, Col2), compute rowsPerColumn = Ceiling(totalRows/2), then fill row i with source[i] and source[i + rowsPerColumn] (if present). Bind that table to a single tablix with two textboxes on each row — this produces exactly the 1/6, 2/7 layout and avoids blank space problems. Example algorithm in VB:

' collect source values into List(Of String) called vals
Dim perCol = CInt(Math.Ceiling(vals.Count / 2.0))
Dim dt As New DataTable()
dt.Columns.Add("Col1", GetType(String))
dt.Columns.Add("Col2", GetType(String))

For i = 0 To perCol - 1
  Dim r = dt.NewRow()
  r("Col1") = vals(i)
  If i + perCol < vals.Count Then r("Col2") = vals(i + perCol)
  dt.Rows.Add(r)
Next
' bind dt as the report datasource

Notes: hiding cell text with IIF/RowNumber often leaves the row height reserved, which is why two tablix + IIF gave blank gaps. If splitting by row index, prefer to compute the split in code or SQL (ROW_NUMBER on the server) rather than relying on in‑report expressions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.