zoukankan      html  css  js  c++  java
  • How to resolve DynamicHeight problem in Morphx report[X++]

    For set dynamic height for controls in report

    on executeSection method:

    method 01

        real                        maxHeight;
        str                         maxStrValue = this.maxStrControlName();
        ReportStringControl         maxStrControl = element.design().controlName("maxStrControlName");
    ;
        maxHeight= maxStrControl.heightOfWordWrappedString100mm(maxStrValue);
    
        if (maxHeight!= maxStrControl.height100mm())         
        {
            maxStrControl.height100mm(maxHeight);
        }


    or same in char:

    method 02

        int    maxHeightChar;
    ;  
    
        maxHeightChar = maxStrControl.widthOfString100mm(maxStrValue) / maxStrControl.width100mm() + 1;     
    
        maxStrControl.height(maxHeightChar , Units::CHAR);

    for example

    public void executeSection()
    {
        //CUS Changed on 09 Oct 2013 at 12:28:55 by Jimmy Xie TECTURA LL000260 Begin
        ReportStringControl maxStrControl = element.design().controlName("commodityNo");
        str                 maxStrValue = this.commodityNo();
        int                 maxHeight = maxStrControl.widthOfString100mm(maxStrValue) / maxStrControl.width100mm() + 2;
    ;
        /* method 1
        maxHeight = maxStrControl.heightOfWordWrappedString100mm(maxStrValue);
        if (maxHeight != maxStrControl.height100mm())
            maxStrControl.height100mm(maxHeight);
        */
    
        //commodityNo.height(maxHeight, Units::char);
        // method 2
        LineNumStr.height(maxHeight, Units::char);
        ItemName.height(maxHeight, Units::char);
        QtyStr.height(maxHeight, Units::char);
        SalesPriceStr.height(maxHeight, Units::char);
        netSalesPriceStr.height(maxHeight, Units::char);
        amountStr.height(maxHeight, Units::char);
        //CUS Changed on 09 Oct 2013 at 12:28:55 by Jimmy Xie TECTURA LL000260 End
    
        serialNumber++;
        super();
        totalTaxValue  += CustInvoiceTrans.lineAmountInclTax();//TaxAmount;
        totalQty       += CustInvoiceTrans.Qty;
    }
  • 相关阅读:
    Entity Framework 学习初级篇7基本操作:增加、更新、删除、事务
    Flash Lite基础知识
    instantclient_10_2客户端配置
    Flash Player9.0 跟Flash Player8.0区别
    Adobe Flash Lite3
    flashlite3无法接入网络的解决办法
    sendAndLoad(LoadVars.sendAndLoad 方法)
    乐高模式
    FMS应用实例 从FMS服务器读取文件(图片/SWF/文本)到客户端
    as2.0 fscommand的用法
  • 原文地址:https://www.cnblogs.com/Fandyx/p/3358926.html
Copyright © 2011-2022 走看看