private void DGVOtpremnice_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            string id;

            id = DGVOtpremnice.Rows[e.RowIndex].Cells["idDokumenta"].Value.ToString();
            int id2 = int.Parse(id.ToString());
            List <PregledOtpremnicaStavke> listaStavki = PregledOtpremnicaStavke.DohvatiStavkeDokumenta(id2);

            DGVStavke.DataSource = listaStavki;
            DGVStavke.Columns["NazivArtikla"].HeaderText = "Naziv artikla";
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Dohvaća podatke o otpremnicama i popunjava report
        /// </summary>
        private void dohvatiOtpremnice()
        {
            Microsoft.Reporting.WinForms.ReportDataSource reportDS1 = new Microsoft.Reporting.WinForms.ReportDataSource();
            Microsoft.Reporting.WinForms.ReportDataSource reportDS2 = new Microsoft.Reporting.WinForms.ReportDataSource();

            reportDS1.Name = "dsOtpremnica";
            reportDS2.Name = "dsOtpremnicaStavke";
            List <PregledOtpremnicaStavke> listaStavki     = PregledOtpremnicaStavke.DohvatiStavkeDokumenta(pID);
            List <PregledOtpremnica>       listaOtpremnica = PregledOtpremnica.DohvatiOtpremnicuPremaID(pID);

            bwLoadReport.ReportProgress(37);
            System.Threading.Thread.Sleep(500);
            reportDS1.Value = listaOtpremnica;
            reportDS2.Value = listaStavki;
            this.report.LocalReport.DataSources.Add(reportDS1);
            this.report.LocalReport.DataSources.Add(reportDS2);
            bwLoadReport.ReportProgress(80);
            System.Threading.Thread.Sleep(500);
            this.report.LocalReport.ReportEmbeddedResource = "Skladiste_PI.Izvjestaji.Otpremnice.rdlc";
        }