Показать сообщение отдельно
Старый 08.10.2009, 13:43   #11  
ivas is offline
ivas
Участник
Аватар для ivas
 
252 / 68 (3) ++++
Регистрация: 22.12.2005
Цитата:
Сообщение от koraman Посмотреть сообщение
Значит, решение только одно. Убедить, что отчёт выглядит гораздо красивее, когда он весь, включая титульник, имеет альбомную ориентацию.
Блин ну вы чего ваще?)
Я ж привел работающий код, который меняет ориентацию в fetch'е.

вот весь код метода
X++:
boolean  fetch()
{
    real                    checkedHeight, numOfLines;
    boolean                 firstRow;
    mapIterator             mapIterator = new mapIterator(chi_invFormatMap);
    CHI_InvoiceFormat       invoiceFormat;
    DictEnum                dictEnum    = new DictEnum(EnumNum(chi_invoiceFormat));
    PrintJobSettings        chi_printJobSettings;
    boolean                 pr; // Признак наличия услуг
    container               conPrintJobSettings;
    #define.designStandard("Standard")
    ;
    firstIteration = true;
    chi_printJobSettings = new PrintJobSettings(SalesFormLetter::getPrinterSettingsFormletter(DocumentStatus::Invoice));
    while (mapIterator.more())
    {
        invoiceFormat = mapIterator.key();
        if (invoiceFormat == CHI_Invoiceformat::LabelParcel)
            chi_printJobSettings.copies(1);
        else
            chi_printJobSettings.copies(2);
        if (firstIteration == false)
            element.reset();
        if (invoiceFormat == CHI_InvoiceFormat::InvoiceFacture ||
            invoiceFormat == CHI_InvoiceFormat::Torg12Akt)
        {
            element.design(#designStandard);
        }
        else
        {
            element.design(DictEnum.index2Symbol(invoiceFormat));
        }
        if (mapIterator.value() != conNull())
            conPrintJobSettings = mapIterator.value();
        else
            conPrintJobSettings = chi_printJobSettings.packPrintJobSettings();
        element.printJobSettings(conPrintJobSettings);
        TmpSalesPurchReportTable_RU_1 = headerData;
        firstRow = false;
        while select headerData
        {
            this.send(headerData);
            pr = false;
            converter = new RNumDateInWordConverter(headerData.LanguageId);
            element.design().languageID(headerData.LanguageId);
//            while (salesPurchReport.preSendReportHeader(headerData.RecId, headerData.LanguageId))
            {
                if (firstRow)
                    element.newPage();
                firstRow    = true;
                if (invoiceFormat == chi_invoiceFormat::Facture)
                    this.chi_printFacture();
                if (invoiceFormat == chi_invoiceFormat::Check)
                    this.chi_printCheck();
                if (invoiceFormat == chi_invoiceFormat::LabelParcel)
                    this.chi_printLabelParcel();
                if (invoiceFormat == chi_invoiceFormat::Akt)
                    this.chi_printAkt();
                if (invoiceFormat == chi_invoiceFormat::Torg12Akt ||
                    invoiceFormat == chi_invoiceFormat::Standard ||
                    invoiceFormat == chi_invoiceFormat::InvoiceFacture)
                {
                    this.initSections();
                    this.clearTotalsOnPage();
                    startPageNo = element.page();
                    if (invoiceFormat == chi_invoiceFormat::Torg12Akt)
                        this.chi_removeTotalsFromHeader();
                    numOfLines = headerData.LineNum;
                    element.execute(3); // PageHeader
                    element.execute(1); // Logo
                    element.execute(7); // Body header
                    while select dynamicData
                    order by LineNum
                    where dynamicData.InternalId    == headerData.InternalId
                    {
                        if (invoiceFormat == chi_invoiceFormat::Torg12Akt &&
                            dynamicData.CHI_ItemIsService == NoYes::Yes)
                        {
                            pr = true;
                            continue;
                        }
                        this.prepareDynamicSection();
                        if (dynamicData.LineNum <  numOfLines ||
                            dynamicData.LineNum == 1)
                        {
                            checkedHeight = sectionBody.heightValue()       +
                                            sectionFooter.heightValue()     +
                                            sectionPageHeader.heightValue();
                        }
                        else
                        {
                            checkedHeight = sectionBody.heightValue()       +
                                            sectionFooter.heightValue()     +
                                            sectionTotal.heightValue()      +
                                            sectionPageHeader.heightValue() +
                                            sectionEpilog.heightValue();
                        }
                        if ((pageHeight - this.currentYmm100()/100) < checkedHeight)
                        {
                            element.execute(14);// Footer
                            element.newPage();
                            element.execute(3); // PageHeader
                            element.execute(7); // SectionHeader
                            this.clearTotalsOnPage();
                        }
                        this.send(dynamicData);
                    }
                    this.send(headerData); //ivas bugfix
                    element.execute(13);// Total
                    element.execute(2); // Epilog
                    salesPurchReport.postSendReportHeader();
                    if (invoiceFormat == chi_invoiceFormat::Torg12Akt && pr == true)
                    {
                        element.design("Akt");
                        element.design("Akt").unpackPrintJobSettings(conPrintJobSettings);
                        element.newPage();
                        this.chi_printAkt();
                        element.design(#designStandard);
                    }
                    if (invoiceFormat == chi_invoiceFormat::InvoiceFacture)
                    {
                        element.design("Facture");
                        element.design("Facture").unpackPrintJobSettings(conPrintJobSettings);
                        element.design("Facture").orientation(2);
                        element.newPage();
                        this.chi_printFacture();
                        element.design(#designStandard);
                    }
                }
            }
            firstIteration = false;
        }
        mapIterator.next();
    }
    return true;
}
__________________
aLL woRk aNd nO JoY MAKes jAck a dULL Boy