Example #1
0
        public async Task Init()
        {
            KupovinaSearchRequest request = new KupovinaSearchRequest {
                KorisnikId = Global.Korisnik.Id
            };

            var kupovine = await _kupovinaService.Get <List <Kupovina> >(request);

            if (kupovine != null)
            {
                KupovinaList.Clear();
                foreach (var k in kupovine)
                {
                    KupovinaList.Add(k);
                }
            }
        }
        private async void frmKorisniciIzvjestaj_Load(object sender, EventArgs e)
        {
            this.Korisnik = await _korisnikService.GetById <Korisnik>(KorisnikId);

            this.reportViewer1.LocalReport.SetParameters(new ReportParameter("Ime", Korisnik.Ime));
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter("Prezime", Korisnik.Prezime));
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter("KorisnickoIme", Korisnik.Username));
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter("Email", Korisnik.Email));
            this.reportViewer1.LocalReport.SetParameters(new ReportParameter("Telefon", Korisnik.Telefon));

            KupovinaSearchRequest request = new KupovinaSearchRequest {
                KorisnikId = this.KorisnikId
            };

            kupovine = await _kupovinaService.Get <List <Kupovina> >(request);

            ReportDataSource rdsKupovina = new ReportDataSource("DataSet2", kupovine);

            this.reportViewer1.LocalReport.DataSources.Add(rdsKupovina);

            this.reportViewer1.RefreshReport();
        }