private void AddKessanJigyouUchiwakeReport(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.JigyouKatsudouUchiwake uchiwake = new models.query.JigyouKatsudouUchiwake(Context.KaikeiDatabase); uchiwake.Calc(form.StartDate.Value, form.EndDate.Value, form.KaikeiKubun, hideInnerKaikeiKubunKamoku: true, omitZeroRow: form.OmitZeroRow); if (uchiwake.NumCols <= 5 - uchiwake.NumStaticCols) { var report = new views.reports.JigyouSyuushiUchiwake5(); AddKessanJigyouUchiwakeReportSub(report, report.Engine, uchiwake, 0, uchiwake.NumCols - 1); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); } else { int startCol = 0; while (startCol <= uchiwake.NumCols - 1) { int endCol = Math.Min(startCol + 7 - uchiwake.NumStaticCols - 1, uchiwake.NumCols - 1); var report = new views.reports.JigyouSyuushiUchiwake7(); AddKessanJigyouUchiwakeReportSub(report, report.Engine, uchiwake, startCol, endCol); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); startCol = endCol + 1; } } }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { SetReportType(cbChooseReportType.SelectedItem.ToString()); if (cbChooseReportType.SelectedItem.ToString() != "View Waste") { this.ucViewWeights1.Visible = false; this.ucViewWeights1.SendToBack(); this.panelParams.Visible = true; this.panelParams.Size = new System.Drawing.Size(937, 217); this.viewer1.Visible = true; this.viewer1.Document.Pages.Clear(); } else { ReportType = "View Waste"; this.panelParams.Visible = false; this.panelParams.Size = new System.Drawing.Size(0, 0); this.viewer1.Visible = false; this.ucViewWeights1.Visible = true; this.ucViewWeights1.BringToFront(); } m_rptMainReport = null; //m_rptBanchReport = null; this.ucLowParticipationParameters1.ClearTitle(); }
private void AddHikiatekinMeisaiReport(DataDynamics.ActiveReports.ActiveReport parentReport) { DateTime startDate = helper.Helper.GetNenndoKisanbi(form.StartDate.Value); DateTime endDate = helper.Helper.GetNenndoKimatsubi(form.EndDate.Value); models.query.HikiatekinMeisai meisai = new models.query.HikiatekinMeisai(Context.KaikeiDatabase); meisai.Calc(startDate, endDate, form.KaikeiKubun); var report = new views.reports.HikiatekinMeisaiReport(); report.SetDB(Context.KaikeiDatabase); int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string kaikeiKubunName = ""; if (form.KaikeiKubun != rootKaikeiKubunId) { kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; } report.SetHeader(startDate, endDate, houjinMei, kaikeiKubunName); report.SetFooter(meisai.SumRow); report.DataSource = meisai.GetMeisaiList(); report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanShikinUchiwakeReportSub(DataDynamics.ActiveReports.ActiveReport report, views.reports.ShikinSyuushiKessanUchiwakeEngine engine, models.query.ShikinSyuushiUchiwake uchiwake, int startCol, int endCol) { engine.SetDB(Context.KaikeiDatabase); int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string title = "【拠点区分資金収支明細書】"; string youshiki = "別紙3(⑩)"; if (form.KaikeiKubun == 1) { title = "【資金収支内訳表】"; youshiki = "第一号第二様式"; } else if (form.KaikeiKubun == 2) { title = "【事業区分資金収支内訳表】"; youshiki = "第一号第三様式"; } engine.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, uchiwake.GetColCaptions(startCol, endCol), title, youshiki); engine.SetFooter( uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ToukiShikin, startCol, endCol), uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ZenkiZandaka, startCol, endCol), uchiwake.GetSummaryRow(models.query.ShikinSyuushi.SummaryItem.ToukiZandaka, startCol, endCol)); var source = uchiwake.GetRows(startCol, endCol); report.DataSource = source; report.Run(); }
public void DisposeReports() { try { if (m_rptMainReport != null && m_rptMainReport.Document != null) { m_rptMainReport.Document.Dispose(); //m_rptMainReport.Document = null; m_rptMainReport.Dispose(); m_rptMainReport = null; } if (m_rptSubReport != null && m_rptSubReport.Document != null) { m_rptSubReport.Document.Dispose(); //m_rptSubReport.Document = null; m_rptSubReport.Dispose(); m_rptSubReport = null; } if (m_rptBanchReport != null && m_rptBanchReport.Document != null) { m_rptBanchReport.Document.Dispose(); //m_rptBanchReport.Document = null; m_rptBanchReport.Dispose(); m_rptBanchReport = null; } GC.Collect(); } catch (Exception) { } }
private void AddKessanBalanceSheetReport(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.BalanceSheet balance = new models.query.BalanceSheet(Context.KaikeiDatabase); balance.Calc(form.StartDate.Value, form.EndDate.Value, form.KaikeiKubun, hideInnerKaikeiKubunKamoku: true); models.query.BalanceSheetTyuuki tyuuki = new models.query.BalanceSheetTyuuki(Context.KaikeiDatabase); tyuuki.Calc(helper.Converter.GetNenndo(form.StartDate.Value), form.KaikeiKubun); var report = new views.reports.BalanceSheet(); report.SetDB(Context.KaikeiDatabase); string houjinMei = Context.KaikeiDatabase.MTKaikeiKubun.RootName; string kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; string title = "拠点区分貸借対照表"; string youshiki = "第三号第四様式"; if (form.KaikeiKubun == 1) { title = "法人単位貸借対照表"; youshiki = "第三号第一様式"; } else if (form.KaikeiKubun == 2) { title = "事業区分貸借対照表"; youshiki = ""; } report.SetHeader( houjinMei, kaikeiKubunName, form.EndDate.Value, title, youshiki); report.SetSummaryRow( balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.ShisanSummary), balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.HusaiSummary), balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.JunshisanSummary), balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.HusaiPlusJunshisanSummary), balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.JikiKurikoshiSagaku), balance.GetSummaryItem(models.query.BalanceSheet.SummaryItem.ToukiSagaku)); report.SetDataSource( balance.GetChildrenList((int)models.constants.MTKamokuKubun.Shisan), balance.GetChildrenList((int)models.constants.MTKamokuKubun.Husai), balance.GetChildrenList((int)models.constants.MTKamokuKubun.Junshisan), tyuuki.Tyuuki1Rows, tyuuki.Tyuuki3Rows, tyuuki.Tyuuki4Rows, tyuuki.Tyuuki5Rows); report.SetTyuukiData( tyuuki.GenkaSyoukyakuRuikeiGaku, tyuuki.TyousyuuHunouKin, tyuuki.Tyuuki2, tyuuki.Tyuuki6); report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddMasterTekiyou(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.TekiyouList tekiyouList = new models.query.TekiyouList(Context.KaikeiDatabase); tekiyouList.CreateList(); var report = new views.reports.TekiyouReport(); report.DataSource = tekiyouList.Rows; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void PrintButtonClicked() { if (!CheckParameter()) { return; } // 伝票番号を振りなおす if (popup.DenpyouSeiriChecked) { context.KaikeiDatabase.KaikeiDenpyouMeisai.RenumberDenpyouBangouRange(popup.StartDate.Value, popup.EndDate.Value); } DataDynamics.ActiveReports.ActiveReport report = new DataDynamics.ActiveReports.ActiveReport(); if (popup.TargetKamokuType == views.popup.KanjouMototyouPrinntPopup.TargetKamokuTypeEnum.Selected) { int kanjouKamokuId = kamokuCode2KanjouKamokuId(popup.TargetKamokuCode); if (popup.DontPrintKanjouMototyouChecked == false) { AddMototyouReport(report, kanjouKamokuId, -1, isHojoKamoku: false); } if (popup.PrintHojoMototyouChecked) { int hojoKamokuId = hojoSeiri2KanjouKamokuId(popup.TargetHojoKamokuSeiri, kanjouKamokuId); AddMototyouReport(report, hojoKamokuId, kanjouKamokuId, isHojoKamoku: true); } } else { string sql = "where usable <> 0 and hierarchy=" + (int)models.constants.MTKanjouKamokuHierarchy.ChuuKubun; if (popup.TargetKamokuType == views.popup.KanjouMototyouPrinntPopup.TargetKamokuTypeEnum.Range) { sql += " and kamoku_code >= '" + popup.KamokuTopCode + "'" + "and kamoku_code <= '" + popup.KamokuBottomCode + "'"; } sql += " order by kamoku_code"; foreach (var kanjouKamokuRow in context.KaikeiDatabase.MTKanjouKamoku.Select(sql)) { AddMototyouReport(report, kanjouKamokuRow.GetId(), -1, isHojoKamoku: false); } } var reportPopup = new views.popup.ReportPreviewPopup(); reportPopup.Document = report.Document; reportPopup.ShowDialog(); }
private void AddMasterKanjouKamoku(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.KanjouKamokuList kamokuList = new models.query.KanjouKamokuList(Context.KaikeiDatabase); kamokuList.CreateList( form.SelectedKanjouKamokuPrintType == views.PrintMainForm.KanjouKamokuPrintType.UsableOnly, withHojoKamkou: true ); var report = new views.reports.KanjouKamokuReport(); report.DataSource = kamokuList.Rows; report.Rows = kamokuList.Rows; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanHoukokusyoHyoushi(DataDynamics.ActiveReports.ActiveReport parentReport) { int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string yuubinBangou = rootRow.GetStr("yuubin_bangou"); string juusyo = Context.KaikeiDatabase.MTKaikeiKubun.GetJuusyoStr(rootRow); var report = new views.reports.KessanHoukokusyoHyoushi(); report.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, yuubinBangou, juusyo); report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanGoukeiZandakaReport(DataDynamics.ActiveReports.ActiveReport parentReport, bool chukubunOnly) { models.query.GoukeiZandakaShisanhyou sisanhyou = new models.query.GoukeiZandakaShisanhyou(Context.KaikeiDatabase); sisanhyou.Calc(form.KaikeiKubun, form.StartDate.Value, chukubunOnly_: chukubunOnly); var report = new views.reports.GoukeiZandakaShisanhyou(); report.SetDB(Context.KaikeiDatabase); string kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; report.SetHeader(kaikeiKubunName, form.StartDate.Value); report.DataSource = sisanhyou.RowList; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanJigyouKatsudouReport(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.JigyouKatsudou jigyou = new models.query.JigyouKatsudou(Context.KaikeiDatabase); jigyou.Calc(form.StartDate.Value, form.EndDate.Value, form.KaikeiKubun, hideInnerKaikeiKubunKamoku: true, targetKamokuKubunHierarchy: form.KamokuKubunHierarchy, omitZeroRow: form.OmitZeroRow); var report = new views.reports.JigyouKatsudouSyuushiKeisansyo(); report.SetDB(Context.KaikeiDatabase); int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; string title = "拠点区分事業活動計算書"; string youshiki = "第二号第四様式"; if (form.KaikeiKubun == 1) { title = "法人単位事業活動計算書"; youshiki = "第二号第一様式"; } else if (form.KaikeiKubun == 2) { title = "事業区分事業活動計算書"; youshiki = ""; } report.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, kaikeiKubunName, title, youshiki); report.SetFooter( jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.ToukiKatsudouZougenSagaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.ZenkiKurikoshiZougenSagaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.ToukimatsuKurikoshiKatsudouZougenSagaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.KihonkinTorikuzushiGaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.SonotaTsumitateTorikuzushiGaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.SonotaTsumitateGaku], jigyou.SummaryRows[(int)models.query.JigyouKatsudou.SummaryItem.JikiKurikoshiKatsudouZougenSagaku]); var source = jigyou.GetRowsForJigyouKatsudouKeisansyoReport(); report.DataSource = source; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanShikinKeisanReport(DataDynamics.ActiveReports.ActiveReport parentReport) { models.query.ShikinSyuushi shikin = new models.query.ShikinSyuushi(Context.KaikeiDatabase); shikin.Calc(form.StartDate.Value, form.EndDate.Value, form.KaikeiKubun, -1, hideInnerKaikeiKubunKamoku: true, targetKamokuKubunHierarchy: form.KamokuKubunHierarchy, omitZeroRow: form.OmitZeroRow); var report = new views.reports.ShikinSyuushiKeisansyo(); report.SetDB(Context.KaikeiDatabase); int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; string title = "拠点区分資金収支計算書"; string youshiki = "第一号第四様式"; if (form.KaikeiKubun == 1) { title = "法人単位資金収支計算書"; youshiki = "第一号第一様式"; } else if (form.KaikeiKubun == 2) { title = "事業区分資金収支計算書"; youshiki = ""; } report.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, kaikeiKubunName, title, youshiki); report.SetFooter( shikin.SummaryRows[(int)models.query.ShikinSyuushi.SummaryItem.Yobihi], shikin.SummaryRows[(int)models.query.ShikinSyuushi.SummaryItem.ToukiShikin], shikin.SummaryRows[(int)models.query.ShikinSyuushi.SummaryItem.ZenkiZandaka], shikin.SummaryRows[(int)models.query.ShikinSyuushi.SummaryItem.ToukiZandaka]); var source = shikin.GetRowsForShikinSyuushiKeisansyoReport(); report.DataSource = source; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddTyuukiReport(DataDynamics.ActiveReports.ActiveReport parentReport) { DateTime startDate = helper.Helper.GetNenndoKisanbi(form.StartDate.Value); models.query.Tyuuki meisai = new models.query.Tyuuki(Context.KaikeiDatabase); if (meisai.Calc(startDate, form.KaikeiKubun, form.GetHideTyuukiRows()) == false) { helper.MsgBox.Err(Properties.Resources.MsgNotExist); return; } var report = new views.reports.TyuukiReport(); report.SetDB(Context.KaikeiDatabase); report.IsHoujinKyoten = (form.KaikeiKubun == Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId); report.Tyuuki = meisai; report.DataSource = meisai.GetRows(); report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }
private void AddKessanJigyouUchiwakeReportSub(DataDynamics.ActiveReports.ActiveReport report, views.reports.JigyouSyuushiUchiwakeEngine engine, models.query.JigyouKatsudouUchiwake uchiwake, int startCol, int endCol) { engine.SetDB(Context.KaikeiDatabase); int rootKaikeiKubunId = Context.KaikeiDatabase.MTKaikeiKubun.RootNodeId; models.db.Row rootRow = Context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(rootKaikeiKubunId); string houjinMei = rootRow.GetStr("name"); string title = "拠点区分事業活動明細書"; string youshiki = "別紙3(⑪)"; if (form.KaikeiKubun == 1) { title = "事業活動内訳表"; youshiki = "第二号第二様式"; } else if (form.KaikeiKubun == 2) { title = "事業区分事業活動内訳表"; youshiki = "第二号第三様式"; } engine.SetHeader(form.StartDate.Value, form.EndDate.Value, houjinMei, uchiwake.GetColCaptions(startCol, endCol), title, youshiki); engine.SetFooter( uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.ToukiKatsudouZougenSagaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.ZenkiKurikoshiZougenSagaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.ToukimatsuKurikoshiKatsudouZougenSagaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.KihonkinTorikuzushiGaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.SonotaTsumitateTorikuzushiGaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.SonotaTsumitateGaku, startCol, endCol), uchiwake.GetSummaryRow(models.query.JigyouKatsudou.SummaryItem.JikiKurikoshiKatsudouZougenSagaku, startCol, endCol) ); var source = uchiwake.GetRows(startCol, endCol); report.DataSource = source; report.Run(); }
private void frmViewReport_Load(object sender, EventArgs e) { Viewer.Toolbar.Images.Images.Add("myIcon", new Bitmap(Digitalizacion2014.Properties.Resources.IconPdf)); int myIcon = Viewer.Toolbar.Images.Images.IndexOfKey("myIcon"); DataDynamics.ActiveReports.Toolbar.Button PDFButton = new DataDynamics.ActiveReports.Toolbar.Button(); PDFButton.Caption = "PDF"; PDFButton.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon; PDFButton.Id = 42; PDFButton.ImageIndex = myIcon; this.Viewer.Toolbar.Tools.Add(PDFButton); Viewer.Toolbar.Images.Images.Add("myIcon", new Bitmap(Digitalizacion2014.Properties.Resources.IconXLS)); myIcon = Viewer.Toolbar.Images.Images.IndexOfKey("myIcon") + 1; DataDynamics.ActiveReports.Toolbar.Button EXCELButton = new DataDynamics.ActiveReports.Toolbar.Button(); EXCELButton.Caption = "Excel"; EXCELButton.ButtonStyle = DataDynamics.ActiveReports.Toolbar.ButtonStyle.TextAndIcon; EXCELButton.Id = 43; EXCELButton.ImageIndex = myIcon; this.Viewer.Toolbar.Tools.Add(EXCELButton); //Cambiar apariencia de Botones Viewer.Toolbar.Tools[0].ToolTip = "Tabla de Contenido"; Viewer.Toolbar.Tools[0].Visible = false; Viewer.Toolbar.Tools[2].Caption = "Imprimir"; Viewer.Toolbar.Tools[2].ToolTip = "Imprimir"; Viewer.Toolbar.Tools[4].ToolTip = "Copiar"; Viewer.Toolbar.Tools[6].ToolTip = "Buscar"; Viewer.Toolbar.Tools[8].ToolTip = "Página"; Viewer.Toolbar.Tools[9].ToolTip = "Multiples páginas"; Viewer.Toolbar.Tools[12].ToolTip = "Alejar"; Viewer.Toolbar.Tools[13].ToolTip = "Acercar"; Viewer.Toolbar.Tools[14].ToolTip = "Valor de acercamiento"; Viewer.Toolbar.Tools[16].ToolTip = "Página anterior"; Viewer.Toolbar.Tools[17].ToolTip = "Página siguiente"; Viewer.Toolbar.Tools[18].ToolTip = "Páginas"; Viewer.Toolbar.Tools[20].ToolTip = "Regresar"; Viewer.Toolbar.Tools[20].Caption = "Regresar"; Viewer.Toolbar.Tools[21].ToolTip = "Avanzar"; Viewer.Toolbar.Tools[21].Caption = "Avanzar"; Viewer.Toolbar.Tools[23].ToolTip = "Anotaciones"; Viewer.Toolbar.Tools[24].ToolTip = "Exportar a PDF"; Viewer.Toolbar.Tools[25].ToolTip = "Exportar a EXCEL"; if (idReporte == null) { return; } //Cargar el Reporte Datos = Acceso.ivkProcedimiento(R_procedimiento, R_validar, R_parametros, Clases.vGlobales.conexion, null); if (!Datos.bOk) { MessageBox.Show("Problemas al cargar el reporte"); return; } this.Text = Datos.ds.Tables[0].Rows[0]["CNombre"].ToString(); byte[] rpxByte = Convert.FromBase64String(Datos.ds.Tables[0].Rows[0]["archivoRPX"].ToString()); System.IO.MemoryStream rpxStream = new System.IO.MemoryStream(rpxByte); DataDynamics.ActiveReports.ActiveReport reporte = new DataDynamics.ActiveReports.ActiveReport(); //reporte.AddAssembly(System.Reflection.Assembly.Load("System.Drawing.dll")); reporte.LoadLayout(rpxStream); //Cargar Datos Datos = Acceso.ivkProcedimiento(D_procedimiento, D_validar, D_parametros, Clases.vGlobales.conexion, null); if (!Datos.bOk) { MessageBox.Show("Problemas al cargar los datos"); return; } reporte.DataSource = Datos.ds.Tables[0]; Viewer.Document = reporte.Document; reporte.Run(); }
private void launchReport() { if (_progressCancelled) { return; } if (VWA4Common.GlobalSettings.PrintViewReportsProgressCancelled) { return; } try { // Init Report Input Parameters UserControls.ReportParameters repParams = ucLowParticipationParameters1.ReportParameters; switch (ReportType) { case "Budget to Actual Comparison": m_rptMainReport = new rptFinancials(repParams, ReportType); break; case "Close-Up View": m_rptMainReport = new rptDetails(repParams); break; case "Configuration": m_rptMainReport = new rptConfiguration(repParams); break; case "Comparison": m_rptMainReport = new rptComparision(repParams); break; case "Comparison: Site Details": m_rptMainReport = new rptComparisonSiteDetails(repParams); break; case "Detail": m_rptMainReport = new rptCrossTab(repParams); break; case "Employee": m_rptMainReport = new rptEmployee(repParams); m_rptMainReport.Run(); if (bool.Parse(repParams["ShowEmployeeSub"].ParamValue)) { m_rptSubReport = new rptEmployeeException(repParams); m_rptSubReport.Run(); m_rptMainReport.Document.Pages.AddRange(m_rptSubReport.Document.Pages); } break; case "Employee Recognition": m_rptMainReport = new rptEmployeeRecognition(repParams); break; case "Event Orders": m_rptMainReport = new rptEvent(repParams); break; case "Financial Summary": m_rptMainReport = new rptFinancials(repParams, ReportType); break; case "Form": m_rptMainReport = new rptFormSeries(); break; case "Goal List by Completion Percent": m_rptMainReport = new rptGoalListbyCompletion(repParams); break; case "Goal History": m_rptMainReport = new rptGoalHistory(repParams); break; case "Goal List": m_rptMainReport = new rptGoalList(repParams); break; case "Goal Weekly Status": m_rptMainReport = new rptGoalWeeklyStatus(repParams); break; case "Goal Progress": m_rptMainReport = new rptGoalProgress(repParams); break; case "Low Participation": m_rptMainReport = new rptLowParticipation(repParams); break; case "Produced Items": m_rptMainReport = new rptProducedItem(repParams); break; case "Staff Mtg. Agenda": m_rptMainReport = new rptPreShiftMeetingForm(repParams); break; case "SWAT Agenda": m_rptMainReport = new rptSWATForm(repParams); break; case "SWAT Notes": m_rptMainReport = new rptSWATNotes(repParams); break; case "Tabular": m_rptMainReport = new rptTabular(repParams); break; case "Tracker Comparison": m_rptMainReport = new rptTrackerComparison(repParams); break; case "Transactions by Employee": m_rptMainReport = new rptEmployeeTransactions(repParams); break; case "Transfers": m_rptMainReport = new rptTransfers(repParams); break; case "Trend": m_rptMainReport = new rptARTrend(repParams); break; case "Waste Avoidance": m_rptMainReport = new rptWasteAvoidance(repParams); break; case "Weekly Tabular": m_rptMainReport = new rptWeeklyTabular(repParams); break; case "YOY Comparison": m_rptMainReport = new rptFinancials(repParams, ReportType); break; default: MessageBox.Show(this, "Error in launchReport: Unknown report type", "ProjectError", MessageBoxButtons.OK, MessageBoxIcon.Error); break; } if (ReportType != "Employee") { m_rptMainReport.Run(); } if (m_rptBanchReport == null) { m_rptBanchReport = new DataDynamics.ActiveReports.ActiveReport(); } m_rptBanchReport.Document.Pages.AddRange(m_rptMainReport.Document.Pages); } catch (Exception ex) { MessageBox.Show(this, "Error in launchReport: " + ex.Message, "ProjectError", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void PrintButtonClicked() { // パラメータチェック var masterBits = views.PrintMainForm.PrintTarget.MTKanjouKamoku | views.PrintMainForm.PrintTarget.MTTekiyou; if ((form.SelectedPrintTarget | masterBits) == masterBits) { // マスターのみ印刷時はパラメータチェックしない } else if (form.StartDate == null || form.EndDate == null) { helper.MsgBox.Err(KaikeiSystemBody.Properties.Resources.MsgInvalidDate); return; } DataDynamics.ActiveReports.ActiveReport report = new DataDynamics.ActiveReports.ActiveReport(); if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.ShiwakeDenpyou) != 0) { PrintShiwakeDenpyou(report, views.PrintMainForm.PrintTarget.ShiwakeDenpyou); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.ShiwakeNikki) != 0) { PrintShiwakeDenpyou(report, views.PrintMainForm.PrintTarget.ShiwakeNikki); } // マスタ if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.MTKanjouKamoku) != 0) { AddMasterKanjouKamoku(report); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.MTTekiyou) != 0) { AddMasterTekiyou(report); } // 決算書類 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanHyoushi) != 0) { AddKessanHoukokusyoHyoushi(report); } //資金収支計算書 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanShikinKeisan) != 0) { AddKessanShikinKeisanReport(report); } //資金収支内訳表 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanShikinUchiwake) != 0) { AddKessanShikinUchiwakeRepoert(report); } //事業活動計算書 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanJigyouKeisan) != 0) { AddKessanJigyouKatsudouReport(report); } //事業活動内訳表 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanJigyouUchiwake) != 0) { AddKessanJigyouUchiwakeReport(report); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanGoukeiZandakaChukubunOnly) != 0) { AddKessanGoukeiZandakaReport(report, chukubunOnly: true); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanGoukeiZandakaWithHojokamoku) != 0) { AddKessanGoukeiZandakaReport(report, chukubunOnly: false); } //貸借対象表 if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KessanBalanceSheet) != 0) { AddKessanBalanceSheetReport(report); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.KoteiShisanMeisai) != 0) { AddKoteiShisanMeisaiReport(report); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.HikiatekinMeisai) != 0) { AddHikiatekinMeisaiReport(report); } if ((form.SelectedPrintTarget & views.PrintMainForm.PrintTarget.Tyuuki) != 0) { AddTyuukiReport(report); } if (report.Document.Pages.Count > 0) { var reportPopup = new views.popup.ReportPreviewPopup(); reportPopup.Document = report.Document; reportPopup.ShowDialog(); } }
private void AddMototyouReport(DataDynamics.ActiveReports.ActiveReport parentReport, int kanjouKamokuId, int parentKamokuId, bool isHojoKamoku) { models.query.KanjouMototyou mototyou = new models.query.KanjouMototyou(context.KaikeiDatabase); mototyou.Calc( popup.StartDate.Value, popup.EndDate.Value, kanjouKamokuId, popup.TargetKaikeiKubun, renumberDenpyouBangou: false, isHojoKamoku: isHojoKamoku); int kaikeiKubun = popup.TargetKaikeiKubun; string houjinMei = context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(context.KaikeiDatabase.MTKaikeiKubun.RootNodeId).GetStr("name") as string; string shisetsuMei = ""; if (kaikeiKubun != -1 && kaikeiKubun != context.KaikeiDatabase.MTKaikeiKubun.RootNodeId) { shisetsuMei = context.KaikeiDatabase.MTKaikeiKubun.GetRowFromCache(kaikeiKubun).GetStr("name") as string; } models.db.Row kanjouKamokuRow = context.KaikeiDatabase.MTKanjouKamoku.GetFirstRow("where id=" + kanjouKamokuId); string kamokuMei = kanjouKamokuRow.GetStr("kamoku", ""); DataDynamics.ActiveReports.ActiveReport report = null; if (popup.RenzokuKeishikiChecked) { report = new views.reports.KanjouMototyou2(); if (isHojoKamoku == false) { (report as views.reports.KanjouMototyou2).SetHeader(houjinMei, shisetsuMei, kamokuMei, "", isHojoMototyou: false); } else { models.db.Row parentKanjouKamokuRow = context.KaikeiDatabase.MTKanjouKamoku.GetFirstRow("where id=" + parentKamokuId); string parentKamokuMei = parentKanjouKamokuRow.GetStr("kamoku", ""); (report as views.reports.KanjouMototyou2).SetHeader(houjinMei, shisetsuMei, parentKamokuMei, kamokuMei, isHojoMototyou: true); } } else { report = new views.reports.KanjouMototyou(); (report as views.reports.KanjouMototyou).SetHeader(houjinMei, shisetsuMei, kamokuMei); } bool printReport = false; if (mototyou.MototyouRows.Count > 0) { report.DataSource = mototyou.MototyouRows; printReport = true; } else if (mototyou.ZengetsuKurikoshiGaku != 0) { // 伝票がない場合、前期繰越の額を印刷する。 List <models.query.KanjouMototyou.MototyouRow> rows = new List <models.query.KanjouMototyou.MototyouRow>(); int taisyakuKubunId = (int)kanjouKamokuRow.GetLong("taisyaku_kubun_id", -1); long karikataKingaku = 0; long kashikataKingaku = 0; switch ((models.constants.MTTaisyakuKubun)taisyakuKubunId) { case models.constants.MTTaisyakuKubun.KariPlus: case models.constants.MTTaisyakuKubun.KariMinus: karikataKingaku = mototyou.ZengetsuKurikoshiGaku; break; case models.constants.MTTaisyakuKubun.KashiPlus: case models.constants.MTTaisyakuKubun.KashiMinus: kashikataKingaku = mototyou.ZengetsuKurikoshiGaku; break; } var row = new models.query.KanjouMototyou.MototyouRow( -1, "", -1, DateTime.Now, "", "", karikataKingaku, kashikataKingaku, mototyou.ZengetsuKurikoshiGaku, null, false, mototyou.ZengetsuKurikoshiGaku ); rows.Add(row); if (popup.RenzokuKeishikiChecked) { (report as views.reports.KanjouMototyou2).ZenkiKurikoshiOnly = true; } else { (report as views.reports.KanjouMototyou).ZenkiKurikoshiOnly = true; } report.DataSource = rows; printReport = true; } if (printReport) { report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); } }
private void PrintShiwakeDenpyou(DataDynamics.ActiveReports.ActiveReport parentReport, views.PrintMainForm.PrintTarget format) { bool margeDenpyouGroup; models.query.ShiwakeDenpyou shiwake = new models.query.ShiwakeDenpyou(Context.KaikeiDatabase); Context.KaikeiDatabase.KaikeiDenpyouMeisai.UpdateEditingRows(); DataDynamics.ActiveReports.ActiveReport report; if (format == views.PrintMainForm.PrintTarget.ShiwakeDenpyou) { report = new views.reports.ShiwakeDenpyouA4(); margeDenpyouGroup = true; } else if (format == views.PrintMainForm.PrintTarget.ShiwakeNikki) { var nikki = new views.reports.ShiwakeNikkityou(); nikki.SetHeader(form.StartDate.Value, form.EndDate.Value); report = nikki; margeDenpyouGroup = false; } else { return; } if (form.SelectedDenpyouPrintMethod == views.PrintMainForm.DenpyouPrintMethod.DenpyouBangou) { if (form.DenpyouBangouDate == null || form.DenpyouBangouStart == null || form.DenpyouBangouEnd == null) { helper.MsgBox.Err(KaikeiSystemBody.Properties.Resources.MsgInvalidDenpyouBangou); return; } shiwake.SetQuery(form.DenpyouBangouDate.Value, form.DenpyouBangouStart.Value, form.DenpyouBangouEnd.Value, form.OnlyCheckedDenpyouPrint, margeDenpyouGroup, form.KaikeiKubun); } else { if (form.StartDate == null || form.EndDate == null) { helper.MsgBox.Err(KaikeiSystemBody.Properties.Resources.MsgInvalidDate); return; } string dateCol = ""; if (form.SelectedDenpyouPrintMethod == views.PrintMainForm.DenpyouPrintMethod.Kihyoubi) { dateCol = "kihyoubi"; } else if (form.SelectedDenpyouPrintMethod == views.PrintMainForm.DenpyouPrintMethod.Koushinbi) { dateCol = "updated_at"; } else if (form.SelectedDenpyouPrintMethod == views.PrintMainForm.DenpyouPrintMethod.Tourokubi) { dateCol = "created_at"; } shiwake.SetQuery(form.StartDate.Value, form.EndDate.Value, dateCol, form.OnlyCheckedDenpyouPrint, margeDenpyouGroup, form.KaikeiKubun); } string kaikeiKubunName = Context.KaikeiDatabase.MTKaikeiKubun.GetFirst("name", "where id=" + form.KaikeiKubun) as string; report.DataSource = shiwake.RowList; report.Run(); parentReport.Document.Pages.AddRange(report.Document.Pages.GetRange(0, report.Document.Pages.Count)); }