private void UltraButton2_Click(object sender, EventArgs e) { ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpBudzetiranje.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; rpt.SetDataSource(S_FIN_IZVRSENJE_PLANADataSet1); rpt.SetParameterValue("@ORGANIZAC", this.UltraTextEditor1.Value.ToString()); rpt.SetParameterValue("@godina", (int)mipsed.application.framework.Application.ActiveYear); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); this.ParentForm.DialogResult = System.Windows.Forms.DialogResult.OK; }
public void IspisOzn(object sender, EventArgs e) { if (ugdData.ActiveRow != null) { Dictionary <int, int> oznaceni = VratiOznaceneRacune(ugdData.Rows); if (oznaceni.Count > 0) { BusinessLogic.Racuni objekt = new BusinessLogic.Racuni(); ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptVirmaniUF.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; rpt.SetDataSource(objekt.GetDataRacuni(oznaceni)); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } }
private void UltraButton2_Click(object sender, EventArgs e) { KORISNIKDataSet dataSet = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(dataSet); string str6 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1naziv"]); string str5 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIK"]); string str = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1adresa"]); string str2 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1mjesto"]); string str8 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KONTAKTTELEFON"]); string str4 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KONTAKTFAX"]); string str3 = ""; ReportDocument document = new ReportDocument(); document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptPorez.rpt"); document.SetDataSource(this.S_OD_REKAP_POREZDataSet1); document.SetParameterValue("OBRACUN", this.obracun.Text + " -isplata plaće za " + DB.MjesecNazivPlatna(this.mjesec) + "/" + Conversions.ToString(this.godina) + "."); document.SetParameterValue("BROJRACUNA", str3); document.SetParameterValue("ADRESA2", str2); document.SetParameterValue("ADRESA", str); document.SetParameterValue("USTANOVA", str6); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); this.ParentForm.Close(); }
public void Ispis(object sender, EventArgs e) { if (ugdFormPregled.ActiveRow != null) { ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpPrimka.rpt"); //rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpPrimka2.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; BusinessLogic.Primka.pID = (int)ugdFormPregled.ActiveRow.Cells["ID"].Value; using (BusinessLogic.Primka objekt = new BusinessLogic.Primka()) { rpt.SetDataSource(objekt.GetPrimkaIspis()); //db - 26.10.2016 //rpt.Subreports[0].SetDataSource(objekt.GetPrimkaGrupe((int)BusinessLogic.Primka.pID)); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } }
public void Izvjestaji(object sender, EventArgs e) { if (ugdNarudzbenica.ActiveRow != null) { BusinessLogic.Narudzbenica.pID_Narudzbenica = BusinessLogic.Narudzbenica.IsDbNull <int>(ugdNarudzbenica.ActiveRow.Cells["ID"].Value); BusinessLogic.Narudzbenica objekt = new BusinessLogic.Narudzbenica(); ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpNarudzbeniceIspis.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; rpt.SetDataSource(objekt.GetNarudzbenicaIspis(BusinessLogic.Narudzbenica.pID_Narudzbenica)); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } }
private void Ispisi() { this.BackgroundUpdate(); frmPregledBilance bilance = new frmPregledBilance { ds = this.DSBILANCA }; if (bilance.ShowDialog() == DialogResult.OK) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Analitička bruto bilanca", Description = "Pregled izvještaja - Analitička bruto bilanca", Icon = ImageResourcesNew.mbs }; ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = this.rpt; item.Show(item.Workspaces["main"], info); } }
public void PretraziHandler(object sender, EventArgs e) { System.Drawing.Point point = new System.Drawing.Point(Cursor.Position.X, Cursor.Position.Y); UltraGrid dataGrid = new UltraGrid(); dataGrid = this.userControlDataGridKONTO.DataGrid; ExtendedWindowSmartPartInfo smartPartInfo = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, ControlBox = false, Title = "Unesite tekst za pretraživanje", Icon = ImageResourcesNew.mbs }; ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); UnosPojma smartPart = this.Controller.WorkItem.Items.AddNew <UnosPojma>(); workspace.Show(smartPart, smartPartInfo); if (smartPart.ParentForm.DialogResult == DialogResult.OK) { ColumnEnumerator enumerator = dataGrid.DisplayLayout.Bands[0].Columns.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.DataType.ToString() == "System.String") { dataGrid.DisplayLayout.Bands[0].ColumnFilters["IDKONTO"].FilterConditions.Add(FilterComparisionOperator.Contains, smartPart.UneseniString); } } } }
public void Ispisi() { ReportDocument document = new ReportDocument(); document.Load(System.Windows.Forms.Application.StartupPath + @"\DDIzvjestaji\rptRekapitulacijaObracun.rpt"); document.SetDataSource(this.Dataset11); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } int num2 = Conversions.ToInteger(this.m_idobracun.Substring(5, 2)); int num = Conversions.ToInteger(this.m_idobracun.Substring(0, 4)); KORISNIKDataAdapter adapter = new KORISNIKDataAdapter(); KORISNIKDataSet dataSet = new KORISNIKDataSet(); adapter.Fill(dataSet); document.SetParameterValue("naziv", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ADRESA", Operators.AddObject(Operators.AddObject(dataSet.KORISNIK.Rows[0]["KORISNIK1ADRESA"], " "), dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("oib", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIKOIB"])); document.SetParameterValue("TELEFONfax", Operators.AddObject(Operators.AddObject(dataSet.KORISNIK.Rows[0]["KONTAKTTELEFON"], " "), dataSet.KORISNIK.Rows[0]["KONTAKTFAX"])); document.SetParameterValue("obracun", this.m_idobracun); document.SetParameterValue("opisObracuna", this.m_opisobracuna); item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); }
public void iSPISI() { KORISNIKDataSet dataSet = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(dataSet); ReportDocument document = new ReportDocument(); ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja", Description = "Pregled", Icon = ImageResourcesNew.mbs }; document.Load(System.Windows.Forms.Application.StartupPath + @"\ddIzvjestaji\rptPotvrdaOIsplatidohotka.rpt"); document.SetDataSource(this.ds); document.SetParameterValue("GODINA", this.GODINA); document.SetParameterValue("naziv", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("adresa", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); document.SetParameterValue("mb", dataSet.KORISNIK.Rows[0]["KORISNIKOIB"].ToString()); document.SetParameterValue("mjesto", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); }
public void PlanNabave(object sender, EventArgs e) { if (ugdPlanNabave.ActiveRow != null) { using (PlanNabveIspis plan_ispis = new PlanNabveIspis()) { if (plan_ispis.ShowDialogForm("Plan nabave ispis") == DialogResult.OK) { BusinessLogic.PlanNabave.pID = Convert.ToInt32(ugdPlanNabave.ActiveRow.Cells["ID"].Value); BusinessLogic.PlanNabave plan_nabave = new BusinessLogic.PlanNabave(); DataTable dt_plan_nabave = plan_nabave.GetPlanNabaveIspis(BusinessLogic.PlanNabave.pID); ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpPlanNabave.rpt"); rpt.SetDataSource(dt_plan_nabave); rpt.SetParameterValue("KorisnickiDatum", BusinessLogic.PlanNabave.pIspisPlanaNabave); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } } }
public void DNRCommand(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Evidencija o dohotku od nesamostalnog rada", Description = "Pregled izvještaja - videncija o dohotku od nesamostalnog rada" }; ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\DDIzvjestaji\rptDNR.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; frmDNR dnr = new frmDNR(); if (dnr.ShowDialog() == DialogResult.OK) { DataTable ds = new DataTable("DNR"); SqlCommand sqlComm = new SqlCommand("sp_DNR", conn.sqlConnection); sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.Parameters.AddWithValue("@Godina", dnr.pGodina); sqlComm.Parameters.AddWithValue("@OdMjeseca", dnr.pOdMjeseca); sqlComm.Parameters.AddWithValue("@DoMjeseca", dnr.pDoMjeseca); sqlComm.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlComm; da.Fill(ds); DataTable dtosobe = new DataTable(); try { dtosobe = ds.Select("IDRADNIK In (" + dnr.pOsobe + ")").CopyToDataTable(); } catch { } rpt.SetDataSource(dtosobe); DataRow korisnik = conn.GetDataTable("SELECT TOP 1 korisnik1naziv,korisnik1adresa,korisnik1mjesto,kontakttelefon,kontaktfax,email,korisnikoib FROM KORISNIK").Rows[0]; rpt.SetParameterValue("@KorisnikNaziv", korisnik["KORISNIK1NAZIV"].ToString()); rpt.SetParameterValue("@KorisnikAdresa", korisnik["KORISNIK1ADRESA"].ToString() + ", " + korisnik["KORISNIK1MJESTO"].ToString()); rpt.SetParameterValue("@KorisnikOIB", korisnik["KORISNIKOIB"].ToString()); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } }
public void IspisVishak(object sendr, EventArgs e) { if (ugdFormPregled.ActiveRow != null) { ReportDocument rpt = new ReportDocument(); //NOVI report za selektirane inventure rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpInventuraVishak.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; //Dictionary<int, int> oznaceni = VratiOznaceneInventure(ugdFormPregled.Rows); BusinessLogic.Inventura.pID = (int)ugdFormPregled.ActiveRow.Cells["ID"].Value; int idInv = Convert.ToInt32(ugdFormPregled.ActiveRow.Cells["ID"].Value); DateTime dat = Convert.ToDateTime(ugdFormPregled.ActiveRow.Cells["DatumInventure"].Value); using (BusinessLogic.Inventura objekt = new BusinessLogic.Inventura()) { rpt.SetDataSource(objekt.DohvatiInventuruVishak(idInv, dat)); KORISNIKDataSet set2 = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set2); if (set2.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); rpt.SetParameterValue("Datum", dat); } ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } }
private void UltraButton2_Click(object sender, EventArgs e) { KORISNIKDataSet dataSet = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(dataSet); string str8 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1naziv"]); string str5 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["MBKORISNIK"]); string str = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1adresa"]); string str2 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["korisnik1mjesto"]); string str7 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KONTAKTTELEFON"]); string str4 = Conversions.ToString(dataSet.KORISNIK.Rows[0]["KONTAKTFAX"]); ReportDocument document = new ReportDocument(); document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptBrutoElementi.rpt"); if (this.optKreditor.Checked) { document.ReportDefinition.Sections[4].SectionFormat.EnableNewPageAfter = true; document.ReportDefinition.Sections[5].SectionFormat.EnableNewPageAfter = true; } else { document.ReportDefinition.Sections[4].SectionFormat.EnableNewPageAfter = false; document.ReportDefinition.Sections[5].SectionFormat.EnableNewPageAfter = false; } document.SetDataSource(this.S_od_rekap_brutoDataSet1); document.SetParameterValue("OBRACUN", string.Format("{0} -isplata plaće za {1}/{2}.", this.obracun.Text, DB.MjesecNazivPlatna(this.mjesec), Conversions.ToString(this.godina))); document.SetParameterValue("ADRESA2", str2); document.SetParameterValue("ADRESA", str); document.SetParameterValue("ustanova", str8); document.SetParameterValue("TELEFON", str7); document.SetParameterValue("FAX", str4); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); this.ParentForm.Close(); }
public void Ispis(object sender, EventArgs e) { if (ugdFormPregled.ActiveRow != null) { ReportDocument rpt = new ReportDocument(); //POTrEBNO JE KREIRATI NOVI REPORT SAMO ZA INVENTURE!! //rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpIzdatnica.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; BusinessLogic.Inventura.pID = (int)ugdFormPregled.ActiveRow.Cells["ID"].Value; using (BusinessLogic.Inventura objekt = new BusinessLogic.Inventura()) { rpt.SetDataSource(objekt.GetInventuraIspis()); KORISNIKDataSet set2 = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set2); //if (set2.KORISNIK.Rows.Count > 0) //{ // rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); // rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIKOIB"])); // rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); //} ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } }
public void IspisKarticeOS(object sender, EventArgs e) { frmUvjetiBilanca bilanca = new frmUvjetiBilanca(); OSDataSet set = new OSDataSet(); ReportDocument document = new ReportDocument(); int index = 0; RowEnumerator enumerator = this.userControlDataGridOS.DataGrid.Selected.Rows.GetEnumerator(); while (enumerator.MoveNext()) { UltraGridRow current = enumerator.Current; DataRow[] rowArray = this.userControlDataGridOS.DataGrid.DataSet.OS.Select(Conversions.ToString(Operators.ConcatenateObject("invbroj = ", current.Cells["invbroj"].Value))); DataRow[] rowArray2 = this.userControlDataGridOS.DataGrid.DataSet.OSTEMELJNICA.Select(Conversions.ToString(Operators.ConcatenateObject("invbroj = ", current.Cells["invbroj"].Value))); set.OS.ImportRow(rowArray[0]); int num2 = rowArray2.Length - 1; for (index = 0; index <= num2; index++) { set.OSTEMELJNICA.ImportRow(rowArray2[index]); } } document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptOSKartica.rpt"); document.SetDataSource(set); KORISNIKDataSet dataSet = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(dataSet); document.SetParameterValue("ustanova", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ustanova2", Operators.AddObject(Operators.AddObject(dataSet.KORISNIK.Rows[0]["KORISNIK1ADRESA"], " "), dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("tel", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KONTAKTTELEFON"])); document.SetParameterValue("fax", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KONTAKTFAX"])); document.SetParameterValue("oib", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIKOIB"])); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); }
public void StanjeDokumenti_Command(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Stanje Dokumenti", Description = "Pregled izvještaja - Stanje Dokumenti" }; ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptStanjeDokumenti.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); try { ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = Mipsed7.Core.ApplicationDatabaseInformation.ServerName; connInfo.DatabaseName = Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName; connInfo.UserID = Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName; connInfo.Password = Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword; TableLogOnInfo tableLogOnInfo = new TableLogOnInfo(); tableLogOnInfo.ConnectionInfo = connInfo; foreach (Table table in rpt.Database.Tables) { table.ApplyLogOnInfo(tableLogOnInfo); table.LogOnInfo.ConnectionInfo.ServerName = connInfo.ServerName; table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName; table.LogOnInfo.ConnectionInfo.UserID = connInfo.UserID; table.LogOnInfo.ConnectionInfo.Password = connInfo.Password; } } catch (Exception exp) { MessageBox.Show(exp.Message); } //dohvat i interakcija s formom UI.Izvjestaji.frmStanjeDokumenti objekt = new UI.Izvjestaji.frmStanjeDokumenti(); if (objekt.ShowDialog() == DialogResult.OK) { using (BusinessLogic.OtvaranjeSkladista objekt2 = new BusinessLogic.OtvaranjeSkladista()) { KORISNIKDataSet set = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set); rpt.SetDataSource(objekt2.GetStanjeDokumenti(UI.Izvjestaji.frmStanjeDokumenti.datumOd, UI.Izvjestaji.frmStanjeDokumenti.datumDo, UI.Izvjestaji.frmStanjeDokumenti.idSkladista, UI.Izvjestaji.frmStanjeDokumenti.idMjestoTroska, UI.Izvjestaji.frmStanjeDokumenti.dokument)); if (set.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); } rpt.SetParameterValue("DatumOD", UI.Izvjestaji.frmStanjeDokumenti.datumOd); rpt.SetParameterValue("DatumDo", UI.Izvjestaji.frmStanjeDokumenti.datumDo); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } } }
public void KontirajHandler(object sender, EventArgs e) { SHEMADDDataAdapter adapter = new SHEMADDDataAdapter(); SHEMADDDataSet dataSet = new SHEMADDDataSet(); GKSTAVKADataSet set2 = new GKSTAVKADataSet(); GKSTAVKADataAdapter adapter3 = new GKSTAVKADataAdapter(); int num = Conversions.ToInteger(Operators.AddObject(this.NUMERACIJA(), 1)); SHEMADDSelectionListWorkItem item = this.Controller.WorkItem.Items.AddNew <SHEMADDSelectionListWorkItem>("test"); DataRow row3 = item.ShowModal(true, "", null); item.Terminate(); if (row3 != null) { DataRow row2; DataRow current; IEnumerator enumerator = null; this.OPIS = "test"; this.OPIS = this.m_opisobracuna + " " + this.MJESECOBRACUNA + "/" + this.GODINAOBRACUNA + " šifra obr. " + this.m_idobracun; adapter.FillByIDSHEMADD(dataSet, Conversions.ToInteger(row3["idshemadd"])); decimal num2 = Conversions.ToDecimal(this.DsTotaliUstanove1.Tables[1].Rows[0]["uKUPNOBRUTO"]); if (dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=8").Length > 0) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=8")[0]["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=8")[0]["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=8")[0]["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["uKUPNOBRUTO"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["uKUPNOBRUTO"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } S_DD_REKAP_DOPRINOSDataAdapter adapter2 = new S_DD_REKAP_DOPRINOSDataAdapter(); S_DD_REKAP_DOPRINOSDataSet set3 = new S_DD_REKAP_DOPRINOSDataSet(); adapter2.Fill(set3, this.m_idobracun); try { enumerator = dataSet.SHEMADDSHEMADDDOPRINOS.Rows.GetEnumerator(); while (enumerator.MoveNext()) { current = (DataRow)enumerator.Current; if (set3.S_DD_REKAP_DOPRINOS.Select(Conversions.ToString(Operators.ConcatenateObject("sifra = ", current["SHEMADDDOPRINOSIDDOPRINOS"]))).Length > 0) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(current["KONTODOPIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(current["MTDOPIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(current["STRANEDOPIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = RuntimeHelpers.GetObjectValue(set3.S_DD_REKAP_DOPRINOS.Select(Conversions.ToString(Operators.ConcatenateObject("sifra = ", current["SHEMADDDOPRINOSIDDOPRINOS"])))[0]["iznos"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = RuntimeHelpers.GetObjectValue(set3.S_DD_REKAP_DOPRINOS.Select(Conversions.ToString(Operators.ConcatenateObject("sifra = ", current["SHEMADDDOPRINOSIDDOPRINOS"])))[0]["iznos"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } foreach (DataRow row in dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=9")) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(row["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(row["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(row["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnoporez"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnoporez"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } foreach (DataRow row in dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=10")) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(row["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(row["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(row["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnoprirez"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnoprirez"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } foreach (DataRow row in dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=11")) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(row["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(row["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(row["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["porezkrizni"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = RuntimeHelpers.GetObjectValue(this.DsTotaliUstanove1.Tables[1].Rows[0]["porezkrizni"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } foreach (DataRow row in dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=12")) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(row["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(row["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(row["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = Operators.SubtractObject(this.DsTotaliUstanove1.Tables[1].Rows[0]["netoplaca"], this.DsTotaliUstanove1.Tables[1].Rows[0]["porezkrizni"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = Operators.SubtractObject(this.DsTotaliUstanove1.Tables[1].Rows[0]["netoplaca"], this.DsTotaliUstanove1.Tables[1].Rows[0]["porezkrizni"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } foreach (DataRow row in dataSet.SHEMADDSHEMADDSTANDARD.Select("idddvrsteiznosa=14")) { row2 = set2.GKSTAVKA.NewRow(); row2["datumdokumenta"] = DateAndTime.Today; row2["brojdokumenta"] = num; row2["brojstavke"] = 1; row2["iddokument"] = 0x3e6; row2["OPIS"] = this.OPIS; row2["zatvoreniiznos"] = 0; row2["statusgk"] = 0; row2["IDKONTO"] = RuntimeHelpers.GetObjectValue(row["KONTODDVRSTAIZNOSAIDKONTO"]); row2["IDMJESTOTROSKA"] = RuntimeHelpers.GetObjectValue(row["MTDDVRSTAIZNOSAIDMJESTOTROSKA"]); row2["IDORGJED"] = RuntimeHelpers.GetObjectValue(dataSet.SHEMADD.Rows[0]["SHEMADDOJIDORGJED"]); row2["GKGODIDGODINE"] = mipsed.application.framework.Application.ActiveYear; if (Operators.ConditionalCompareObjectEqual(row["STRANEDDVRSTEIZNOSAIDSTRANEKNJIZENJA"], 1, false)) { row2["duguje"] = Operators.AddObject(this.DsTotaliUstanove1.Tables[1].Rows[0]["uKUPNOBRUTO"], this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnodoprinosina"]); row2["potrazuje"] = 0; } else { row2["potrazuje"] = Operators.AddObject(this.DsTotaliUstanove1.Tables[1].Rows[0]["uKUPNOBRUTO"], this.DsTotaliUstanove1.Tables[1].Rows[0]["ukupnodoprinosina"]); row2["duguje"] = 0; } set2.GKSTAVKA.Rows.Add(row2); } ExtendedWindowSmartPartInfo smartPartInfo = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, ControlBox = false, Title = "Pretpregled temeljnice prije knjiženja", Icon = ImageResourcesNew.mbs }; ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PregledTemeljnice smartPart = this.Controller.WorkItem.Items.AddNew <PregledTemeljnice>(); smartPart.GkstavkaDataSet1.Merge(set2); workspace.Show(smartPart, smartPartInfo); if (smartPart.ParentForm.DialogResult == DialogResult.OK) { IEnumerator enumerator2 = null; try { enumerator2 = set2.GKSTAVKA.GetEnumerator(); while (enumerator2.MoveNext()) { current = (DataRow)enumerator2.Current; current.BeginEdit(); current["datumdokumenta"] = RuntimeHelpers.GetObjectValue(smartPart.datumdok.Value); current.EndEdit(); } } finally { if (enumerator2 is IDisposable) { (enumerator2 as IDisposable).Dispose(); } } adapter3.Update(set2); Interaction.MsgBox("Knjiženje uspješno izvršeno. Kreiran je broj dokumenta: " + Conversions.ToString(num), MsgBoxStyle.Information, "MBS.Complete"); } } }
public void IspisBilance(object sender, EventArgs e) { frmUvjetiBilanca bilanca = new frmUvjetiBilanca(); if (bilanca.ShowDialog() == DialogResult.OK) { string str = string.Empty; ReportDocument document = new ReportDocument(); if (bilanca.___PoNosiocu) { document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptOSBilancaPoNosiocu.rpt"); } else { document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptOSBilanca.rpt"); } S_OS_BILANCA_STANJA_NA_DANDataAdapter adapter = new S_OS_BILANCA_STANJA_NA_DANDataAdapter(); S_OS_BILANCA_STANJA_NA_DANDataSet dataSet = new S_OS_BILANCA_STANJA_NA_DANDataSet(); S_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJIDataAdapter adapter2 = new S_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJIDataAdapter(); S_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJIDataSet set2 = new S_OS_BILANCA_STANJA_NA_DAN_PO_LOKACIJIDataSet(); if (bilanca.___PoNosiocu) { adapter2.Fill(set2, bilanca.__nadan, Conversions.ToString(bilanca.__Sort), Conversions.ToInteger(bilanca.__Vrsta)); document.SetDataSource(set2); } else { adapter.Fill(dataSet, bilanca.__nadan, Conversions.ToString(bilanca.__Sort), Conversions.ToShort(bilanca.__Vrsta)); document.SetDataSource(dataSet); } DateTimeFormatInfo dateTimeFormat = new CultureInfo("hr-HR").DateTimeFormat; if (Operators.ConditionalCompareObjectEqual(bilanca.__Vrsta, 1, false)) { if (bilanca.___PoNosiocu) { str = "Stanje osnovnih sredstava po lokacijama na dan: " + bilanca.__nadan.ToString("d", dateTimeFormat); } else { str = "Stanje osnovnih sredstava na dan: " + bilanca.__nadan.ToString("d", dateTimeFormat); } } else if (bilanca.___PoNosiocu) { str = "Stanje sitnog inventara po lokacijama na dan: " + bilanca.__nadan.ToString("d", dateTimeFormat); } else { str = "Stanje sitnog inventara na dan: " + bilanca.__nadan.ToString("d", dateTimeFormat); } KORISNIKDataSet set3 = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set3); document.SetParameterValue("ustanova", RuntimeHelpers.GetObjectValue(set3.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ustanova2", Operators.AddObject(Operators.AddObject(set3.KORISNIK.Rows[0]["KORISNIK1ADRESA"], " "), set3.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("tel", RuntimeHelpers.GetObjectValue(set3.KORISNIK.Rows[0]["KONTAKTTELEFON"])); document.SetParameterValue("fax", RuntimeHelpers.GetObjectValue(set3.KORISNIK.Rows[0]["KONTAKTFAX"])); document.SetParameterValue("oib", RuntimeHelpers.GetObjectValue(set3.KORISNIK.Rows[0]["KORISNIKOIB"])); document.SetParameterValue("naslov", str); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Activate(); item.Show(item.Workspaces["main"]); } }
public void KarticaMaterijala_Command(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Kartica reprodukcijskog materijala", Description = "Pregled izvještaja - Kartica reprodukcijskog materijala" }; ReportDocument rpt = new ReportDocument(); string datumOd; string datumDo; rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpKarticaReprodukcijskogMaterijala.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); try { ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = Mipsed7.Core.ApplicationDatabaseInformation.ServerName; connInfo.DatabaseName = Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName; connInfo.UserID = Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName; connInfo.Password = Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword; TableLogOnInfo tableLogOnInfo = new TableLogOnInfo(); tableLogOnInfo.ConnectionInfo = connInfo; foreach (Table table in rpt.Database.Tables) { table.ApplyLogOnInfo(tableLogOnInfo); table.LogOnInfo.ConnectionInfo.ServerName = connInfo.ServerName; table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName; table.LogOnInfo.ConnectionInfo.UserID = connInfo.UserID; table.LogOnInfo.ConnectionInfo.Password = connInfo.Password; } } catch (Exception exp) { MessageBox.Show(exp.Message); } UI.Izvjestaji.frmKarticeArtikala objekt = new UI.Izvjestaji.frmKarticeArtikala(); if (objekt.ShowDialog() == DialogResult.OK) { using (BusinessLogic.Proizvod objekt2 = new BusinessLogic.Proizvod()) { if (UI.Izvjestaji.frmKarticeArtikala.naDan != null) { datumDo = UI.Izvjestaji.frmKarticeArtikala.naDan.Value.ToString("yyyy-MM-dd"); datumOd = new DateTime(2000, 1, 1).ToString("yyyy-MM-dd"); } else { datumDo = UI.Izvjestaji.frmKarticeArtikala.razdobljeDatumDo.Value.ToString("yyyy-MM-dd"); datumOd = UI.Izvjestaji.frmKarticeArtikala.razdobljeDatumOd.Value.ToString("yyyy-MM-dd"); } KORISNIKDataSet set = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set); rpt.SetDataSource(objekt2.GetKarticeArtiklaIspis(UI.Izvjestaji.frmKarticeArtikala.pProizvod, UI.Izvjestaji.frmKarticeArtikala.pSkladiste, datumOd, datumDo)); if (set.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); } rpt.SetParameterValue("@ID", UI.Izvjestaji.frmKarticeArtikala.pProizvod); rpt.SetParameterValue("@Skladiste", UI.Izvjestaji.frmKarticeArtikala.pSkladiste); rpt.SetParameterValue("@DatumOd", datumOd); rpt.SetParameterValue("@DatumDo", datumDo); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } } }
public void IDD1Command(object sender, EventArgs e) { int nMjesec = 0; int num = 0; decimal num3 = 0; IEnumerator enumerator = null; UCENIKOBRACUNDataSet dataSet = new UCENIKOBRACUNDataSet(); new UCENIKOBRACUNDataAdapter().Fill(dataSet); try { enumerator = dataSet.UCENIKOBRACUN.GetEnumerator(); while (enumerator.MoveNext()) { object objectValue = RuntimeHelpers.GetObjectValue(enumerator.Current); if (Operators.ConditionalCompareObjectEqual(NewLateBinding.LateIndexGet(objectValue, new object[] { "aktivanzarsm" }, null), true, false)) { DataRow current1 = (DataRow)enumerator.Current; nMjesec = (int)(current1["ucobrmjesec"]); IEnumerator enumerator2 = null; try { enumerator2 = dataSet.UCENIKOBRACUNUCENIKOBRACUNDETAIL.Rows.GetEnumerator(); while (enumerator2.MoveNext()) { DataRow current = (DataRow)enumerator2.Current; if (Conversions.ToBoolean(Operators.AndObject(Operators.CompareObjectEqual(current["ucobrmjesec"], NewLateBinding.LateIndexGet(objectValue, new object[] { "ucobrmjesec" }, null), false), Operators.CompareObjectEqual(current["ucobrgodina"], NewLateBinding.LateIndexGet(objectValue, new object[] { "ucobrgodina" }, null), false)))) { num3 = Conversions.ToDecimal(Operators.AddObject(num3, current["obracunosnovicepraksa"])); num++; } } continue; } finally { if (enumerator2 is IDisposable) { (enumerator2 as IDisposable).Dispose(); } } } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } decimal num2 = DB.RoundUP(decimal.Divide(decimal.Multiply(num3, 5M), 100M)); decimal num4 = DB.RoundUP((Convert.ToDouble(num3) * 0.5) / 100.0); ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - IDD-1", Description = "Pregled izvještaja - IDD-1", Icon = ImageResourcesNew.mbs }; KORISNIKDataAdapter adapter2 = new KORISNIKDataAdapter(); KORISNIKDataSet set2 = new KORISNIKDataSet(); adapter2.Fill(set2); ReportDocument document = new ReportDocument(); document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptObrazacIDD-1.RPT"); document.SetParameterValue("USTANOVA", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ADRESA", Operators.AddObject(Operators.AddObject(set2.KORISNIK.Rows[0]["KORISNIK1ADRESA"], ","), set2.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIKOIB"])); document.SetParameterValue("TOCKA33", num2); document.SetParameterValue("TOCKA38", num4); document.SetParameterValue("OSNOVICA", num3); document.SetParameterValue("BROJKOMADA", num); document.SetParameterValue("DATUM", DateAndTime.Today); document.SetParameterValue("naslov", "o isplaćenoj naknadi plaće te o osnovicama i obračunatim i uplaćenim doprinosima za obvezna osiguranja u mjesecu " + DB.MjesecNazivDativ(nMjesec)); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Show(item.Workspaces["main"], info); }
private void Ispis_Prilog1_Obrasca() { string str = string.Empty; string str2 = string.Empty; this.Cursor = Cursors.WaitCursor; ReportDocument document = new ReportDocument(); ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Prilog 1", Description = "Pregled izvještaja - Prilog 1", Icon = ImageResourcesNew.mbs }; document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptPrilog1.rpt"); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } this.ParentForm.Close(); item.Izvjestaj = document; KORISNIKDataAdapter adapter = new KORISNIKDataAdapter(); KORISNIKDataSet dataSet = new KORISNIKDataSet(); adapter.Fill(dataSet); document.SetParameterValue("USTANOVA", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ADRESA2", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("RKDP", DB.N20(RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["rkp"]))); document.SetParameterValue("PLACABROJ", DB.N20(RuntimeHelpers.GetObjectValue(this.plBroj.Value))); document.SetParameterValue("PLACASVOTA", DB.N20(RuntimeHelpers.GetObjectValue(this.plIznos.Value))); document.SetParameterValue("JUBILARNEBROJ", DB.N20(RuntimeHelpers.GetObjectValue(this.jbBroj.Value))); document.SetParameterValue("JUBILARNESVOTA", DB.N20(RuntimeHelpers.GetObjectValue(this.jbIznos.Value))); document.SetParameterValue("TEKUCIBROJ", DB.N20(RuntimeHelpers.GetObjectValue(this.tkBroj.Value))); document.SetParameterValue("TEKUCISVOTA", DB.N20(RuntimeHelpers.GetObjectValue(this.tkSvota.Value))); string ziroRacun = string.Empty; DataRow[] rowArray = dataSet.KORISNIKLevel1.Select("vbdikorisnik = 1001005"); if (rowArray.Length > 0) { str = string.Format("{0} {1} {2}", Conversions.ToString(rowArray[0]["nazivziro"]), Conversions.ToString(rowArray[0]["ulicaziro"]), Conversions.ToString(rowArray[0]["mjestoziro"])); str2 = Conversions.ToString(rowArray[0]["zirokorisnik"]); ziroRacun = Conversions.ToString(rowArray[0]["VBDIKORISNIK"]) + Conversions.ToString(rowArray[0]["zirokorisnik"]); } else { str = ""; str2 = ""; } IBAN iban = new IBAN(); document.SetParameterValue("ziro", iban.GenerirajIBANIzBrojaRacuna(ziroRacun, false, true)); document.SetParameterValue("ministarstvo", str); document.SetParameterValue("HR1", uneHR1.Text); document.SetParameterValue("HR2", uneHR2.Text); document.SetParameterValue("Racun1", uneRacun1.Text); document.SetParameterValue("Racun2", uneRacun2.Text); item.Show(item.Workspaces["main"], info); }
private void Ispis() { string str = string.Empty; string str2 = string.Empty; SqlConnection connection = new SqlConnection { ConnectionString = Configuration.ConnectionString }; string cmdText = "SELECT mjesecobracuna, godinaobracuna FROM OBRACUN WHERE idobracun = @idobracun"; SqlCommand command = new SqlCommand(cmdText, connection); command.Parameters.Add("@idobracun", SqlDbType.VarChar).Value = RuntimeHelpers.GetObjectValue(this.sifraObracuna.Value); try { connection.Open(); SqlDataReader reader = command.ExecuteReader(); if (reader.Read()) { str2 = int.Parse(Conversions.ToString(DB.N20(RuntimeHelpers.GetObjectValue(reader.GetValue(0))))).ToString("00"); str = int.Parse(Conversions.ToString(DB.N20(RuntimeHelpers.GetObjectValue(reader.GetValue(1))))).ToString("0000"); } else { str2 = "00"; str = "0000"; } reader.Close(); } catch (System.Exception exception1) { throw exception1; //MessageBox.Show("Greška prilikom izrade izvješća!"); //return; } finally { connection.Close(); } this.SP_LISTA_IZNOSA_RADNIKADataSet1.Clear(); ReportDocument document = new ReportDocument(); if (this.radiobtnPapirUspravno.Checked) { document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptLIZaposlenikPolozeno.rpt"); } else { document.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\rptLIZaposlenik.rpt"); } SP_LISTA_IZNOSA_RADNIKADataAdapter adapter2 = new SP_LISTA_IZNOSA_RADNIKADataAdapter(); int sORT = 0; if (this.radiobtnSortiranjeSifra.Checked) { sORT = 0; } else { sORT = 1; } if (this.radiobtnObracun.Checked) { adapter2.Fill(this.SP_LISTA_IZNOSA_RADNIKADataSet1, Conversions.ToString(this.sifraObracuna.Value), null, null, sORT); ((TextObject)document.ReportDefinition.ReportObjects["txtNaslov"]).Text = Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject("IZNOSI ZAPOSLENIKA ZA: ", this.sifraObracuna.Value), " (MJESEC OBRAČUNA: "), str2), " / "), str), ")")); } document.SetDataSource(this.SP_LISTA_IZNOSA_RADNIKADataSet1); KORISNIKDataAdapter adapter = new KORISNIKDataAdapter(); KORISNIKDataSet dataSet = new KORISNIKDataSet(); adapter.Fill(dataSet); document.SetParameterValue("USTANOVA", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); document.SetParameterValue("ADRESA", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); document.SetParameterValue("ADRESA2", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KORISNIK1MJESTO"])); document.SetParameterValue("MB", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["MBKORISNIK"])); document.SetParameterValue("TELEFON", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KONTAKTTELEFON"])); document.SetParameterValue("FAX", RuntimeHelpers.GetObjectValue(dataSet.KORISNIK.Rows[0]["KONTAKTFAX"])); ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Lista iznosa zaposlenika", Description = "Pregled izvještaja - Lista iznosa zaposlenika", Icon = ImageResourcesNew.mbs }; ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = document; item.Show(item.Workspaces["main"], info); }
public void IspisMjestoTroska_Command(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - mjesto troška", Description = "Pregled izvještaja - mjesto troška" }; ReportDocument rpt = new ReportDocument(); UI.Izvjestaji.frmMjestoTroska objekt = new UI.Izvjestaji.frmMjestoTroska(); if (objekt.ShowDialog() == DialogResult.OK) { rpt.Load(System.Windows.Forms.Application.StartupPath + @"\MBSReport\rptMjestoTroska.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); try { ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = Mipsed7.Core.ApplicationDatabaseInformation.ServerName; connInfo.DatabaseName = Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName; connInfo.UserID = Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName; connInfo.Password = Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword; TableLogOnInfo tableLogOnInfo = new TableLogOnInfo(); tableLogOnInfo.ConnectionInfo = connInfo; foreach (Table table in rpt.Database.Tables) { table.ApplyLogOnInfo(tableLogOnInfo); table.LogOnInfo.ConnectionInfo.ServerName = connInfo.ServerName; table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName; table.LogOnInfo.ConnectionInfo.UserID = connInfo.UserID; table.LogOnInfo.ConnectionInfo.Password = connInfo.Password; } } catch (Exception exp) { MessageBox.Show(exp.Message); } using (BusinessLogic.OtvaranjeSkladista objekt2 = new BusinessLogic.OtvaranjeSkladista()) { KORISNIKDataSet set = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set); rpt.SetDataSource(objekt2.GetMjestoTroska(UI.Izvjestaji.frmMjestoTroska.datumOd, UI.Izvjestaji.frmMjestoTroska.datumDo, UI.Izvjestaji.frmMjestoTroska.skladiste, UI.Izvjestaji.frmMjestoTroska.mjestoTroska)); if (set.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); rpt.SetParameterValue("KontaktOsoba", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KONTAKTOSOBA"])); rpt.SetParameterValue("SkladisteNaziv", objekt2.GetSkladisteNaziv(UI.Izvjestaji.frmMjestoTroska.skladiste)); rpt.SetParameterValue("datumod", UI.Izvjestaji.frmMjestoTroska.datumOd.ToString("dd.MM.yyyy")); rpt.SetParameterValue("datumdo", UI.Izvjestaji.frmMjestoTroska.datumDo.ToString("dd.MM.yyyy")); } ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } } }
public void Ispis(object sender, EventArgs e) { if (ugdOdobrenje.ActiveRow != null) { ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\FinposIzvjestaji\Odobrenje.rpt"); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; Odobrenje.pID = (int)ugdOdobrenje.ActiveRow.Cells["ID"].Value; using (Odobrenje objekt = new Odobrenje()) { rpt.SetDataSource(objekt.GetOdobrenjeIspis()); KORISNIKDataSet set2 = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set2); if (set2.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("naziv", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("oib", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("adresa", RuntimeHelpers.GetObjectValue(set2.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); } // podesavanje loga na ispisu, ukoliko nije podesena lokacija za logo, gleda staru logiku Mipsed7.DataAccessLayer.SqlClient client = new Mipsed7.DataAccessLayer.SqlClient(); string putanja = client.ExecuteScalar("Select Top 1 Logo From Korisnik").ToString(); if (putanja.Length == 0) { try { rpt.SetParameterValue("logoPath", string.Empty); string logoPath = AppDomain.CurrentDomain.BaseDirectory + @"Resources\logo_135_135.jpg"; if (System.IO.File.Exists(logoPath)) { rpt.SetParameterValue("logoPath", logoPath); } } catch { } } else { rpt.SetParameterValue("logoPath", putanja); } ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.Controller.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.Controller.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Activate(); item.Show(item.Workspaces["main"]); } } }
public void ZakljucivanjeOtvaranje_Command(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Zaključivanje/otvaranje", Description = "Zaključivanje godine/otvaranje nove" }; ReportDocument rpt = new ReportDocument(); DateTime datumOd; rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpStanjeSkladista.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); try { ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = Mipsed7.Core.ApplicationDatabaseInformation.ServerName; connInfo.DatabaseName = Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName; connInfo.UserID = Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName; connInfo.Password = Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword; TableLogOnInfo tableLogOnInfo = new TableLogOnInfo(); tableLogOnInfo.ConnectionInfo = connInfo; foreach (Table table in rpt.Database.Tables) { table.ApplyLogOnInfo(tableLogOnInfo); table.LogOnInfo.ConnectionInfo.ServerName = connInfo.ServerName; table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName; table.LogOnInfo.ConnectionInfo.UserID = connInfo.UserID; table.LogOnInfo.ConnectionInfo.Password = connInfo.Password; } } catch (Exception exp) { MessageBox.Show(exp.Message); } UI.Izvjestaji.frmZakljucivanjeGodine objekt = new UI.Izvjestaji.frmZakljucivanjeGodine(); if (objekt.ShowDialog() == DialogResult.OK) { using (BusinessLogic.OtvaranjeSkladista objekt2 = new BusinessLogic.OtvaranjeSkladista()) { if (UI.Izvjestaji.frmStanjeSkladista.naDan != null) { //datumDo = UI.Izvjestaji.frmStanjeSkladista.naDan.Value; datumOd = UI.Izvjestaji.frmStanjeSkladista.naDan.Value; } else { //datumDo = UI.Izvjestaji.frmStanjeSkladista.razdobljeDatumDo.Value; datumOd = UI.Izvjestaji.frmStanjeSkladista.naDan.Value; } KORISNIKDataSet set = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set); rpt.SetDataSource(objekt2.GetStanjeSkladistaIspis(UI.Izvjestaji.frmStanjeSkladista.pSkladiste, UI.Izvjestaji.frmStanjeSkladista.pSort, datumOd)); if (set.KORISNIK.Rows.Count > 0) { rpt.SetParameterValue("NAZIV", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1NAZIV"])); rpt.SetParameterValue("OIB", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIKOIB"])); rpt.SetParameterValue("Adresa", RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1ADRESA"])); rpt.SetParameterValue("Datum", UI.Izvjestaji.frmStanjeSkladista.naDan.Value.ToString("yyyy-MM-dd")); } ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } } }
public void SaldoKartica_Command(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Saldo kartica", Description = "Pregled izvještaja - Saldo kartica" }; ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\Izvjestaji\crpSaldoKartica.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); try { ConnectionInfo connInfo = new ConnectionInfo(); connInfo.ServerName = Mipsed7.Core.ApplicationDatabaseInformation.ServerName; connInfo.DatabaseName = Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName; connInfo.UserID = Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName; connInfo.Password = Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword; TableLogOnInfo tableLogOnInfo = new TableLogOnInfo(); tableLogOnInfo.ConnectionInfo = connInfo; foreach (Table table in rpt.Database.Tables) { table.ApplyLogOnInfo(tableLogOnInfo); table.LogOnInfo.ConnectionInfo.ServerName = connInfo.ServerName; table.LogOnInfo.ConnectionInfo.DatabaseName = connInfo.DatabaseName; table.LogOnInfo.ConnectionInfo.UserID = connInfo.UserID; table.LogOnInfo.ConnectionInfo.Password = connInfo.Password; } } catch (Exception exp) { MessageBox.Show(exp.Message); } //dohvat i interakcija s formom UI.Izvjestaji.frmSaldoKartica objekt = new UI.Izvjestaji.frmSaldoKartica(); if (objekt.ShowDialog() == DialogResult.OK) { using (BusinessLogic.OtvaranjeSkladista objekt2 = new BusinessLogic.OtvaranjeSkladista()) { KORISNIKDataSet set = new KORISNIKDataSet(); new KORISNIKDataAdapter().Fill(set); //tu sad ide logika da se iskopaju proizvodi dostupni u skladištu na dan/u razdoblju DataTable dtSaldoKartice = objekt2.GetSaldoKartice(UI.Izvjestaji.frmSaldoKartica.DatumOd, UI.Izvjestaji.frmSaldoKartica.DatumDo, (int)UI.Izvjestaji.frmSaldoKartica.IdSkladista, UI.Izvjestaji.frmSaldoKartica.PProizvod); DataTable dtProizvodiZaSaldoKartice = objekt2.GetProizvodiSaldoKartice(UI.Izvjestaji.frmSaldoKartica.DatumOd, UI.Izvjestaji.frmSaldoKartica.DatumDo, (int)UI.Izvjestaji.frmSaldoKartica.IdSkladista); rpt.SetDataSource(objekt2.GetSaldoKartice(UI.Izvjestaji.frmSaldoKartica.DatumOd, UI.Izvjestaji.frmSaldoKartica.DatumDo, (int)UI.Izvjestaji.frmSaldoKartica.IdSkladista, UI.Izvjestaji.frmSaldoKartica.PProizvod)); rpt.Subreports[0].SetDataSource(objekt2.GetSaldoGrupe(UI.Izvjestaji.frmSaldoKartica.DatumOd, UI.Izvjestaji.frmSaldoKartica.DatumDo, (int)UI.Izvjestaji.frmSaldoKartica.IdSkladista)); if (set.KORISNIK.Rows.Count > 0) { string naziv = (RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1NAZIV"])).ToString(); string oib = (RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIKOIB"])).ToString(); string adresa = (RuntimeHelpers.GetObjectValue(set.KORISNIK.Rows[0]["KORISNIK1ADRESA"])).ToString(); int proizvod = (int)UI.Izvjestaji.frmSaldoKartica.PProizvod; DateTime dtOD = UI.Izvjestaji.frmSaldoKartica.DatumOd; DateTime dtDO = UI.Izvjestaji.frmSaldoKartica.DatumDo; int skladiste = (int)UI.Izvjestaji.frmSaldoKartica.IdSkladista; rpt.SetParameterValue("NAZIV", naziv); rpt.SetParameterValue("OIB", oib); rpt.SetParameterValue("Adresa", adresa); //parametri u reportu //rpt.SetParameterValue("ID", proizvod); //--> ovo ipak nece trebati jer se vec nakon odabira datuma i skladista filtriraju podaci iz baze rpt.SetParameterValue("DatOD", dtOD); rpt.SetParameterValue("DatDO", dtDO); rpt.SetParameterValue("IDSklad", skladiste); } ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } } }
public void IzvjestajiOtvoreneStavke(object sender, EventArgs e) { ExtendedWindowSmartPartInfo info = new ExtendedWindowSmartPartInfo { StartPosition = FormStartPosition.CenterParent, Modal = true, Title = "Pregled izvještaja - Otvorene stavke po razredima", Description = "Pregled izvještaja - Otvorene stavke po razredima" }; ReportDocument rpt = new ReportDocument(); rpt.Load(System.Windows.Forms.Application.StartupPath + @"\FinposIzvjestaji\rptOtvoreneStavkePoRazredima.rpt"); Mipsed7.DataAccessLayer.SqlClient conn = new Mipsed7.DataAccessLayer.SqlClient(); // Set connection string from config in existing LogonProperties rpt.DataSourceConnections[0].SetConnection(Mipsed7.Core.ApplicationDatabaseInformation.ServerName, Mipsed7.Core.ApplicationDatabaseInformation.DatabaseName, true); rpt.DataSourceConnections[0].SetLogon(Mipsed7.Core.ApplicationDatabaseInformation.SqlUserName, Mipsed7.Core.ApplicationDatabaseInformation.SqlPassword); rpt.DataSourceConnections[0].IntegratedSecurity = false; frmOtvoreneStavke otvorene_stavke = new frmOtvoreneStavke(); if (otvorene_stavke.ShowDialog() == DialogResult.OK) { DataTable dt = new DataTable("OtvoreneStavke"); SqlCommand sqlComm = new SqlCommand("sp_OtvoreneStavkePoRazredima", conn.sqlConnection); sqlComm.CommandType = CommandType.StoredProcedure; sqlComm.Parameters.AddWithValue("@RazdobljeDo", frmOtvoreneStavke.pDoDatuma); sqlComm.Parameters.AddWithValue("@IDRazredOdjeljenje", frmOtvoreneStavke.pRazred); sqlComm.Parameters.AddWithValue("@IDUstanova", frmOtvoreneStavke.pUstanova); sqlComm.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = sqlComm; da.Fill(dt); DataTable dt_filter = new DataTable(); if (dt.Rows.Count > 0) { try { dt_filter = dt.Select("Otvoreno <> 0").CopyToDataTable(); } catch {} } rpt.SetDataSource(dt_filter); rpt.SetParameterValue("@RazdobljeDo", frmOtvoreneStavke.pDoDatuma); rpt.SetParameterValue("@IDRazredOdjeljenje", frmOtvoreneStavke.pRazred); rpt.SetParameterValue("@IDUstanova", frmOtvoreneStavke.pUstanova); ExtendedWindowWorkspace workspace = new ExtendedWindowWorkspace(); PreviewReportWorkItem item = this.WorkItem.Items.Get <PreviewReportWorkItem>("Pregled"); if (item == null) { item = this.WorkItem.Items.AddNew <PreviewReportWorkItem>("Pregled"); } item.Izvjestaj = rpt; item.Show(item.Workspaces["main"], info); } }