SQL Reporting :: Passing Parameters Through Sub Reports?
Aug 24, 2010
I am trying to use a parameter field where there is a subreport in my main report but i keep getting the error "subreport cannot be shown" when running the report.
p.s - I have just set the parameters the same in the subreport as the main report.
I have already generated crystal reports but i've made them static. but now i want to make the user to select the criteria for generating the reports. for eg., in one of them i want to show monthwise data so user should be able to select the month and year and that would be passed as parameter and compared to the existing data. provide me with proper exact code that can be used for giving parameters in such a report using C#.
I am having problems getting my first report to show data when passing 2 DateTime session and 1 string session parameters to my report. When I remove the 2 DateTime parameters returns data, but with DateTime Parameters, no data. The SQL statement returns correctly. It seems my 2 date params get to the report as NULL. [Code]....
Report Parameters:
dtFromSelect = string - internal
dtToSelect = string - internal
qreStorename = string - internal
For report parameters, if I use DateTime instead of String, I get this error
The definition of the report 'Main Report' is invalid.
The property 'DefaultValue' of report parameter 'dtToSelect' doesn't have the expected type
I am having two reports Report1 and Report2. From Report1 i have to call report2 while clicking link.
I have acheived this by using Jump to report and also i have passed some parameters to report2.
Using report viewer i am viewing this report1. In link field right click properties i am getting report2 url. In new browser if paste the report 2 url with paramters values URL report is coming and also it allows to change report parametes in address bar.
Is it possible to excrypt parameters values while calling report2
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:
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?
I am developing a web app containing an embedded Reportviewer control, a dropdownlist and Ajax TabContainer. The ReportViewer refreshes the report for every tab click in the TabContainer or for every SelectedIndexChanged event of the dropdownlist. The report I am generating is a 6-month trending report displaying statistical data for the last 6 months from the month and year selected in the dropdownlist. I have used Report Parameter to pass the selected date value (from dropdownlist) from the code to the Report (.rdlc). Using Expressions in report file I have displayed last 6 months names from the passing date value. The C# code looks like this.
ReportParameter p1 = new ReportParameter("ReportParameter1", [code]....
The problem is I am not able to set parameters more than once using SetParameters. I will need to pass the parameter value for (a)Everytime the dropdownlist item for month is changed (b) Everytime the TabContainer ActiveTab is changed (c) When the page loads for first time displaying the report for first time. Can someone advise how to pass different values for the same report parameter under different scenarios? Can we change the parameter value passed once it has been set using SetParameters?
I have 3 parameters say A,B,C. I want that when I select values in A and B only then C comes alive. I am using cascading parameter in SSRS 2005.
I know that in cascading parameters, one parameters passes a value to other one and it comes alive. But I want that 2 parameters pass the value to a single one.
dont say to use multi select as multi select is used only when we have to multi select from one parameter.
Also one thing how can I use radio buttons in SSRS 2005 and how to hide null checkbox when allowing null values in calender control.
Iam working on a banking web application developed in asp.net 3.5 and MS SQL Server 2008.My problem is to create reports including some pre-formatted reports,summary reports and some detail reports.I want to know what is the best technique to create these reports.I don't want to use third party reporting tools as they have to be configured on the web server and some times they takes lot of time in generating reports due to their complex structure.Since its a web application having large recordsets so i need a consistent solution keeping in mind the performance and complex nature of the reports which might be demanded by the banks.Can anyone help me please in this regard?
I developed an ASP.net 1.1 web application that is written in VS2203 and I am using Reporting Services 2005 to render some reports in PDF Format. My problem was it is working fine in local (XP) and Production environment (Windows 2003 Server).fromo long back the solution was not working for my integration Server which has windows 2003 Server (1.1) and we installed the 2.0,3.5 frameworks. It is throwing an Object refernce error while render the report. Is there any permisions or something missing.
In this answer to my question of how to insert data into SQL Server he mentioned passing parameters instead of string concatenation like I currently have.
Is this really necessary for security? If so, what exactly is passing parameters? When i google it I get a lot about stored procedures. Is that what I want, I do not know about stored procedures....yet.
EDIT:
Ok, here is what I got. It seems to update the database correctly and eventually I will change the hard coded ints to inputs from a label. confirm if how I did this is not vulnerable to any sql injection or hacks.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.Security; using System.Data; using System.Data.Sql; using System.Data.SqlClient; public partial class Stats : System.Web.UI.Page { public SqlDataReader DataReader; public SqlCommand Command; string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES (@UID, @CL, @LL, @HL);"); //string queryString = ("INSERT INTO UserData (UserProfileID, ConfidenceLevel, LoveLevel, HappinessLevel) VALUES ('a051fc1b-4f51-485b-a07d-0f378528974e', 2, 2, 2);"); protected void Page_Load(object sender, EventArgs e) { LabelUserID.Text = Membership.GetUser().ProviderUserKey.ToString(); } protected void Button1_Click(object sender, EventArgs e) { //connect to database MySqlConnection database = new MySqlConnection(); database.CreateConn(); //create command object Command = new SqlCommand(queryString, database.Connection); //add parameters. used to prevent sql injection Command.Parameters.Add("@UID", SqlDbType.UniqueIdentifier); Command.Parameters["@UID"].Value = Membership.GetUser().ProviderUserKey; Command.Parameters.Add("@CL", SqlDbType.Int); Command.Parameters["@CL"].Value = 9; Command.Parameters.Add("@LL", SqlDbType.Int); Command.Parameters["@LL"].Value = 9; Command.Parameters.Add("@HL", SqlDbType.Int); Command.Parameters["@HL"].Value = 9; Command.ExecuteNonQuery(); } }
when i worked in .NET 1.1 i used to pass parameters to user control using the method- (if the name of the usercontrol is "tables")
dim r As tables = CType(Page.LoadControl("~/usercontrol/tables.ascx"), tables)
and calling public property of the usercontrols.
the problem is that i can't the way to do it in 2008 ver of .NET, it is not recognize the usercontrol.... how can i pass parameters to the usercontrol in run time?
i have a dropdownlist with seven different optins like (date, subject, press, cia, media...) and user will select one of the item from the dropdownlist and click on search button to get the results.here is my repository class GetInquires method which accepts 7 parameters but it will pass only one prameters at a time to the storeproc and in case of Date (it will pass both from/to)
I have a page with a lot of pictures on it. I want the user to be able to click on the picture and either bring up a popup type of window passing it the Param name and value , or to have the picture be replaced with this object.
I have a custom ExpressionBuilder in whixh I'm trying to add a list of optional parameters. My method would be declared as follows: public static string GetResource(string expression, params object[] parameters) { }
The way I'm calling this method from an ASP.NET page is this at the moment: <ext:Button ID="btnEdit" runat="server" Text="<%$ AppResources : edit_text %>"> Does anyone know how to perform this method call, but using optional parameters?
[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public string MyWebMethod(string foo, string bar) { // DataContractJsonSerializer to deserialize foo and bar to // their respective FooClass and BarClass objects. return "{"Message":"Everything is a-ok!"}"; } I'll call it from the client via: var myParams = { "foo":{"name":"Bob Smith", "age":50},"bar":{"color":"blue","size":"large","quantity":2} }; $.ajax({ type: 'POST', url: 'https://mydomain.com/WebServices/TestSvc.asmx/MyWebMethod', data: JSON.stringify(myParams), contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (response, status) { alert('Yay!'); }, error: function (xhr, err) { alert('Boo-urns!'); } }); However, this yields the following error (a breakpoint on the first line in MyWebMethod() is never hit): {"Message":"No parameterless constructor defined for type of u0027System.Stringu0027.","StackTrace":" at System.Web.Script.Serialization.ObjectConverter.ConvertDictionaryToObject(IDictionary2 dictionary, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject) at System.Web.Script.Services.WebServiceMethodData.StrongTypeParameters(IDictionary2 rawParams) at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.MissingMethodException"}
I'd like to pass in two string parameters and use DataContractJsonSerializer to write new Foo and Bar objects. Am I missing something?
I am creating a DataSet to attach to a report (*.rdlc). In the DataSet is a TableAdapter that has the GetData(@start, @end) function. Can someone please explain how I get values in to @start and @end? I have searched and seen that it might have something to do with overriding the Fill function in the DataSet code behind file. Please let me know.
I want to develop a windows service which will be accepting a datatable from an aspx page. Both the windows service and the website are hosted on same machine.
Also I need to set a date and time on which this service is to work. this date and time are to change according to customer needs. once again the date and time are to be fed from the aspx page.
I have a dynamic created drop down list - and I set the event of it to be like this:
ddlAnswer.ID = "ddlistAnswer" + QuestionID; ddlAnswer.SelectedIndexChanged += new EventHandler(ddlAnswer_SelectedIndexChanged);
Please note that drop down list is dynamic, and in selectedIndexChanged, I would like to pass the "QuestionID" to that selectedindexchanged to work on my logic. Is there a way to pass it to that method as command argument or something?
Code: protected void ddlAnswer_SelectedIndexChanged(object sender, EventArgs e) { //wanting that question id here }
passing parameters from a datalist to another page.
this is how my app works:
i have a database ( access) a table with the following columns: id,title,desc,photo.
another table with the following columns: (startsin, endsin,price,tId)
on the first page (tourpack.aspx) i have a datalist, when user clicks on a button that is in the templateitem of the datalist, he will be transfered to another page called (showtour.aspx). what im trying to do is passing the ID parameter from the first page (table 1) to the second page (showtour.aspx) with the id number so he can see the specific details of that "tour" that are located In the second table.