locked
building query by dragging columns and entering conditions RRS feed

  • Question

  • User1264688959 posted

    Hi,

    Some of our business users want to generate reports on their own. Say for example they want to get list of students who are in 5th grade, they would like to query the DB and generate reports by putting in the condition grade = 5. Is it possible to do it in asp.net using SSRS reports.

    Thanks in advance for your help.

    Friday, June 17, 2011 3:02 PM

Answers

  • User1471008070 posted

    Hi jayajangiti,

    We can achieve this requirement in asp.net using SSRS report, you should lay a textbox control on the web page, then pass the value typed in by user to ssrs report using SetParameters method, however you should create a parameter for ssrs report with hide property to receive this value from user.

    For Code-behind, just like below:

    ReportParameter rp0 = new ReportParameter("ParamName", YourCustomControl.Text);

    ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { rp0 });

    ReportViewer1.ServerReport.Refresh();

    For more information about the ServerReport.SetParameters Method, please see: http://msdn.microsoft.com/en-us/library/ms252178(v=VS.100).aspx 

    Thanks,
    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 20, 2011 5:58 AM

All replies

  • User551462331 posted

    isnt parameters to report does same thing?

    suppose u create a report in ssrs which have grade as parameter.... if no value provided for grade... then it will not consider this filter....

    if provided records will be filterd for given grade.... r u looking for something diffrent scenario?

    hope this helps...

    Friday, June 17, 2011 3:18 PM
  • User2105670541 posted

    create a parameterized report for that, or if your situation is a bit different and you want to give the complete facility to the end user then you can use ReportBuilder in such scenario.

    Saturday, June 18, 2011 1:09 AM
  • User1471008070 posted

    Hi jayajangiti,

    We can achieve this requirement in asp.net using SSRS report, you should lay a textbox control on the web page, then pass the value typed in by user to ssrs report using SetParameters method, however you should create a parameter for ssrs report with hide property to receive this value from user.

    For Code-behind, just like below:

    ReportParameter rp0 = new ReportParameter("ParamName", YourCustomControl.Text);

    ReportViewer1.ServerReport.SetParameters(new ReportParameter[] { rp0 });

    ReportViewer1.ServerReport.Refresh();

    For more information about the ServerReport.SetParameters Method, please see: http://msdn.microsoft.com/en-us/library/ms252178(v=VS.100).aspx 

    Thanks,
    Challen Fu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, June 20, 2011 5:58 AM
  • User1264688959 posted

    Thanks Ashutosh, I was looking for something like Report Builder that you suggested. Do you have any good article on Report Builder on Web or in any of the SQL Server books. That would be very helpful. Thank you very much.

    Wednesday, November 2, 2011 5:03 PM
  • User1264688959 posted

    Thanks KedarrKulkarni and You-Fu. I am already running parameterized report. I just gave a simple example of what our Business Users are looking for. But the reports can be complex in future.

    Thursday, November 3, 2011 1:04 PM