By passing a parameter to Print via reporting services

  • 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.

    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

  • Not sure I understand. In report viewer??? you have to supply to real dataset so in all actually the user has to supply or choose the stuff to print and you set the "parameters" that way.

    If that doesn't help please re-explain what you need, what you tried and what's the exact problem you're having.

    This site might be usefull to you.

    http://www.gotreportviewer.com/

  • Hi i am not using reportviewier. I am using ReportingServices browser. I have a list of reports stored here..and they are accessed via the browser.

    I have a webpage developed in asp.net.

    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.

  • Not sure I have explained myself here but I am yet to find a solution.

    I have a web page. account.aspx

    The page has the fields such as:

    AccountID

    Account Name

    Account Address etc.

    Account Country

    I have built my report in report builder 3.0 (Microsoft)

    Basicallly the report is like:

    Select AccountName, AccountCountry

    from Accounts

    WHERE AccountID = @AccountID

    My report is set up in such a way...that when it is run it prompts the user to enter the AccoountID so they can retrieve information for that particular account.

    I am trying to make the aspx work so that the user can click Print (as a link to report builder report) and the Account details for that particular Account Appears. Hence the user would not have to type in the AccountID into the parameter prompt.

  • Then use reportviewer control. It's designed to do just that.

    http://www.gotreportviewer.com/

  • I am using SQL reporting services and asp.net

  • ziako (7/7/2011)


    I am using SQL reporting services and asp.net

    And ASP has the reportviewer control. Which you can use to show ssrs reports.

    Did you read anything on the links I sent you?

  • This will still not get around the fact that the user needs to input the ID into the parameter field.

  • ziako (7/7/2011)


    This will still not get around the fact that the user needs to input the ID into the parameter field.

    WHen you use reportviewer control you have to pass in the ACTUAL, FILLED dataset. So the parameter has to be passed for that to open.

    The user picks whatever he wants to print by clicking the print button in a list of items that you supply to him. No need to manually type anything.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply