Exemplo n.º 1
0
        private void btnShowAllRP_Click(object sender, EventArgs e)
        {
            initFields();

            if (type == "natural")
            {
                reportViewer1.Reset();
                reportViewer1.LocalReport.ReportEmbeddedResource =
                    "OboronEnergoProject.Natural.rdlc";
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rdts1);
                DataTable1TableAdapter.FillAllNatural(DataSet1.DataTable1, dtFrom,
                                                      dtTo);
                reportViewer1.RefreshReport();
            }
            else if (type == "legal")
            {
                reportViewer1.Reset();
                reportViewer1.LocalReport.ReportEmbeddedResource =
                    "OboronEnergoProject.Legal.rdlc";
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rdts1);
                DataTable1TableAdapter.FillAllLegal(DataSet1.DataTable1, dtFrom,
                                                    dtTo);
                reportViewer1.RefreshReport();
            }
        }
Exemplo n.º 2
0
        private void FormReportPrepSummary_Load(object sender, EventArgs e)
        {
            DataTable1TableAdapter.Fill(this.DSPrepSummary.DataTable1, mAssignmentId);

            reportViewerPrepSummary.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.FullPage;
            reportViewerPrepSummary.RefreshReport();
        }
Exemplo n.º 3
0
        private void btnCreateReport_Click(object sender, EventArgs e)
        {
            initFields();

            if (type == "natural")
            {
                reportViewer1.Reset();
                reportViewer1.LocalReport.ReportEmbeddedResource =
                    "OboronEnergoProject.Natural.rdlc";
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rdts1);
                DataTable1TableAdapter.FillNatural(DataSet1.DataTable1, type, dtFrom,
                                                   dtTo, clientsId, surname, name, middleName);
                reportViewer1.RefreshReport();
            }
            else if (type == "legal")
            {
                reportViewer1.Reset();
                reportViewer1.LocalReport.ReportEmbeddedResource =
                    "OboronEnergoProject.Legal.rdlc";
                reportViewer1.LocalReport.DataSources.Clear();
                reportViewer1.LocalReport.DataSources.Add(rdts1);

                DataTable1TableAdapter.FillLegal(DataSet1.DataTable1, type, dtFrom,
                                                 dtTo, clientsId, company_name);
                reportViewer1.RefreshReport();
            }
        }
Exemplo n.º 4
0
 private void button1_Click_1(object sender, EventArgs e)
 {
     DataTable1TableAdapter.resumenEmpleados(datosVeterinaria.DataTable1);
     veterinariosTableAdapter.todosVeterinatios(datosVeterinaria.veterinarios);
     this.reportViewer1.RefreshReport();
     txtFiltrarMatricula.Clear();
 }
Exemplo n.º 5
0
 //Constructor encargado de inicializar los adapter
 public ControladoraBDCuentas()
 {
     adapterCuenta_Perfil = new Cuenta_PerfilTableAdapter();
     adapterCuentas       = new CuentaTableAdapter();
     adapterBecario       = new BecarioTableAdapter();
     adapterEncargado     = new EncargadoTableAdapter();
     adapterNombreCuenta  = new DataTable1TableAdapter();
     adapterAsignaciones  = new AsignadoA1TableAdapter();
 }
        private void btnCreateVersion_Click(object sender, EventArgs e)
        {
            if (mAssignment.WorkflowStatusId != WorkflowStatus.Complete)
            {
                MessageBox.Show("Order must be saved as complete first");
                return;
            }

            int newVersion = mAssignment.AnalysisReportVersion + 1;

            if (mAssignment.AnalysisReportVersion > 0)
            {
                FormReportAuditComment form = new FormReportAuditComment();
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                mAssignment.AuditComment += "v." + newVersion + ": " + form.SelectedComment + Environment.NewLine;
            }

            SqlConnection conn = null;

            try
            {
                conn = DB.OpenConnection();
                mAssignment.AnalysisReportVersion = newVersion;
                mAssignment.Dirty = true;
                mAssignment.StoreToDB(conn, null);

                DataTable1TableAdapter.Fill(DSOrderReport.DataTable1, mAssignment.Name);
                DataTable2TableAdapter.Fill(DSOrderReport.DataTable2, mAssignment.Name);

                reportViewer.LocalReport.DataSources.Clear();
                ReportDataSource rd1 = new ReportDataSource("DataSet1", DSOrderReport.Tables[0]);
                ReportDataSource rd2 = new ReportDataSource("DataSet2", DSOrderReport.Tables[1]);
                reportViewer.LocalReport.DataSources.Add(rd1);
                reportViewer.LocalReport.DataSources.Add(rd2);
                reportViewer.LocalReport.Refresh();
                reportViewer.RefreshReport();

                mContent = reportViewer.LocalReport.Render("PDF", "");

                mHasNewVersion           = true;
                btnCreateVersion.Enabled = false;
            }
            catch (Exception ex)
            {
                Common.Log.Error(ex);
                MessageBox.Show(ex.Message);
            }
            finally
            {
                conn?.Close();
            }
        }
Exemplo n.º 7
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            Report2  rep = new Report2();
            DataSet1 ds  = new DataSet1();

            DataTable1TableAdapter ct = new DataTable1TableAdapter();

            ct.Fill(ds.DataTable1);
            rep.SetDataSource(ds);
            rep.SetParameterValue("value", comboBox1.SelectedItem.ToString());
            crystalReportViewer1.ReportSource = rep;
        }
        private void FormReportViewer_Load(object sender, EventArgs e)
        {
            DataTable1TableAdapter.Fill(DSOrderReport.DataTable1, mAssignment.Name);
            DataTable2TableAdapter.Fill(DSOrderReport.DataTable2, mAssignment.Name);

            reportViewer.LocalReport.DataSources.Clear();
            ReportDataSource rd1 = new ReportDataSource("DataSet1", DSOrderReport.Tables[0]);
            ReportDataSource rd2 = new ReportDataSource("DataSet2", DSOrderReport.Tables[1]);

            reportViewer.LocalReport.DataSources.Add(rd1);
            reportViewer.LocalReport.DataSources.Add(rd2);
            reportViewer.LocalReport.Refresh();
            reportViewer.RefreshReport();
        }
Exemplo n.º 9
0
        private void btnCreateVersion_Click(object sender, EventArgs e)
        {
            int newVersion = mAssignment.AnalysisReportVersion + 1;

            if (mAssignment.AnalysisReportVersion > 0)
            {
                FormReportAuditComment form = new FormReportAuditComment();
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                mAssignment.AuditComment += "v." + newVersion + ": " + form.SelectedComment + Environment.NewLine;
            }

            SqlConnection conn = null;

            try
            {
                conn = DB.OpenConnection();
                mAssignment.AnalysisReportVersion = newVersion;
                mAssignment.Dirty = true;
                mAssignment.StoreToDB(conn, null);
            }
            catch (Exception ex)
            {
                Common.Log.Error(ex);
                MessageBox.Show(ex.Message);
                return;
            }
            finally
            {
                conn?.Close();
            }

            DataTable1TableAdapter.Fill(DSOrderReport.DataTable1, mAssignment.Name);
            reportViewer.RefreshReport();

            mContent = reportViewer.LocalReport.Render("PDF", "");

            mHasNewVersion           = true;
            btnCreateVersion.Enabled = false;
        }
Exemplo n.º 10
0
        private void FormReportViewer_Load(object sender, EventArgs e)
        {
            DataTable1TableAdapter.Fill(DSOrderReport.DataTable1, mAssignment.Name);

            reportViewer.RefreshReport();
        }
Exemplo n.º 11
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                DialogResult result = openFileDialog1.ShowDialog(); // Atver dialogu, kur var izvēlēties failu
                if (result == DialogResult.OK)                      //Lai nospiežot cancel programma nenosprāgtu
                {
                    string file = openFileDialog1.FileName;         //Saglabā faila atrašanās vietu
                    failasaturs = File.ReadAllText(file);           // Simbolu virknē failasaturs saglabā visu faila tekstu
                }

                myConnection = new SqlConnection();
                myConnection.ConnectionString = failasaturs; //Data Source=USER;initial catalog=md2;Integrated Security = True
                myConnection.Open();

                DataTable1TableAdapter.Connection = myConnection; //Norādu, ka jāizmanto myConnection, nevis tas, kas saglabāts pie Properties->Connection
                DataTable1TableAdapter.Fill(DataSet1.DataTable1); //Aizpildu DataSetā tabulu DataTable

                reportViewer1.RefreshReport();
                myConnection.Close();
            }
            catch (FileNotFoundException)
            {
                MessageBox.Show("File not found", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            catch (InvalidOperationException)
            {
                MessageBox.Show("Cannot open a connection without specifying a data source or server", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            catch (SqlException ex)
            {
                if (ex.Number == 53)
                {
                    MessageBox.Show("Error: " + ex.Number.ToString() + "\nAn error has occurred while establishing a connection to the server.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (ex.Number == -2)
                {
                    MessageBox.Show("Error: " + ex.Number.ToString() + "\nTimeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (ex.Number == 17)
                {
                    MessageBox.Show("Error:" + ex.Number.ToString() + "\nInvalid server name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (ex.Number == 4060)
                {
                    MessageBox.Show("Error: " + ex.Number.ToString() + "\nInvalid database name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else if (ex.Number == 18456)
                {
                    MessageBox.Show("Error: " + ex.Number.ToString() + "\nInvalid user name or password", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show("Error: " + ex.Number.ToString() + "\n" + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Some error occurred: " + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Exemplo n.º 12
0
        void loaddata()
        {
            DataTable1TableAdapter a = new DataTable1TableAdapter();

            dataGridViewX1.DataSource = a.GetData();
        }
Exemplo n.º 13
0
 private void ReporteVeterinarios_Load(object sender, EventArgs e)
 {
     DataTable1TableAdapter.resumenEmpleados(datosVeterinaria.DataTable1);
     veterinariosTableAdapter.todosVeterinatios(datosVeterinaria.veterinarios);
     this.reportViewer1.RefreshReport();
 }