/// <summary>
        /// サブレポート用
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
        {
            //サブレポートにサブレポートの番号がわたるように設定してあるので、
            LocalReport parentReport = (LocalReport)sender;

            //親レポートに含まれるデータソースを名前で検索できるようにDictionaryに
            var parentSources = new Dictionary <string, ReportDataSource>();

            foreach (ReportDataSource parentSource in parentReport.DataSources)
            {
                parentSources.Add(parentSource.Name, parentSource);
            }

            //サブレポート内に必要なデータソース名を調べる
            foreach (string sourceName in e.DataSourceNames)
            {
                if (parentSources.ContainsKey(sourceName))
                {
                    //サブレポート内にあるデータソース一覧に親レポートと同じデータソース名が見つかったら
                    //サブレポートにも親レポートのデータソースを登録する
                    e.DataSources.Add(parentSources[sourceName]);
                }
                else
                {
                    //親レポートにない場合や名前が違う場合は継承させられないので
                    //必要なデータソースを追加してやる
                    //DataTable tableDummy=new DataTable();
                    //ReportDataSource subSource = new ReportDataSource(sourceName, tableDummy);
                }
            }
        }
Exemplo n.º 2
0
        private void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
        {
            LocalReport report = sender as LocalReport;
            uint        codigo;

            if (e.ReportPath.Contains("RelatorioPagamento.rdlc"))
            {
                bool retorno = Convert.ToBoolean(e.Parameters["Tipo"].Values.FirstOrDefault());
                codigo = Convert.ToUInt32(e.Parameters["Codigo"].Values.FirstOrDefault());
                if (retorno)
                {
                    OSColecao colecaoOS = report.DataSources["dsOrdem"].Value as OSColecao;
                    OS        os        = colecaoOS.FirstOrDefault(p => p.Cod_ordem == codigo);
                    e.DataSources.Add(new ReportDataSource("dsPagamentos", os.PagamentoColecao));
                }
                else
                {
                    VendaColecao colecaoVenda = report.DataSources["dsVenda"].Value as VendaColecao;
                    Venda        venda        = colecaoVenda.FirstOrDefault(o => o.Cod_venda == codigo);
                    e.DataSources.Add(new ReportDataSource("dsPagamentos", venda.PagamentoColecao));
                }
            }
            else
            {
                codigo = Convert.ToUInt32(e.Parameters["CodigoVenda"].Values.FirstOrDefault());
                VendaColecao colecaoVenda = report.DataSources["dsVenda"].Value as VendaColecao;
                Venda        venda        = colecaoVenda.FirstOrDefault(o => o.Cod_venda == codigo);
                e.DataSources.Add(new ReportDataSource("dsItensVenda", venda.Itens));
            }
        }
Exemplo n.º 3
0
        void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
        {
            //サブレポートにサブレポートの番号がわたるように設定してあるので、
            int pageIndex = int.Parse(e.Parameters["SubPageIndex"].Values[0]);

            if (splitSource.Count > pageIndex)
            {
                //サブレポート用のデータを渡す
                ReportDataSource subReportSource = new ReportDataSource("PageItems", splitSource[pageIndex]);
                e.DataSources.Add(subReportSource);
            }
            else
            {
                //片側分のデータしかない場合
                ReportDataSource subReportSource = new ReportDataSource("PageItems", new Item[0]);
                e.DataSources.Add(subReportSource);
            }
        }
Exemplo n.º 4
0
        private IEnumerable ControlSubReportInfoCallback(PreviewItemContext subReportContext, ParameterInfoCollection initialParameters)
        {
            if (this.SubreportProcessing == null)
            {
                return(null);
            }
            string[] dataSetNames;
            try
            {
                dataSetNames = m_processingHost.GetDataSetNames(subReportContext);
            }
            catch (Exception processingException)
            {
                throw WrapProcessingException(processingException);
            }
            SubreportProcessingEventArgs subreportProcessingEventArgs = new SubreportProcessingEventArgs(subReportContext.OriginalItemPath, ParameterInfoCollectionToApi(initialParameters, SupportsQueries), dataSetNames);

            this.SubreportProcessing(this, subreportProcessingEventArgs);
            return(subreportProcessingEventArgs.DataSources);
        }
 void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
 {
     e.DataSources.Clear();
     e.DataSources.Add(new ReportDataSource("", ctrl.LayMaSo()));
 }
Exemplo n.º 6
0
 void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WinForms.SubreportProcessingEventArgs e)
 {
     //mSettingBindingSource.Clear();
     //mSettingBindingSource.DataSource = DataMaster.GetListEq(typeof(MSetting), MSetting.ColumnNames.SettingId, AppCode.AssemblyProduct);
     //e.DataSources.Add(new ReportDataSource("Inventori_Data_MSetting", mSettingBindingSource));
 }