예제 #1
0
        /// <summary>
        /// Funzione per l'inizializzazione della pagina
        /// </summary>
        private void InitializeControls()
        {
            Response.Expires = -1;
            // Recupero anagrafica dei report
            try
            {
                this.ReportRegistry = CheckMailboxManager.GetReportRegistry(RequestPrintReport.ContextName);
                // DataBinding con la drop down list dei report
                this.DdlReportGenerator.DataSource = this.ReportRegistry;
                this.DdlReportGenerator.DataBind();
                this.ShowReportMetadata(this.ReportRegistry[0]);
                if (ReadOnlySubtitle)
                {
                    this.txtReportSubtitle.Enabled = false;
                }

                // visibilità GrdFields
                if (VisibleGrdFields != null)
                {
                    if (GrdFields != null && GrdFields.Rows.Count > 0)
                    {
                        this.GrdFields.Visible       = VisibleGrdFields;
                        this.lblFilterExport.Visible = VisibleGrdFields;
                    }
                    else
                    {
                        this.pnlFieldsSelection.Visible = false;
                    }
                }

                //Visibilità selezione formati export
                //PDF
                if (!ActiveExportFormatPDF)
                {
                    ddlExportFormat.Items.RemoveAt(0);
                }
                //EXCEL
                if (!ActiveExportFormatExcel)
                {
                    ddlExportFormat.Items.RemoveAt(1);
                }
                //ODS
                if (!ActiveExportFormatODS)
                {
                    ddlExportFormat.Items.RemoveAt(2);
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "ajaxDialogModal", "parent.parent.ajaxDialogModal('ErrorReportGeneratorExtractInfo', 'error', '');", true);
                return;
            }
        }
예제 #2
0
        private int creaGrigioDaReport(bool trasmDoc)
        {
            string     language = UIManager.UserManager.GetUserLanguage();
            InfoUtente userInfo = UserManager.GetInfoUser();
            Ruolo      ruolo    = RoleManager.GetRoleInSession();

            PrintReportRequestDataset request =
                new PrintReportRequestDataset()
            {
                ContextName   = "CasellaIstituzionale",
                ReportType    = ReportTypeEnum.PDF,
                ReportKey     = "RicercaCasellaIstituzionale",
                Title         = Utils.Languages.GetLabelFromCode("CheckMailboxReportLblIstitutionalBox", language),
                SubTitle      = String.Format(Utils.Languages.GetLabelFromCode("ReportGeneratorTbwSubtitle", language), MailCheckResponse.DtaConcluded.ToShortDateString(), MailCheckResponse.DtaConcluded.ToShortTimeString()),
                SearchFilters = null,
                UserInfo      = userInfo,
                InputDataset  = reportDataSetDocGrigio
            };

            RequestPrintReport  = request;
            this.ReportRegistry = CheckMailboxManager.GetReportRegistry(RequestPrintReport.ContextName);
            RequestPrintReport.ColumnsToExport = this.ReportRegistry.Where(r => r.ReportKey == request.ReportKey).First().ExportableFields;

            FileDocumento fd = CheckMailboxManager.GenerateReport(request);

            int retValue = 0;

            try
            {
                DocsPaWR.SchedaDocumento scheda = new SchedaDocumento();
                DocsPaWR.Oggetto         ogg    = new Oggetto();
                DocsPaWR.FileRequest     fr     = null;
                //Report Casella Istituzional del RF: codice/descrizione

                ogg.descrizione  = String.Format("Report Casella Istituzionale {0} del {1} alle {2}", this.txtRegistro.Text, MailCheckResponse.DtaConcluded.ToShortDateString(), MailCheckResponse.DtaConcluded.ToShortTimeString());
                scheda.oggetto   = ogg;
                scheda.personale = "0";
                scheda.privato   = "0";
                scheda.userId    = UserManager.GetInfoUser().userId;
                scheda.typeId    = "LETTERA";
                scheda.tipoProto = "G";
                scheda.appId     = "ACROBAT";
                scheda.idPeople  = UserManager.GetInfoUser().idPeople;
                scheda           = CheckMailboxManager.DocumentoAddDocGrigia(scheda, UserManager.GetInfoUser(), RoleManager.GetRoleInSession());
                fr           = (FileRequest)scheda.documenti[0];
                fr.docNumber = scheda.docNumber;
                fr           = CheckMailboxManager.DocumentoPutFile(fr, fd, UserManager.GetInfoUser());
                if (fr != null)
                {
                    retValue = 1;
                }
                //disabilito il pulsante di creazione doc grigio
                this.CheckMailboxReportCreateDoc.Enabled = false;
                if (trasmDoc)
                {
                    CreateAndTrasmDoc(scheda, userInfo, ruolo);
                }
            }
            catch (Exception ex) { retValue = 0; }
            return(retValue);
        }