title: How can I programmatically produce multiple copies of Crystal Reports (Details Section)?
body: <p>I have a web page that asks the user for an input number and based on the input, an SQL query is executed and the results is then fetched to fill a Crystal Reports page. Here is the code that searches the database and fills the report: (For simplicity, I removed a lot of query string that does not add value to the question, same goes for Crystal Reports fields)</p>
  
  <pre><code>Dim sql As String = ""
  sql = " SELECT * from table1 where input_id = '" &amp; INPUT_NUMBER &amp; "'"
  
  Dim ds As DataSet = getTable(sql)
  Dim orpt As New CrystalReport3
  CrystalReportViewer1.ReportSource = orpt
  orpt.DataDefinition.FormulaFields("fldMaterialID").Text = """" &amp; ds.Tables(0).Rows(0).Item("MATERIAL_ID").ToString &amp; """"
  orpt.DataDefinition.FormulaFields("fldMaterialID2").Text = """" &amp; ds.Tables(0).Rows(0).Item("MATERIAL_ID").ToString &amp; """"
  orpt.DataDefinition.FormulaFields("fldBar").Text = """" &amp; ds.Tables(0).Rows(0).Item("MATERIAL_ID_BAR_CODE").ToString &amp; """"
  orpt.Refresh()
  </code></pre>
  
  <p>I am trying to allow the user to view multiple copies of the report. I already tried:</p>
  
  <pre><code> orpt.PrintToPrinter(2, False, 0, 1)
  </code></pre>
  
  <p>But that did not work. I searched, but all the solutions I got were related to Crystal Reports with Saved Queries which is not an option for me.</p>