TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ravindra Walde
NA
206
3.3k
Pass value of text box to crystal report using parameter
May 19 2015 8:53 AM
Hello Everyone,
I am Try to pass text box values to crystal report in asp.net.
but it will not fount parameter in my code. it will show popup parameter dialog box window to get value for crystal report.
Below is my Source code for parameter Passing :
ReportDocument reportDocument = new ReportDocument();
ParameterFields paramFields = new ParameterFields();
ParameterField paramField = new ParameterField();
ParameterDiscreteValue paramDiscreteValue = new ParameterDiscreteValue();
paramField.Name = "@Name";
paramDiscreteValue.Value = TextBox1.Text.ToString();
paramField.CurrentValues.Add(paramDiscreteValue);
paramFields.Add(paramField);
CrystalReportViewer1.ParameterFieldInfo = paramFields;
reportDocument.Load(Server.MapPath("CrystalReport1.rpt"));
if (conn.State == ConnectionState.Open)
{
conn.Close();
}
conn.Open();
string sql = "select * from CustomerDetails";
OdbcCommand cmd = new OdbcCommand(sql, conn);
OdbcDataAdapter dscmd = new OdbcDataAdapter(cmd);
DataTable datatable = new DataTable();
dscmd.Fill(datatable);
conn.Close();
reportDocument.SetDataSource(datatable);
CrystalReportViewer1.ReportSource = reportDocument;
If anybody Knows please help me..
Thanks In Advance.
Reply
Answers (
4
)
Compatibility issue
The webpage is unavailable because of working on offline.