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
elham deljooei
NA
84
73.2k
report viewer and stored procedure
Feb 6 2013 2:38 AM
Hi friends.
I want to show my report in report viewer but it dosen't show for me.
This my code:
private void buttonX1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection("Data Source=FADAEILAPTOP-PC;Initial Catalog=ClerksEvaluation;Integrated Security=True");
DataSet a = new DataSet();
DataTable dtbl = new DataTable("DataTable1");
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = new SqlCommand();
adp.SelectCommand.Connection = con;
adp.SelectCommand.CommandText = "Report";
adp.SelectCommand.CommandType = CommandType.StoredProcedure;
adp.SelectCommand.Parameters.AddWithValue("@clrk_Name", name.Text);
adp.SelectCommand.Parameters.AddWithValue("@clrk_Family", family.Text);
adp.SelectCommand.Parameters.AddWithValue("@clrk_MelliCode", melli.Text);
SqlDateTime az_d = SqlDateTime.Parse(az.Text);
adp.SelectCommand.Parameters.AddWithValue("@AzTarikh", az_d);
SqlDateTime ela_d = SqlDateTime.Parse(ela.Text);
adp.SelectCommand.Parameters.AddWithValue("@Ela", ela_d);
adp.Fill(a, "DataTable1");
Form1 f1 = new Form1();
ReportDataSource source = new ReportDataSource("datatable1", dtbl);
f1.reportViewer1.Visible = true;
f1.reportViewer1.ProcessingMode = ProcessingMode.Local;
f1.reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
f1.reportViewer1.LocalReport.DataSources.Clear();
f1.reportViewer1.LocalReport.DataSources.Add(source);
f1.reportViewer1.LocalReport.Refresh();
f1.Show();
}
this doesn't have any error.
this is my procedure and it doesn't have error.
USE [ClerksEvaluation]
GO
/****** Object: StoredProcedure [dbo].[Report] Script Date: 02/06/2013 09:17:01 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[Report]
@clrk_Name
Nvarchar(50),
@clrk_Family
Nvarchar(60),
@clrk_MelliCode
Char(10),
@AzTarikh
Date,
@Ela
Date
AS
Declare @id int
select @id = clrk_Id from Clerk
where clrk_Name = @clrk_Name and clrk_Family = @clrk_Family and clrk_MelliCode = @clrk_MelliCode
select clrk_Name,clrk_Family,clrk_MelliCode,clrk_FatherName, epcnt_Name, clrke_Percent, clrke_Tozihat, clrke_Date, clrke_Hafteh
from ClerkEvaluation
inner join Clerk on Clerk.clrk_Id = @id
inner join EvaluationPercent on ClerkEvaluation.epcnt_Id = EvaluationPercent.epcnt_Id
where clrke_Date Between @AzTarikh and @Ela
my ReportViewer binded to procedure.
Could you help me?
Reply
Answers (
7
)
how to convert ddl file into source code
i have one url of japan when i my craweling the site then give problem of encode the reponse url is http://www.alamo.jp