Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I would set the report parameters as Internal but read up on this article <a href="http://msdn.microsoft.com/en-us/library/aa337234.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa337234.aspx</a> for the section Hidden and Internal Parameters and decided for yourself what is appropriate to the problem.</p> <p>Assuming you have a stored proc like</p> <pre><code>CREATE PROCEDURE dbo.RepeatAfterMe ( @inputText varchar(50) , @repeatFactor int = 10 ) AS BEGIN SET NOCOUNT ON DECLARE @count int DECLARE @hack TABLE (inputText varchar(50)) SET @count = 0 WHILE @count &lt; @repeatFactor BEGIN INSERT INTO @hack SELECT @inputText SET @count = @count + 1 END SELECT H.* FROM @hack H END GO </code></pre> <p>Define 2 report parameters in SSRS (InputText as string, RepeatFactor as integer). Then, in your SSRS, your dataset would be defined like</p> <blockquote> <p>EXECUTE dbo.RepeatAfterMe @inputText, @repeatFactor</p> </blockquote> <p>And then on the Parameters tab of the dataset, it would look like</p> <pre><code>@inputText =Parameters!InputText.Value @repeatFactor =Parameters!RepeatFactor.Value </code></pre> <p>For completeness of solution, this is an approximation of the code I use to pass parameters in to a report control with an ID of rvReportViewer</p> <pre><code>Microsoft.Reporting.WebForms.ReportParameter[] reportParameters = null; reportParameters = new Microsoft.Reporting.WebForms.ReportParameter[2]; reportParameters[0] = new Microsoft.Reporting.WebForms.ReportParameter("inputText", txtInput); reportParameters[1] = new Microsoft.Reporting.WebForms.ReportParameter("repeatFactor", 10); try { rvReportViewer.ServerReport.SetParameters(reportParameters); } catch(Microsoft.Reporting.WebForms.ReportServerException ex) { Response.Redirect("~/Error.aspx"); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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