В подотчете не отображаются данные и отображается пустая страница c # .net - PullRequest
0 голосов
/ 21 декабря 2018

введите описание изображения здесь У меня есть приложение Windows Form, в котором я использую отчеты Crystal. В основном отчете Crystal я хочу отобразить вложенный отчет, но когда я пытаюсь сделать это, он отображает данные основного отчета.отчет, но другие данные подотчета не отображаются. Я попытался следующий код, но не работает.Пожалуйста, помогите мне с деталями: проблема с кодом или ссылка на подотчет?

   {
                SqlCommand command1 = new SqlCommand("packinglistreport", con);
                command1.CommandType = CommandType.StoredProcedure;
                command1.Parameters.Add("@id1", SqlDbType.Int).Value = 4;
                command1.Parameters.Add("@contno", SqlDbType.NVarChar).Value = textBox1.Text;
                command1.Parameters.Add("@season_no", SqlDbType.NVarChar).Value = textBox2.Text;

                SqlDataAdapter da121 = new SqlDataAdapter(command1);
                SqlCommand command = new SqlCommand("packinglistreport", con);
                command.CommandType = CommandType.StoredProcedure;
                command.Parameters.Add("@id1", SqlDbType.Int).Value = 5;
                command.Parameters.Add("@contno", SqlDbType.NVarChar).Value = textBox1.Text;
                command.Parameters.Add("@season_no", SqlDbType.NVarChar).Value = textBox2.Text;
                SqlDataAdapter da12 = new SqlDataAdapter(command);
                SqlCommand command2 = new SqlCommand("packinglistreport", con);
                command2.CommandType = CommandType.StoredProcedure;
                command2.Parameters.Add("@id1", SqlDbType.Int).Value = 6;
                command2.Parameters.Add("@contno", SqlDbType.NVarChar).Value = textBox1.Text;
                command2.Parameters.Add("@season_no", SqlDbType.NVarChar).Value = textBox2.Text;
                SqlDataAdapter da122 = new SqlDataAdapter(command2);
                SqlCommand command3 = new SqlCommand("packinglistreport", con);
                command3.CommandType = CommandType.StoredProcedure;
                command3.Parameters.Add("@id1", SqlDbType.Int).Value = 7;
                command3.Parameters.Add("@contno", SqlDbType.NVarChar).Value = textBox1.Text;
                command3.Parameters.Add("@season_no", SqlDbType.NVarChar).Value = textBox2.Text;
                SqlDataAdapter da123 = new SqlDataAdapter(command3);
                DataSet ds7 = new DataSet();
                packinvoicereportotto cr5 = new packinvoicereportotto();
                da121.Fill(ds7, "packinglistdt");
                da12.Fill(ds7, "packinglistdt1");
                da122.Fill(ds7, "packinglistdt2");
                da123.Fill(ds7, "packinglistdt3");
                if (ds7.Tables[0].Rows.Count == 0 && ds7.Tables[1].Rows.Count == 0 && ds7.Tables[2].Rows.Count == 0 && ds7.Tables[3].Rows.Count == 0)
                    {
                    MessageBox.Show("No data Found");
                    return;
                    }
                cr5.SetDataSource(ds7);
                Report re = new Report();



                re.MdiParent = this.MdiParent; 
                re.Text = "Packing List Report";
                re.Show();
                re.crystalReportViewer1.ReportSource = cr5;
                re.crystalReportViewer1.DataBindings.Clear();
                }
...