Пример #1
0
        private void bttStampa_Click(object sender, EventArgs e)
        {
            crpDocViaggi newReport = new crpDocViaggi();

            clsReport.InizializzaReport(newReport);
            //crClienti.RecordSelectionFormula = "id=0";

            //newReport.SetDataSource(((DataTable)(bindingSource1.DataSource)).Select("1=1", ""));

            DataTable dtSource = (DataTable)(bindingSource1.DataSource);

            if (dgvResult.SortedColumn == null)
            {
                newReport.SetDataSource(dtSource);
            }
            else
            {
                newReport.SetDataSource(dtSource.Select("1=1", dgvResult.SortedColumn.Name + (dgvResult.SortOrder == SortOrder.Ascending ? " asc" : " desc").ToString()).CopyToDataTable());
            }

            strFiltro = strFiltro.Trim();
            if (strFiltro == "")
            {
                strFiltro = " ";
            }

            clsReport.SetParamIntestazione(newReport, strFiltro);
            newReport.SetParameterValue("TipoDocumento", "Elenco Viaggi");
            clsReport.ShowReport(newReport);
        }
Пример #2
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            crpDocViaggi rpt = new crpDocViaggi();

            rpt.Site = this.Site;
            return(rpt);
        }