Hello ppl, Please i have been dying to get this to work but no help what so ever, i tried so many ways and so many searches but i always reached a dead end..
I have a ReportWizard that i created, an .rdlc file, and i have a report Viewer tool in my .aspx page that i linked it to my .rdlc report, and i have a DataSet1.xsd Data Set also created, in my data set, i have put this SQL statement:
SELECT Case_Number, Staff_FName, Staff_LName, Branch_Dept, Case_Category, Case_Date, Closed_Date, Problem, Initial_Solution, Customer_Name, Acc_Num
FROM SQ_IMS
WHERE (Case_Date >= '@date1') AND (Case_Date <=
'@date2')
Now if i want my user to chose 2 values from 2 textboxes in my aspx page, and then send it to the report to be generated, i guessed that i have to use parameters, and that is how i used it in my WHERE statement, the @date1 and @date2, but the problem now,
is that i am stuck on what to write in my button click, please if someone can give me the code, or show me a hint of that code, in VB.NET please, i would really really apreciate it, i really really need it urgently, and thanx alot in advance.
Yes its a local report in my project, no servers attached, the report .rdlc file is included in my solution it self, now in my button click, i want to know how to access the report, plus how to pass the parameters of my 2 textboxes to send 2 dates and get
the report between these 2 dates, and thank you.
An attempt was made to set a report parameter 'date1' that is not defined in this report.
here is how ur code looks like after i edited it to my values:
Dim
myReport AsNewLocalReport
()
myReport.ReportPath = Server.MapPath(
"~/ComplianceReport.rdlc"
)
Dim
myParam AsNewReportParameter("date1"
, TextBox1.Text)
myReport.SetParameters(
NewReportParameter
() {myParam})
but my friend, i dont need a path for the report, the path is already set in the ReportViewer Wizard, i need to access this report viewer from here by accessing ReportViewer1,
it already has the data set and the report path
MishMish
Member
100 Points
81 Posts
Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 07:59 PM|LINK
Hello ppl, Please i have been dying to get this to work but no help what so ever, i tried so many ways and so many searches but i always reached a dead end..
I have a ReportWizard that i created, an .rdlc file, and i have a report Viewer tool in my .aspx page that i linked it to my .rdlc report, and i have a DataSet1.xsd Data Set also created, in my data set, i have put this SQL statement:
SELECT Case_Number, Staff_FName, Staff_LName, Branch_Dept, Case_Category, Case_Date, Closed_Date, Problem, Initial_Solution, Customer_Name, Acc_Num
FROM SQ_IMS
WHERE (Case_Date >= '@date1') AND (Case_Date <= '@date2')
Now if i want my user to chose 2 values from 2 textboxes in my aspx page, and then send it to the report to be generated, i guessed that i have to use parameters, and that is how i used it in my WHERE statement, the @date1 and @date2, but the problem now, is that i am stuck on what to write in my button click, please if someone can give me the code, or show me a hint of that code, in VB.NET please, i would really really apreciate it, i really really need it urgently, and thanx alot in advance.
nicksoft
Participant
802 Points
216 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:06 PM|LINK
LocalReport myReport = new LocalReport();
myReport.ReportPath = Server.MapPath("~/Path/To/Report.rdlc");
ReportParameter myParam = new ReportParameter("ParamName", "ParamValue");
myReport.SetParameters(new ReportParameter[] { myParam });
// more code here to render report
nicksoft
Participant
802 Points
216 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:08 PM|LINK
also did you verified below article???????
http://www.csharpcourses.com/2008/06/how-to-pass-parameters-to-reporting.html
ReportViewer1.ShowCredentialPrompts = False ReportViewer1.ServerReport.ReportServerCredentials = New ReportCredentials("emady", "MyPassword", "hhi") ReportViewer1.ServerReport.ReportServerUrl = New Uri("http://falcon/Reportserver") ReportViewer1.ServerReport.ReportPath = "/Report Project State/Report1" Dim parameters As New List(Of ReportParameter)() parameters.Add(New ReportParameter("state", DropDownListStates.SelectedItem.Text)) ReportViewer1.ServerReport.SetParameters(parameters) ReportViewer1.ProcessingMode = ProcessingMode.Remote ReportViewer1.ShowParameterPrompts = False ReportViewer1.ShowPromptAreaButton = False ReportViewer1.ServerReport.Refresh()MishMish
Member
100 Points
81 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:12 PM|LINK
But this is for server reports, isnt?
MishMish
Member
100 Points
81 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:13 PM|LINK
Mine is local
nicksoft
Participant
802 Points
216 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:22 PM|LINK
when you say local....is that report server project completely separate SSRS project?
If that is the case, do you wants to know how the report parameter needs to create so user can select certain values...
Please explain...looks like i am getting har time understanding the system........
MishMish
Member
100 Points
81 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:26 PM|LINK
Yes its a local report in my project, no servers attached, the report .rdlc file is included in my solution it self, now in my button click, i want to know how to access the report, plus how to pass the parameters of my 2 textboxes to send 2 dates and get the report between these 2 dates, and thank you.
nicksoft
Participant
802 Points
216 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:30 PM|LINK
did you tried below codes........
<div>LocalReport myReport = new LocalReport();
</div>myReport.ReportPath = Server.MapPath("~/Path/To/Report.rdlc");
ReportParameter myParam = new ReportParameter("ParamName", "ParamValue");
myReport.SetParameters(new ReportParameter[] { myParam });
// more code here to render report
MishMish
Member
100 Points
81 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 08, 2011 08:39 PM|LINK
ok i tried ur code and got this error:
An attempt was made to set a report parameter 'date1' that is not defined in this report.
here is how ur code looks like after i edited it to my values:
Dim myReport As New LocalReport
()
myReport.ReportPath = Server.MapPath(
"~/ComplianceReport.rdlc"
)
Dim myParam As New ReportParameter("date1"
, TextBox1.Text)
myReport.SetParameters(
New ReportParameter
() {myParam})
but my friend, i dont need a path for the report, the path is already set in the ReportViewer Wizard, i need to access this report viewer from here by accessing ReportViewer1, it already has the data set and the report path
MishMish
Member
100 Points
81 Posts
Re: Plz Plz Plz ppl i need help in my ReportViewer
Dec 09, 2011 10:46 AM|LINK
No one has an aswer? no one can help me?~! ;(