Page 1 of 2

Pass data set to report not working

Posted: Fri Jan 24, 2014 1:48 pm
by d3graph
Hi dear fellows

i am trying to load a report in an web application
i have setup 2 Data Sources in report designer Emp, EA
and pass new data set to report at run time report loaded but the
data is not refreshing

please look at the following code

Code: Select all

           
string sql = "Select ID As F_EmployeeMaster,EmpName,FatherName,Department,Designation,ShiftInTime,F_CompanyMaster,ShiftOutTime From vEmployeeDetails Where F_CompanyMaster = " + Options.F_CompanyMaster + " AND ID = " + GetSqlParameterValueByName("@F_EmployeeMaster", param);
            DataSet Emp = SqlClientUtility.ExecuteDataSet("eVartikaConnectionString", CommandType.Text, sql, null);


            SqlParameter[] rparams = new SqlParameter[]
            {
                new SqlParameter("@F_CompanyMaster", Options.F_CompanyMaster),
                new SqlParameter("@F_EmployeeMaster", GetSqlParameterValueByName("@F_EmployeeMaster",param )),
                new SqlParameter("@F_DepartmentMaster", GetSqlParameterValueByName("@F_DepartmentMaster",param)),
                new SqlParameter("@FromDate", GetSqlParameterValueByName("@FromDate",param)),
                new SqlParameter("@ToDate", GetSqlParameterValueByName("@ToDate",param)),
                new SqlParameter("@UserId", Options.UserId)
            };

            DataSet EA = SqlClientUtility.ExecuteDataSet("eVartikaConnectionString", CommandType.StoredProcedure, "EmployeeWiseAttendanceReport", rparams);
            string appDirectory = HttpContext.Current.Server.MapPath(string.Empty);
            // Load report
            StiReport report = new StiReport();
            report.Load(appDirectory + "\\Attendance\\EmployeeWiseAttendance.mrt");

            report.RegData(Emp);

            report.RegData(EA);

            report.Compile();

            // View report
            
            StiWebViewer1.Report = report;
      
can you please guide me what i am doing wrong

thanks

Re: Pass data set to report not working

Posted: Fri Jan 24, 2014 1:53 pm
by Alex K.
Hello,

Can you please send us a sample project with test data which reproduce the issue for analysis.

Thank you.

Re: Pass data set to report not working

Posted: Sat Jan 25, 2014 5:57 am
by d3graph
Dear Aleksey

thanks for your reply.
I can upload the report file. as you can see that i have created 2 data sources in report file
and register them with exact names at run-time already populated data-sets

Regards

Re: Pass data set to report not working

Posted: Mon Jan 27, 2014 11:59 am
by d3graph
Dear Aleksey ,

Please Reply

Re: Pass data set to report not working

Posted: Mon Jan 27, 2014 12:34 pm
by Alex K.
Hello,

It is difficult to say something without test data for your report.
Can you please send us a simple project with test data.

Thank you.

Re: Pass data set to report not working

Posted: Mon Jan 27, 2014 1:40 pm
by d3graph
ok let me prepare a test project

Re: Pass data set to report not working

Posted: Tue Jan 28, 2014 5:16 am
by Andrew
Hello,

Ok! Waiting for the project.

Re: Pass data set to report not working

Posted: Tue Jan 28, 2014 6:59 am
by d3graph
here i have attached the project and bak file

Re: Pass data set to report not working

Posted: Tue Jan 28, 2014 7:46 am
by Alex K.
Hello,

Thank you for the sent files.
Can you please check the .bak file. We couldn't restore database from your file.
Thank you.

Re: Pass data set to report not working

Posted: Tue Jan 28, 2014 7:55 am
by d3graph
it is backup of sql server 2008 r2 10.50
let me attach the sql export