コード例 #1
0
 // The handler of <see cref="PageDocument.LocateDataSource"/> that returns appropriate data for a report.
 private void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
 {
     if (args.DataSet.Name == "Years")             // ObjectsReport :bind collection to report
     {
         args.Data = _dataList;
     }
     else if (args.DataSet.Name == "Movies")             // SubObjectsReport :bind subcollection to subreport
     {
         var yearReleased = 1970;
         foreach (var param in args.Parameters)
         {
             if (param.Name == "YearReleased")
             {
                 yearReleased = int.Parse(param.Value.ToString());
                 break;
             }
         }
         for (int i = 0; i < _dataList.Count; i++)
         {
             if (_dataList[i].YearReleased == yearReleased)
             {
                 args.Data = _dataList[i].Movies;
                 break;
             }
         }
     }
 }
コード例 #2
0
 private void DataSource1(object sender, LocateDataSourceEventArgs args)
 {
     if (args.DataSet.Query.DataSourceName == "DataSource1")
     {
         if (args.DataSet.Name == "DataSet1")
         {
             WorkOrderIBLL workOrderIBLL = new WorkOrderBLL();
             args.Data = workOrderIBLL.GetPrintItem(id);
         }
     }
 }
コード例 #3
0
        // The handler of <see cref="PageDocument.LocateDataSource"/> that returns appropriate data for a report.
        private void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            object data           = null;
            var    dataSourceName = args.DataSourceName;
            var    source         = new DataLayer();

            if (dataSourceName == "DataSource1")
            {
                data = source.CreateData();
            }
            args.Data = data;
        }
コード例 #4
0
        private void Runtime_LocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            //throw new NotImplementedException();
            DataTable dt = new DataTable();

            if (reportfilename.Equals("lab_result_1"))
            {
                //dt = setPrintLabPrnSSO(vn, preno, chk + "-" + mm + "-" + dd);
                args.Data = DT;
            }
            else
            {
                args.Data = DT;
            }
        }
コード例 #5
0
        // The handler of <see cref="PageDocument.LocateDataSource"/> that returns appropriate data for a report.
        private void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            object data           = null;
            var    dataSourceName = args.DataSourceName;
            var    source         = new DataLayer();

            if (dataSourceName == "BandedListDS")
            {
                data = source.CreateReader();
            }
            else if (dataSourceName == "CountrySalesDS")
            {
                data = source.CreateDocument();
            }
            args.Data = data;
        }
コード例 #6
0
        void pageDocument_LocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            var query = from l in db.lagerlisten
                        join f in db.firmen on l.id_lieferant equals f.id
                        where l.id == ArtikelID
                        select new
            {
                id              = l.id,
                bezeichnung     = l.bezeichnung,
                artikelnr       = l.artikelnr,
                beschreibungeng = l.beschreibungeng,
                beschreibung    = l.beschreibung,
                ortregal        = l.ortregal,
                ortbox          = l.ortbox,
                name            = f.name
            };

            args.Data = query.ToList();
        }
コード例 #7
0
ファイル: MainForm.cs プロジェクト: vahmax/Samples14
        // The handler of <see cref="PageDocument.LocateDataSource"/> that returns appropriate data for a report.
        private void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            object data           = null;
            var    dataSourceName = args.DataSet.Query.DataSourceName;

            if (dataSourceName == "DataSource1")
            {
                try
                {
                    data = DataLayer.CreateData(_service);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            args.Data = data;
        }
コード例 #8
0
 private void Runtime_LocateDataSource1(object sender, LocateDataSourceEventArgs args)
 {
     //throw new NotImplementedException();
     args.Data = DT;
 }
コード例 #9
0
 // To connect to unbound data sources at run time,  the DataSet provider can be used with the LocateDataSource event. The reporting engine raises the LocateDataSource event when it needs input on the data to use.
 void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
 {
     args.Data = LoadData();
 }
コード例 #10
0
        void pageDocument_LocateDataSource(object sender, LocateDataSourceEventArgs args)
        {
            LoggingTool.LogMessage("Entering LocateDataSource", "BelegViewer", "LocateDataSource", LoggingTool.LogState.low);


            var query = from b in BelegvModel.BelegePositionen
                        select new

            {
                id            = BelegvModel.id,
                ZusatzInfo    = BelegvModel.ZusatzInfo,
                ZusatzInfo2   = BelegvModel.ZusatzInfo2,
                ZusatzInfo3   = BelegvModel.ZusatzInfo3,
                Ort           = BelegvModel.Ort,
                Straße        = BelegvModel.Straße,
                PLZ           = BelegvModel.PLZ,
                Belegdatum    = BelegvModel.Belegdatum,
                Belegnummer   = BelegvModel.Belegnummer,
                Bemerkung     = BelegvModel.Bemerkung,
                Artikelnummer = b.Artikelnummer,
                Beschreibung  = b.Beschreibung,
                Description   = b.Description,
                Menge         = b.Menge,
                wkz           = b.wkz,
                Preis         = b.Preis,
                id_Sprache    = BelegvModel.id_Sprache,
                Belegart      = BelegvModel.BelegartName
            };


            args.Data = query.ToList();

            //                       PLZ = b.PLZ,
            //                       Ort = a.Ort,
            //                       Straße = a.Straße,
            //                       Land = a.Land,
            //                       Zusatzinfo = a.ZusatzInfo,
            //                       VAT = a.VAT,



            //using (var db = new DAL.SteinbachEntities())
            //{

            //    var bel = db.SI_Belege.Where(i => i.id == BelID).SingleOrDefault();
            //    if (bel.Belegart == "inv" || bel.Belegart == "um")
            //    {

            //var query = from b in db.SI_Belege
            //            join p in db.SI_BelegePositionen on b.id equals p.id_Beleg
            //            join s in db.StammBelegarten on b.Belegart equals s.id
            //            where b.id == BelID
            //            select new
            //            {
            //                id = b.id,
            //                Belegdatum = b.Belegdatum,
            //                Belegnummer = b.Belegnummer,
            //                Bemerkung = b.Bemerkung,
            //                Artikelnummer = p.Artikelnummer,
            //                Beschreibung = p.Beschreibung,
            //                Description = p.Description,
            //                Menge = p.Menge,
            //                wkz = p.wkz,
            //                Preis = p.Preis,
            //                Belegart = s.Belegart
            //            };


            //        args.Data = query.ToList();

            //    }
            //    else
            //    {
            //        var query = from b in db.SI_Belege
            //                    join p in db.SI_BelegePositionen on b.id equals p.id_Beleg
            //                    join pro in db.projekte on b.id_Projekt equals pro.id
            //                    join a in db.Firmen_Adressen on pro.id_Lieferadresse equals a.id
            //                    join s in db.StammBelegarten on b.Belegart equals s.id
            //                    where b.id == BelID
            //                    select new
            //                    {
            //                        id = b.id,
            //                        Belegdatum = b.Belegdatum,
            //                        Belegnummer = b.Belegnummer,
            //                        Bemerkung = b.Bemerkung,
            //                        Artikelnummer = p.Artikelnummer,
            //                        Beschreibung = p.Beschreibung,
            //                        Description = p.Description,
            //                        Menge = p.Menge,
            //                        wkz = p.wkz,
            //                        Preis = p.Preis,
            //                        PLZ = a.PLZ,
            //                        Ort = a.Ort,
            //                        Straße = a.Straße,
            //                        Land = a.Land,
            //                        Zusatzinfo = a.ZusatzInfo,
            //                        VAT = a.VAT,
            //                        Belegart = s.Belegart
            //                    };


            //        args.Data = query.ToList();
            //    }



            //    LoggingTool.LogMessage("Done LocateDataSource", "BelegViewer", "LocateDataSource", LoggingTool.LogState.low);


            //}
        }
コード例 #11
0
 // 実行時にLocateDataSourceイベントと共に、データセットプロバイダを使用し、アンバウンドデータソースと接続できます。LocateDataSourceイベントがデータの入力が必要な場合は、レポートエンジンにより発生されます。
 void OnLocateDataSource(object sender, LocateDataSourceEventArgs args)
 {
     //args.Data = LoadData();
     var a = args;
 }