Friday, 22 March 2019

Getting email parameters and email settings while export


Getting email parameters and email settings while export :


If print medium type is email when you are exporting data it will store data in to PrintJobSettings field which is container data type in PrintMgmtSettings table.
getting the data from below field you need to use  pass PrintJobSettings field value as a parameter for  srsPrintDestinationSettings.unpack(this.PrintJobSettings) class

SRSPrintDestinationSettings  class having all the email type settings


public void postLoad()
    {
        super();

        SRSPrintDestinationSettings srsPrintDestinationSettings = new SRSPrintDestinationSettings();
        srsPrintDestinationSettings.unpack(this.PrintJobSettings);
        if (srsPrintDestinationSettings.printMediumType() == SRSPrintMediumType::Email)
        {
            this.skipDataSourceValidateField(true);
            this.skipDataSourceValidateWrite(true);

            this.PrintMediumType     = SRSPrintMediumType::Email;
            //this.PrintMediumType   = srsPrintDestinationSettings.printMediumType();
            this.PrinterName         = srsPrintDestinationSettings.printerName();
            this.PrinterPageSettings = srsPrintDestinationSettings.printerPageSettings();
            this.landscape           = srsPrintDestinationSettings.landscape();
            this.Caption             = srsPrintDestinationSettings.caption();
            this.PrinterStatus       = srsPrintDestinationSettings.printerStatus();
            this.PrinterType         = srsPrintDestinationSettings.printerType();
            this.PrinterWhere        = srsPrintDestinationSettings.printerWhere();
            this.PrinterComment      = srsPrintDestinationSettings.printerComment();
            this.PrintAllPages       = srsPrintDestinationSettings.printAllPages();
            this.FromPage            = srsPrintDestinationSettings.fromPage();
            this.ToPage              = srsPrintDestinationSettings.toPage();
            //this.NumberOfCopies    = srsPrintDestinationSettings.numberOfCopies();
            this.EmailTo             = srsPrintDestinationSettings.emailTo();
            this.EmailCC             = srsPrintDestinationSettings.emailCc();
            this.EmailSubject        = srsPrintDestinationSettings.emailSubject();
            this.EmailAttachmentFileFormat      = srsPrintDestinationSettings.emailAttachmentFileFormat();
            this.EmailAttachmentImageFileFormat = srsPrintDestinationSettings.emailAttachmentImageFileFormat();
            this.FileName            = srsPrintDestinationSettings.fileName();
            this.FileFormat          = srsPrintDestinationSettings.fileFormat();
            this.ImageFileFormat     = srsPrintDestinationSettings.imageFileFormat();
            this.OverwriteFile       = srsPrintDestinationSettings.overwriteFile();
            //this.OrintToArchive      = srsPrintDestinationSettings.//conPeek(con,27);
            this.OverridePageSettings = srsPrintDestinationSettings.overridePageSettings();
            this.OverridePrintContractSettings = srsPrintDestinationSettings.overridePrintContractSettings();
            //this.OverwriteFileIsSet = srsPrintDestinationSettings.//conPeek(con,30);
            this.Collate             = srsPrintDestinationSettings.collate();
            this.Orientation         = srsPrintDestinationSettings.orientation();
            this.PrintOnBothSides    = srsPrintDestinationSettings.printOnBothSides();
            //this.SendToPrinterAsPdf  = srsPrintDestinationSettings.//conPeek(con,34);
           
            //container con1,con   = this.PrintJobSettings;
            //this.Obj1 = conPeek(con,1);//'fbhEmailBodyCustom';
            //this.Obj2 = conPeek(con,2);//srsPrintDestinationSettings.fbhEmailBody();
            //this.Obj3 = conPeek(con,3);
            //srsPrintDestinationSettings.printMedium().unpack(srsPrintDestinationSettings.printMedium());
            //con1 = conNull();
            //con1 = conPeek(con,4);
            //this.Obj41 = conPeek(con1,1);
            //this.Obj42 = conPeek(con1,2);
            //this.Obj43 = conPeek(con1,3);
            //this.Obj44 = conPeek(con1,4);
         
            PrintMgmtDocInstance docInstance;

            select firstonly docInstance
                where docInstance.RecId == this.ParentId;

            this.ReferencedRecId    = docInstance.ReferencedRecId;
            this.ReferencedTableId  = docInstance.ReferencedTableId;
            this.NodeType           = docInstance.NodeType;
            this.DocumentType       = docInstance.DocumentType;
            this.DocumentPriorityId = docInstance.PriorityId;

            if (this.ReportFormat)
            {
                PrintMgmtReportFormat reportFormat;
                select firstonly reportFormat
                    where reportFormat.RecId == this.ReportFormat;
                if (reportFormat.RecId)
                {
                    this.PRFCountryRegionId = reportFormat.CountryRegionId;
                    this.PRFDescription     = reportFormat.Description;
                    this.PRFDocumentType    = reportFormat.DocumentType;
                    this.PRFName            = reportFormat.Name;
                    this.PRFSystem          = reportFormat.System;
                }
            }
        }
       
    }

No comments:

Post a Comment