SQL Server Performance

Error passing parameters to a sub report.

Discussion in 'SQL Server 2005 Reporting Services' started by RGKN, Jan 2, 2008.

  1. RGKN New Member

    I am using Visual Studio 2005 to create some reporting services reports. I am passing data from a dataset returned from a stored procedure in a top level report into a subreport. I am using a table so that each line record in the dataset is passed into the subreport. i have created parameters in the subreport (in the case of the error below called "paragraph_3" and of data type String) and in the top level report (which calls my SP) I have right clicked on the subreport item chosen Properties, it is then possible to specify the parameters I pass to sub report on the Parameters tab. I selected the parameter Paragraph_3 and specified =Fields!Paragraph_3.Value, the field in my dataset. This should, regardless of whether I put paragraph 3 on the subreport for display, mean that when I preview the top level report the value of paragraph_3 is passed to the subreport. I have been getting the following error message:
    [rsErrorExecutingSubreport] An error occurred while executing the subreport ‘Content’: An attempt was made to set a report parameter 'Paragraph_3' that is not defined in this report.
    Preview complete -- 0 errors, 1 warnings
    Now this has been vexing me some what as the parameter has been set to allow blanks and nulls, and data is being returned from my stored procedure. The paragraph_3 field is nvarchar(4000) on the SQL database. However I have discovered that if I debug the report and run it in the debug window no error is returned and it is only when I close the subreport in the VS2005 report designer and preview the top level report that the error goes away and my data is correctly passed to the subreport.
    It seems to me that this may be an irritating bug in Reporting Services and VS2005 or that I am missing something, perhaps caching, I believe that I have installed SP2 for VS2005, has anyone else experienced this or know of a fix/workaround?
    Regards,
    Robert.
  2. satya Moderator

    How about service pack level on SQL & Reporting services?
  3. RGKN New Member

    Satya,
    Thanks, I was under the impression that my PC had had the SQL client tools service packed, however it seems not to have been the case. Applying SP2 for SQL 2005 seems to have solved the problem. Sorry not to have checked that before asking.
    Regards,
    Robert.
  4. RGKN New Member

    That said, it hasn't actually solved the problem, although I am not sure why it seemed to work when I tried it earlier. I also meant SP1 for Visual Studio 2005.
    Any more ideas? If not at least I have a workaround.
    Robert.
  5. dineshasanka Moderator

    verify whether your properties of variables are same. check things like variable type and multi parameter set
  6. RGKN New Member

    The properties are consistent for each of my parameters i nthe sub-report The ones that are set are as follows
    datatype: String
    Allow null value: true
    Allow blank value: true
    Available values: non-queried (none specified)
    Default values: null
    But really the point is not that the report can (edited - meant can, not can't !) be made to work, but that in order for the error to go away I have to close the subreport in the designer.
  7. RGKN New Member

    In addition to this, if I make a change to the subreport, for example adding a field to the view then I need to go through closing the subreport for the top level report to change. Is there some form of caching that I need to learn how to clear? Or is there a setting the report designer that can be changed?
    Regards,
    Robert.
  8. satya Moderator

    Check under report manager properties to see whether you are caching reports or not.
  9. RGKN New Member

    Satya,
    When I publish the report and look at its properties in the RS report manager the execution properties are set so that "Do not cache temporary copies of this report" is selected. My issue is when I use the SQL Server Business Intelligence Development Studio or Visual Studio 2005 and run the report in the report designer.
    I have done quite a lot of searching to find execution options but have not been able to find any property that looks like it will do it. If I right click on the rdl and view its properties, I only see file name information. If I right click in the top left hand corner of a report an view the properties I can't see a suitably named property.
    Do you know here they are set?
    Thanks for your time replying to this thread.
    Regards,
    Robert.

Share This Page