Avatar of Juan Velasquez
Juan Velasquez
Flag for United States of America

asked on 

Trying to create subreport

Hello,
I am teaching myself SSRS and am currently trying to create a subreport using Report Builder 2.0
I first created a parameter named CategoriesCategoryID with a datatype of integer and a default value of 1.
I then created a dataset named qryProducts using a previously created datasource name ProductSrc
In the dataset I created, I went to  dataset properties and entered the following in the Query tab of dataset properties

Query type: Text

Query:      Select
      Products.ProductName,
      Products.CategoryID AS ProductsCategoryID,
      Products.ProductID,
      Products.UnitPrice,
      Products.UnitsInStock,
      Categories.CategoryID AS CategoriesCategoryID
      FROM
      Categories
      INNER JOIN Products
      ON Categories.CategoryID = Products.CategoryID
      WHERE Categories.CategoryID = ?

In the Parameters tab of the dataset properties, for the parameter ? from the above select statement, I entered a [@CategoriesCategoryID] as the value

However after I do this the, the columns are not displayed for the dataset qryProducts.  I'm not sure why.  I do know when I delete the where clause or replace the question mark with a numerical value, the columns are displayes.  I've been trying to figure out what I'm doing wrong
Dataset.JPG
SSRS

Avatar of undefined
Last Comment
Juan Velasquez

8/22/2022 - Mon