Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to make ReportViewer display multiple pages (e.g. one page per DataRow)?
    primarykey
    data
    text
    <p>I'm new to MS reporting. What I'm trying to achieve is to make a simple report which would be filled from a <code>DataTable</code> (made programmatically). The idea is to assing data for each page to values from <code>DataRow</code>. I.e. report page <code>1</code> would get its <code>TextBox</code> values from <code>DataTable.Rows[0]</code>, report page <code>2</code> would display values from <code>DataTable.Rows[1]</code> etc. Number of pages = number of <code>DataRows</code>.</p> <p>I've coded a WinForms app that gets a <code>DataTable</code> from SQL and filters it based on parameters supplied by user and then displays a Report.</p> <p>Then I created an empty dummy <code>DataSet</code> called <code>ComplianceFormDataSet</code> which contains all the field names I will need further. Then I made an <code>.rdlc</code>, added a <code>TextBox</code> to it with this expression:</p> <pre><code>=Fields!CustomerCode.Value </code></pre> <p>Here's the logic behind passing the data to ReportViewer:</p> <pre><code>DataTable MainDataTable = new DataTable(); MainDataTable.Columns.Add("CustomerCode", typeof(string)); MainDataTable.Rows.Add("Blah1"); MainDataTable.Rows.Add("Blah2"); ReportDataSource MainDataSource = new ReportDataSource("ComplianceFormDataSet", MainDataTable); MainReportViewer.LocalReport.DataSources.Clear(); MainReportViewer.LocalReport.DataSources.Add(MainDataSource); MainReportViewer.RefreshReport(); </code></pre> <p>When I build this a get a report with one page saying <code>"Blah1"</code>. How do I make it render two pages: one with <code>"Blah1"</code> and the second with <code>"Blah2"</code>? Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload