locked
Passing a query string parameter RRS feed

  • Question

  • User375242171 posted

    Hi All,

    I have report (Built in Report Builder) with the following SQL:

    SELECT
      Products.ProductUniqueID
      ,Products.ProductID
      ,Products.CreatedBy
      ,Products.CreationDate
      ,Products.GenericName
      ,Products.BrandName
      ,Products.Strength
      ,Products.Form
      ,Products.PackSize
      ,Products.ProductStatus
      ,Products.MedicalAreaOfUse
      ,Products.TheraputicUse
      ,Products.StorageInstructions
      ,Products.HazardousMaterial
      ,Products.Cytotoxic
      ,Products.ControlledDrug
      ,Products.AwardsProduct
      ,Products.ATCCodes
      ,Products.Notes
      ,Products.DosesPerPack
      ,Products.Family
      ,Products.Pipcode
      ,Products.CountryOfLicense
      ,Products.CountryOfManufacture
      ,Products.Manufacturer
      ,Products.MarketingAuthorisation
      FROM
      Products
    WHERE Productuniqueid = @Productuniqueid

    The report is based on a parameter. ie The user has to type in the productuniqueID before the report can be run.  I have a ASP.net webpage linked to the same database.

    After a product search on the page information is pulled to the webpage. I would like the user to be able to print off the webpage as a Reporting Services report. I would like the user to be able to bypass this and print off the information from my query based on the productuniqueID..linked to the webpage. So in essence they dont need to input the productuniqueID.

    I understand this is called Passing a query string parameter to a report.

    Regards

     

     

    Monday, June 27, 2011 9:12 AM

Answers

  • User1471008070 posted

    Hi,

    It seems you want to pass a parameter's value to a rerport via URL. Actually, you can use parameters as part of a URL to configure the look and feel of your reports.  Parameters are case-insensitive and begin with the parameter prefix rs: if directed to the report server and rc: if directed to an HTML Viewer. The most common parameters are listed in this section http://msdn.microsoft.com/en-us/library/ms152835.aspx 

    If I misunderstand you ,please feel free to let me know.

    Thanks,
    challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 1, 2011 3:00 AM

All replies

  • User1471008070 posted

    Hi,

    It seems you want to pass a parameter's value to a rerport via URL. Actually, you can use parameters as part of a URL to configure the look and feel of your reports.  Parameters are case-insensitive and begin with the parameter prefix rs: if directed to the report server and rc: if directed to an HTML Viewer. The most common parameters are listed in this section http://msdn.microsoft.com/en-us/library/ms152835.aspx 

    If I misunderstand you ,please feel free to let me know.

    Thanks,
    challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, July 1, 2011 3:00 AM
  • User375242171 posted

    I have created a report in Report Builder. The SQL is as below:


    I have the exact same fields on a ASP.NET Page whereby the data is pulled from a database when the user enters a enquiryID into the search field.

    I would like the user to be able to print the exact same fields via my report which I have designed.

    So basically the user will click on a asp.net Link 'Print' and the reporting services print page will fire up.

    How can i achieve this without the user being able to type in the parameter before printing.

    The page has fields on there which are the same as the SQL i provided.

    What i want to achieve is for the user to be able to print off a report. The asp.net page will have a link which states Print.

    I would like the user to print off the details from the webpage. The report also has the same fields which i have coded in SQL.

    Instead of the user having to type in the EnquiryID (parameter) i would like the user to bypass this...and instead just print off the details relating to the enquiryID without having to enter the enquiryID.
    There is enquiryID field on the webpage.

    I understand this is called passing a query parameter

     

     




    SELECT
    Accounts.AccountUniqueID AS [Accounts AccountUniqueID]
    ,Accounts.AccountID
    ,Accounts.CreatedBy AS [Accounts CreatedBy]
    ,Accounts.Name
    ,Accounts.Trust
    ,Accounts.Address1
    ,Accounts.Address2
    ,Accounts.Address3
    ,Accounts.Address4
    ,Accounts.Address5
    ,Accounts.Address6
    ,Accounts.Postcode
    ,Accounts.Country
    ,Accounts.Telephone
    ,Accounts.Fax
    ,Accounts.Website
    ,Accounts.NatureOfBusiness
    ,Accounts.AwardsAccount
    ,Accounts.BDM
    ,Accounts.Notes
    ,Accounts.DateCreated AS [Accounts DateCreated]
    ,Enquiries.EnquiryID
    ,Enquiries.CreatedBy AS [Enquiries CreatedBy]
    ,Enquiries.DateCreated AS [Enquiries DateCreated]
    ,Enquiries.AccountUniqueID AS [Enquiries AccountUniqueID]
    ,Enquiries.FavouredMethodOfContact
    ,Enquiries.OpeningComments
    ,Enquiries.CustomerUpdateBy
    ,Enquiries.CheckBNF
    ,Enquiries.DateChecked1
    ,Enquiries.Initials1
    ,Enquiries.PrintMartindaleSheets
    ,Enquiries.DateChecked2
    ,Enquiries.Initials2
    ,Enquiries.ResearchedInfoAdded
    ,Enquiries.DateChecked3
    ,Enquiries.Initials3
    ,Enquiries.CountriesChecked
    ,Enquiries.CustomerQuoted
    ,Enquiries.PriceQuoted
    ,Enquiries.EnquiryStatus
    ,Enquiries.Description
    ,Enquiries.ConvertedToOrder
    FROM
    Accounts
    INNER JOIN Enquiries ON Accounts.AccountUniqueID = Enquiries.AccountUniqueid
    WHERE Enquiries.EnquiryID = @EnquiryID


    Thursday, July 7, 2011 6:57 AM