Click here to Skip to main content
15,904,503 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionSqlDatasource Question... Pin
Kariem Soudy27-Mar-07 11:50
Kariem Soudy27-Mar-07 11:50 
Questionregarding reportviewer.....very urgent Pin
srishree27-Mar-07 10:31
srishree27-Mar-07 10:31 
Hi all,i am having a problem populating data using reportviewer.i want to populate the data at runtime dynamically.on my button click event i want to populate the data corresponding to the dropdownlist value.for some reason my button click event gives me an error at ReportViewer1.LocalReport.setparameters(... ).it says "An attempt was made to set a report parameter 'parameter1' that is not defined in this report."below is my code for the button click......i m running a stored proc to populate the reportviewer....i am working on the visual webdeveloper 2005.and sql server 2000.any help would be greatly appreciated...

protected void Button1_Click(object sender, EventArgs e)
{

DataSet ds = new DataSet();
string connstrA = ConfigurationManager.AppSettings["SQLConnectionString"];
SqlConnection myconnectionA = new SqlConnection(connstrA);
SqlCommand mycommandA = new SqlCommand("dbo.up_campus_test", myconnectionA);
mycommandA.CommandType = CommandType.StoredProcedure;
mycommandA.Parameters.Add("@campus", SqlDbType.VarChar, 2).Value = DropDownList1.SelectedItem.Value.ToString();
SqlDataAdapter da = new SqlDataAdapter(mycommandA);
da.Fill(ds);
ReportViewer1.Visible = true;
ReportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport report = ReportViewer1.LocalReport;
ReportViewer1.LocalReport.ReportPath = @"C:\Documents and Settings\gradasst\My Documents\My Web Sites\recent\Report\Report.rdlc";
ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2_up_campus_test", ds.Tables[0]));
ReportViewer1.LocalReport.DataSources.Clear();
ReportParameter param = new ReportParameter();
param.Name = "parameter1";
param.Values.Add(DropDownList1.SelectedValue.ToString());
ReportParameter[] myReportParams = new ReportParameter[] { param };
ReportViewer1.LocalReport.SetParameters(myReportParams);
ReportViewer1.LocalReport.Refresh();
}
}


Thanks in advance...

hi

QuestionOpen a PDF file Pin
rudemusik27-Mar-07 10:23
rudemusik27-Mar-07 10:23 
AnswerRe: Open a PDF file Pin
SABhatti27-Mar-07 10:31
SABhatti27-Mar-07 10:31 
GeneralRe: Open a PDF file Pin
rudemusik27-Mar-07 11:23
rudemusik27-Mar-07 11:23 
GeneralRe: Open a PDF file Pin
A.R.Bhagirathi27-Mar-07 20:20
A.R.Bhagirathi27-Mar-07 20:20 
GeneralRe: Open a PDF file Pin
Jay_se27-Mar-07 21:25
Jay_se27-Mar-07 21:25 
GeneralRe: Open a PDF file Pin
rudemusik28-Mar-07 3:27
rudemusik28-Mar-07 3:27 
QuestionImageButton in GridView TemplateField disappears when clicked [modified] Pin
cueshot27-Mar-07 9:54
cueshot27-Mar-07 9:54 
AnswerRe: ImageButton in GridView TemplateField disappears when clicked Pin
kubben27-Mar-07 10:16
kubben27-Mar-07 10:16 
GeneralRe: ImageButton in GridView TemplateField disappears when clicked Pin
cueshot27-Mar-07 10:19
cueshot27-Mar-07 10:19 
QuestionEditing gridview edititemtemplate with dropdownlist Pin
yonialhadeff27-Mar-07 9:30
yonialhadeff27-Mar-07 9:30 
QuestionNo Namespace in .NET 2.0 Pin
duaatul27-Mar-07 9:02
duaatul27-Mar-07 9:02 
AnswerRe: No Namespace in .NET 2.0 Pin
kubben27-Mar-07 9:44
kubben27-Mar-07 9:44 
AnswerRe: No Namespace in .NET 2.0 Pin
badgrs27-Mar-07 10:57
badgrs27-Mar-07 10:57 
QuestionText Editor Pin
netJP12L27-Mar-07 6:31
netJP12L27-Mar-07 6:31 
AnswerRe: Text Editor Pin
Not Active27-Mar-07 6:35
mentorNot Active27-Mar-07 6:35 
AnswerRe: Text Editor Pin
Sathesh Sakthivel27-Mar-07 6:39
Sathesh Sakthivel27-Mar-07 6:39 
AnswerRe: Text Editor Pin
ToddHileHoffer27-Mar-07 8:36
ToddHileHoffer27-Mar-07 8:36 
GeneralRe: Text Editor Pin
badgrs27-Mar-07 11:07
badgrs27-Mar-07 11:07 
GeneralRe: Text Editor Pin
netJP12L27-Mar-07 16:53
netJP12L27-Mar-07 16:53 
QuestionAjax toolkit Pin
Member 374156227-Mar-07 4:39
Member 374156227-Mar-07 4:39 
AnswerRe: Ajax toolkit Pin
Not Active27-Mar-07 5:03
mentorNot Active27-Mar-07 5:03 
GeneralRe: Ajax toolkit Pin
RichardGrimmer27-Mar-07 5:26
RichardGrimmer27-Mar-07 5:26 
AnswerRe: Ajax toolkit Pin
Kunal P27-Mar-07 6:57
Kunal P27-Mar-07 6:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.