.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Include User's Parameters in Report Header?

Posted By:      Posted Date: October 07, 2010    Points: 0   Category :Sql Server

Hi, I'm getting stuck on what is probably a very simple/common task: Adding a textbox that displays the parameters that a user has selected for the current report.


For example, if the user chooses a @startdate and @enddate using date-pickers, a textbox in the header will display/print those parameters:


="Report by Department from " + @startdate+ " to " + @enddate


Seems simple, but I keep getting errors:


"Return statement in a Function, Get or Operator must return a value".


Can anyone help out with the proper syntax for repeating a user's parameters in the header or body of a report?



View Complete Post

More Related Resource Links

Stop Sorting Cross Tab Report Header


Dear, I want to stop sorting in cross tab report header. And also want to sort in specific order. How can i do that? Please help me. Its urgent


Showing filtered Records in Crystal Report as per User Requirement


ReportDocument reportDocument = new ReportDocument();
    ParameterField paramField = new ParameterField();
    ParameterFields paramFields = new ParameterFields();
    ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
    protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            paramField.Name = "@Ext";
            //*Remember to reconstruct the paramDiscreteValue and paramField objects
            paramDiscreteValue.Value = 44854
            CrystalReportViewer1.ParameterFieldInfo = paramFields;

Passing report parameters by report viewer


I have 4 parameters in which 3 are passed in report and 1 is passed through report viewer. I have made a parameter in SSRS called CandidateId to which I want to pass the value. The code for report viewer is:

 intReportID = Convert.ToInt32(Request.QueryString["ReportID"
 CandId = Convert.ToString(Session["CandidateId"
lblReportName.Text = dtReport.Rows[0]["ReportName"
SSRSReportViewer.ShowCredentialPrompts =false

 SSRSReportViewer.ServerReport.ReportServerCredentials = new
SSRSReportViewer.ProcessingMode = Microsoft.Reporting.WebForms.


 SSRSReportViewer.ServerReport.ReportServerUrl = new

SSRSReportViewer.ServerReport.ReportPath = dtReport.Rows[0]


 Microsoft.Reporting.WebForms.ReportParameter[] theparams = new

theparams[0] = new
, CandId);
theparams[0].Visible = false

Include a Crystal Report in .NET Web Service for Dynamic In-Memory-Only DataSet



I would like to use Crystal Reports in a .NET web service.  Ultimately I would like to convert my report document to a PDF and then return the PDF as a byte array. 

My .NET DataSet is generated dynamically at run-time.  It consists of four related tables.  Since my DataSet does not have a physical datasource, I created an XML Schema file.  I then added the XML Schema file to the web service project with Add Existing Item. 

A solution for working with a dynamic in-memory DataSet exists for ASP.NET web sites and client-based forms.  I tried to use this method as it is published.  When that didn't work I tried creating the report and XML Schema directly in the web service project, but that also didn't work.


The problem is apparent when you try to set the datasource.......the code bombs on the call to SetDataSource(DataSet) with the message
ex = {"The data source object is invalid."}

Crystal Reports would save me a lot

Site Collection Usage Report Include Outlook?


Hi all,

Does anyone know if the Site Collection Usage Report includes activity that occurs from Outlook? For example, if a user contributes to a discussion board without ever physically touching the site or if the user just reads list content from Outlook, is this included?

ANY help at all is greatly appreciated.


stsadm Import command + include user security



When I move sites from test to staging to production, I am using the stsadm –o export command with the –includeusersecurity option in the staging environment.  In production environment, I then use the stsadm –o import command with the –includeusersecurity option.  I was assuming that this option was bringing over the security on the exported site only.  This does not seem to be the case.

Last night I exported one sub site to produtction.  Today, I was notified that the security groups on other sub sites have been altered.  


So why is it when using the –includeusersecurity option effect all sub sites and not just the one sub site being moved from staging to production

Preview Crystal Report from ASP.net without passing parameters


Hi Everyone,

Sorry couldn't think of any better Subject..

I am developing a User Reports Module using C#.Net using Visual Studio 2005. Basic purpose of this module is to allow user to be able to run their own Crystal Reports. i.e. if Users have their own Crystal Reports specific to their needs then we allow them to save them and view them from our user reports module.

So when user saves any report we save it on server and save the Physical path of that report in database. Now when user tries to view the report I get the location from database and load it. Which works ok. The issue now is those reports which have got parameters. 

I am not saving any information about parameters in their reports. So I do not have any information about Report Parameters.

This same application exists in VB6. What that VB application does is opens the Crystal Report and then Crystal report asks for needed parameters exactly as it will do if we try to open a crystal report using crystal report and preview it from there it asks for parameter values. 

How can I do that in C#.Net.

VB has got code like this

Global Appl As New CRAXDRT.Application

Report parameters *, =<>constant

Hi I have filtered a report dataset depending on whether a field contains the string "Hong Kong". However I would like to present the user with the option to select the label 'All' not to bring back all records, or the label 'Excluding Hong Kong' to bring back all records where the value in the field is not equal to "Hong Kong", anyone know how to do this?

how to include a user defined table type as input for stored procedure

Hi ,  I have a user defined table type which i need to pass as input parameter to the stored procedure .How can i do that?

displaying parameters through expressions at the top of the report

Hi,   We developed around 70 ssrs reports for our new application.Its like,all the report names are menrioned in the left hand side and if we click it,.Net calls the SSRS reports and shows in the Right hand side.    At the top of Each and every report,we dispaly all the parameters using expressions. Now, the issue is, in the parameter if they select a single value, then it should display and if they select more than one, it should display like 'More Parameters are selected'. can you helpme how to do that?

How to scroll the DataGrid (horizontally) when user drags a column header far left or right?

We're working with the WPF DataGrid and I have a question about  dragging column headers: The grid lets the user rearrange the columns, by dragging the column header left or right.  So far, so good. But, sometimes we have many columns, and only the first few columns are visible; so there is a horizontal scrollbar.  In such case, if the user drags a column header to the right edge of the DataGrid window, I want the DataGrid to scroll, automatically, one column at a time.  Is there an easy way to do that? (To be clear: yes, the user can already scroll horizontally by interacting with the horizontal scrollbar, but that isn't what I'm asking about.  I'm asking if the "drag a column header left or right" gesture can cause the DataGrid to scroll left or right.) I guess I could handle various low-level events, but it seems like it shouldn't be necessary -- DataGrid has so much functionality built-in, that I'm guessing it already has the ability to scroll when the user drags the column header to the edge.  So, is there either (a) a property that I can set, to tell the DataGrid to scroll when the user drags a column header to the edge of the window;  or (b) a code example showing how to achieve this effect myself?  Thanks!

How to export SSRS report to PDF from SSIS with parameters

Hello everyone.  I am trying to setup a process in which a user, who is using a vb.net 2008 application, will need to  trigger the creation of two items.  The first is  SSRS report which will need to be exported to PDF format to a shared folder on the network.  This report accepts one parameter.  The second thing that will need to be created at the same time is an excel file with data exported from SQL Server 2008 which is generated through an SSIS package.  A couple things to note.  The excel file and the pdf file need to have the same file name, other than the extension.  For example P00000001_20100831.pdf and P00000001_20100831.xlsx and will both be stored in the same network share.  The filenames need to be created dynamically at run time and will be based on a parameter being passed to the report. So far I have the portion that creates the excel file working fine.  The way I create that is as follows.  I have a stored procedure that creates a job which calls the SSIS package and passes the appropriate parameters to the SSIS package.  After the job is created I immediately run it and then delete the job.  Ok, everything works fine with that. Now I cant seem to figure out how to get the pdf created.  If possible I would like to keep this portion together with the already created job or package.&nb

Passing parameters from ASP.Net web page to SSRS report

I have a web page that displays some data.  The user first selects a date range on the web page and then can edit some data.  When they click a submit button, I want to run a report.  But I would like to pass the start date and end date values that the user already entered on the web page to the report.  Is this possible?  Can I use the value of a session variable in the report? Bob

Problems passing parameters to SSRS report from ASP.Net web page

I have a web page that displays some data.   When they click a submit button, I want to run a report.  But I would like to pass the start year/month and end year/month values that the user already entered on the web page to the report.  Here is what my url looks like when the report is displayed: http://xyzserver/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fDevicesAllNew&rs:Command=Render&StartYYMM=201007&EndYYMM=201008 But my report displays the 2 textboxes for my StartYYMM and EndYYMM parameters as empty.  What am I doing wrong?  I did a google search and I saw something about using ReportServer instead of ReportManager.  I notice at the top of the browser when I run my report, it reads "Report Manager - Windows Internet Explorer".  Is this correct? Bob     Bob

Reporting services + report parameters and custom dropdown length

Hi, I have some report and plenty of parameters inside that report. One of parameter contains values stored inside dropdown list (that are downloaded from db). Is there any way I can set the maximum length of that dropdown control? The problem is that when I expand drop down list I have a horizonal scrollbar because some values inside that dropdown list are too long. How can I customize this parameter and dropdown control so there will be no horizontal scrollbar and values inside it will always be visible?

Report parameters bomb out using wildcards with multi value parameters

SQL Server 2008 Latest release I have a report that I have setup (using BIS Visual Studio 2008) for user required parameters (multi valued possible). I have tried adding the like value in the report parameter values in Visual Studio and it just does not like it, example -  LIKE ('A%'). If I enter a valid value without wildcards it works fine Example employee id # A001234. Anyone have any ideas as to a solution?   SELECT        DATAAREAID, TRANSDATE, JOURNALID, PRODID, EMPLID, HOURS, HOURPRICE FROM            Production_Direct_Labor_Hours WHERE        (DATAAREAID = @DATAAREAID) AND (HOURS > 0) AND (PRODID = @PRODID) AND (EMPLID IN (@EMPLID)) AND (TRANSDATE BETWEEN @STARTDATE AND                          @ENDDATE)

User Control Passing Parameters to SQL

I have a usercontrol that populates search pages based on a selected menu choice. Each page returned by the menu choice selected calls the usercontrol.Each page has a two part page Title. Example: Title="Ketchikan Charters" Each name in the title is actually a SQL select value. Ketchikan = "City" Charters = "Classification" Example:<SelectParameters> <asp:ControlParameter ControlID="CharterGridView" DefaultValue="Ketchikan" Name="City" PropertyName="SelectedValue" Type="String" /> <asp:ControlParameter ControlID="CharterGridView" DefaultValue="Charters" Name="Classification" PropertyName="SelectedValue" Type="String" /> </SelectParameters> Here I remove the Default values for City, and Classification <SelectParameters><asp:ControlParameter ControlID="CharterGridView" DefaultValue="" Name="City" PropertyName="SelectedValue" Type="String" /><asp:ControlParameter ControlID="CharterGridView" DefaultValue="" Name="Classification" PropertyName="SelectedValue" Type="String" /></SelectParameters> The reason for removing them is that I want to import those values at run time from the page title. Re
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend