Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
2
Answers
problem crystal report and aspx
vaquas khan
14y
4.6k
1
Reply
i made a crystal report and using two parameter OrderNo,and CustName i want to display parameters on my aspx1 page ,aspx1 page
have two dropdown one for orderno and other for CustName and one button when user select the these two value from dropdown
and click the button then its value pass to aspx2crystal report page for filtering .....please give me an example
please also suggest how to convert the dropdownlist value or datepicker selectedDate for sesson variable..
this below code is suggested by one member of this site but it is not work......
protected
void
Button1_Click(
object
sender,
EventArgs
e)
{
DropDownList1.SelectedValue = Session[
"OrderNo"
].ToString();
}
now in ur page2.aspx add a CrystalReportViewer and in page load add this code
protected
void
Page_Load(
object
sender,
EventArgs
e)
{
ReportDocument
rpt =
new
ReportDocument
();
rpt.Load(Server.MapPath(
"Report.rpt"
));
ParameterFieldDefinitions
crParameterFieldDefinitions;
ParameterFieldDefinition
crParameterFieldDefinition;
ParameterValues
crParameterValues =
new
ParameterValues
();
ParameterDiscreteValue
crParameterDiscreteValue =
new
ParameterDiscreteValue
();
crParameterDiscreteValue.Value = Session[
"OrderNo"
];
crParameterFieldDefinitions = rpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions[
"@OrderNo"
];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
CrystalReportViewer1.Visible =
true
;
CrystalReportViewer1.ReportSource = rpt;
CrystalReportViewer1.DisplayGroupTree =
false
;
}
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
crystal report date formating
how to merge two crystal report