Ejemplo n.º 1
0
        public void printReport3()
        {
            if (currentDataSet != null)
            {
                currentDataSet.AcceptChanges();

                string containsNull = validateRows(currentDataSet);

                if (containsNull != null)
                {
                    // don't categorizeRows without filling in info.
                    MessageBox.Show(form, "Check that the Company and Account fields in the highlighted row are accurate." , "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    form.highlightRow(containsNull);
                }
                else
                {
                    //TODO: What is this for?
                    //currentDataSet.Tables[0].Columns["Company"].DataType = Type.GetType("System.String");
                    //DataRow[] rowsCopy = new DataRow[currentDataSet.Tables[0].Rows.Count];
                    //currentDataSet.Tables[0].Rows.CopyTo(rowsCopy, 0);

                    // resolve Split transactions into their splits
                    DataSet tempDS = resolveSplits(currentDataSet);

                    //tempdataset =
                    //// create a temporary dataset
            //                    DataSetCollection dataSetArray = new DataSetCollection();

                    DataSetCollection dsColl = new DataSetCollection();
                    dsColl.Add(createAudit("Company", tempDS));
                    dsColl.Add(createAudit("Cardholder Name", tempDS));

                    //initDataSet(tempDataSet);

                    // create a viewer window, populate the data, and display it.
                    ReportPrinter rp = new ReportPrinter(this, dsColl, "Trillium_CC_Allocation.report3.xsl",
                        "Trillium_CC_Allocation.report3a.xsl", chartOfAccounts.Tables["Companies"], 3);
                    rp.ShowDialog(form);
                }
            }
            else
            {
                MessageBox.Show(form, "Combine XML files before trying to print.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Ejemplo n.º 2
0
        public void printDataGrid()
        {
            if (currentDataSet != null)
            {
                currentDataSet.AcceptChanges();

                string containsNull = validateRows(currentDataSet);

                if (containsNull != null)
                {
                    // Warn about empty rows
                    MessageBox.Show(form, "Not all Company and Account fields are accurate.\r\n\r\nCheck that the Company and Account fields in the \r\nhighlighted row are accurate before submitting."
                        , "Warning", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    form.highlightRow(containsNull);
                }

                DataSetCollection dsColl = new DataSetCollection();
                dsColl.Add(currentDataSet);

                // create a viewer window, populate the data, and display it.
                ReportPrinter rp = new ReportPrinter(this, dsColl, "Trillium_CC_Allocation.report1.xsl", null, 1);
                rp.ShowDialog(form);

            }
            else
            {
                MessageBox.Show(form, "Open a file before trying to print.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }