InDesign Table Fit (Clear overflow, Height and Row fit)

Hi All,
I am using MagicFit.jsx for fit the table. But it does not clear the overflow and it does not fit the Height. I want to do all of this.
Plz suggest.
MagicFit.jsx
function MagicFit(){
    app.scriptPreferences.version = 4.0;          //Because I am using CS5
    MagicFit_1()
    app.scriptPreferences.version = 6.0;
function MagicFit_1(){
        MagicFit 2.1b for InDesign CS / CS2 -- 01/18/06               
        Fits to content the WIDTH of the selected text container(s)   
        Features:                                                     
        - Fits selected TextFrame(s) width to content                 
        - 1st call: "strict" fitting (preserve each lines length)    
        - 2nd call (within 2 secs) : "fluid" fitting (preserve height)
        - (NEW) Alternate fitting of table column(s) if selected      
        - (NEW) Compute a minimal width by parsing embedded objects   
        - (NEW) Runs on selected frames, CELLS, groups, insertion pt  
        Installation & usage:                                         
        0) !! CS2 users only !!                                       
           Rename this script file with .jsx extension                
           (activating extend script features)                        
        1) Put the present file into the Presets/Scripts/ subdir      
        2) Run InDesign, open a document and select object(s) to fit  
           (or put insertion point into)                              
        3) Run the script via Window > Automation > Scripts           
           and double-clic on MagicFit.js                             
           Alternate way: assign a keyboard shortcut to the script via
           Edit > Keyboard Shortcuts... > Product area:"Scripts"      
        Help (FR) : http://marcautret.free.fr/geek/indd/magicfit/     
            (sorry, thats a french web page!)                      
                Feedbacks : [email protected]                    
    //            SETTINGS
    var LATENCE = 2;         // in seconds (default:2)
    var PRECISION = 0.5;    // in pts (default:0.5)
    var APP_INT_VERSION = parseInt(app.version);
    //            TOOLBOX FUNCTIONS
    /*void*/ function exitMessage(/*exception*/ ex){
        alert("Error:\n" + ex.toString());
        exit();
    //            DOCUMENT METHODS
    /*void*/ Document.prototype.setUnitsTo = function(/*units*/ newUnits){        // units can be single value (horiz=vert) or array(horizUnits, vertUnits)
        var arrUnits = (newUnits.length) ? newUnits : new Array(newUnits,newUnits);
        this.viewPreferences.horizontalMeasurementUnits = arrUnits[0];
        this.viewPreferences.verticalMeasurementUnits = arrUnits[1];
    /*arr2*/ Document.prototype.getUnits = function(){
        return(Array(
            this.viewPreferences.horizontalMeasurementUnits,
            this.viewPreferences.verticalMeasurementUnits));
    /*bool*/ Document.prototype.withinDelay = function(){
        if (this.label)
            return( (Date.parse(Date())-this.label) <= LATENCE*1000 );
        return(false);
    /*void*/ Document.prototype.storeTimeStamp = function(){
        this.label = Date.parse(Date()).toString();
    //            GENERIC METHODS (OBJECT LEVEL)
    // Returns the "fittable-container" corresponding to THIS
    // Return array or collection HorizFit-compliant
    // NULL if failure
    /*arr*/ Object.prototype.asObjsToFit = function(){
        switch(this.constructor.name){
            case "TextFrame" :            // textframe -> singleton this
                return(Array(this));
            case "Cell" :                // cells -> parent columns
                var r = new Array();
                // !! [CS1] Cell::parentColumn === Cell !!
                // !! [CS2] Cell::parentColumn === Column !!
                // !! [CS2] Cells::lastItem().parentColumn BUG !!
                var c0 = this.cells.firstItem().name.split(":")[0];
                var c1 = this.cells.lastItem().name.split(":")[0];
                for (var i=c0 ; i<=c1; i++)
                    r.push(this.parent.columns[i]);
                return(r);
            case "Table" /*CS2*/ :        // table -> columns
                return(this.columns);
            case "Group" :                // group -> textFrames
                return((this.textFrames.length>0) ? this.textFrames : null);
            case "Text" :                // selection is Text or InsertionPoint
            case "InsertionPoint" :        // -> run on container
                var textContainer = this.getTextContainer();
                return((textContainer) ? textContainer.asObjsToFit() : null);
            default:
                return(null);
    // Returns Text's or InsertionPoint's container :
    // Type returned: TextFrame or Cell - NULL if failure
    /*obj*/ Object.prototype.getTextContainer = function(){
        try{ // try...catch because of CS2 behaviour
            if (this.parent.constructor.name == "Cell")           
                return(this.parent);
            if (this.parentTextFrames)        // plural in CS2
                return(this.parentTextFrames[0]);       
            if (this.parentTextFrame)    // single in CS1
                return(this.parentTextFrame);
            return(null);
        }catch(ex) {return(null);}
    // Parse embedded "objects": tables, pageitems [including graphics]
    // and returns the max width
    // !! All parsed objects have to provide a computeWidth method !!
    /*int*/ Object.prototype.computeIncludedObjectsWidth = function(){
        var objsNames = new Array("pageItems","tables"); // could be extended
        var objsWidth = 0;
        var w = 0;
        for (var j=objsNames.length-1 ; j>=0 ; j--){
            for (var i=this[objsNames[j]].length-1 ; i>=0 ; i--){
                try{
                    w = this[objsNames[j]][i].computeWidth({VISIBLE:true});
                }catch(ex){
                    w=0;
                if (w > objsWidth) objsWidth=w;
        return(objsWidth);
    // Generic computeWidth method for bounded objects
    // VISIBLE true -> external width
    // VISIBLE false -> internal width
    /*int*/ Object.prototype.computeWidth = function(/*bool*/ VISIBLE){
        if (VISIBLE){
            if (this.visibleBounds)
                return(this.visibleBounds[3]-this.visibleBounds[1]);
        else{
            if (this.geometricBounds)
                return(this.geometricBounds[3]-this.geometricBounds[1]);
        return(0);
    // Override Object::computeWidth for Table : returns simply the width
    /*int*/ Table.prototype.computeWidth = function(){
        return(this.width);
    // Returns chars count for each LINE of this (-> array)
    // empty array  IF  this.lines==NULL  OR  this.lines.length==0
    /*arr*/ Object.prototype.createLinesSizesArray = function(){
        r = new Array();
        if (this.lines)
            for (var i=this.lines.length-1; i>=0 ; i--)
                r.unshift(this.lines[i].characters.length);
        return(r);
    // Compare chars count beetween THIS and arrSizes argument
    // (generic method just presuming that THIS have lines prop.)
    // -> TRUE if isoceles, FALSE if not
    /*bool*/ Object.prototype.isoceleLines = function(/*arr*/ arrSizes){
        if (this.lines.length != arrSizes.length) return(false);
        for (var i=arrSizes.length-1 ; i>=0 ; i--)
            if (arrSizes[i] != this.lines[i].characters.length)
                return(false);
        return(true);
    //            TEXTFRAME METHODS
    // intanciate the part of the abstract process for TextFrames
    /*bool*/ TextFrame.prototype.isEmpty = function(){
        return(this.characters.length==0);
    /*bool*/ TextFrame.prototype.isOverflowed = function(){
        return(this.overflows);
    /*int*/ TextFrame.prototype.getWidth = function(){
        return(this.computeWidth({VISIBLE:false}));
    // Redim the frame in width by widthOffset
    /*void*/ TextFrame.prototype.resizeWidthBy = function(/*int*/ widthOffset){
        this.geometricBounds = Array(
            this.geometricBounds[0],
            this.geometricBounds[1],
            this.geometricBounds[2],
            this.geometricBounds[3] + widthOffset);
    // Returns the minWidth of the frame according to embedded content
    // and inner space
    // inner width space
    /*int*/ TextFrame.prototype.computeMinWidth = function(){
        var inSpace = this.textFramePreferences.insetSpacing;
        var inWidth = (inSpace.length) ?
            inSpace[1] + inSpace[3] :    // distinct left & right inspace
            2*inSpace;                    // global inspace
        return(this.computeIncludedObjectsWidth() + inWidth);
    /*int*/ TextFrame.prototype.getCharsCount = function(){
        return(this.characters.length);
    /*int*/ TextFrame.prototype.getLinesCount = function(){
        return(this.lines.length);
    // Return chars count BY LINE (-> array)
    /*arr*/ TextFrame.prototype.getLinesSizes = function(){
        return(this.createLinesSizesArray());
    // YES -> -1  , NOT -> 1
    /*int*/ TextFrame.prototype.preserveCharsCount = function(/*int*/ charsCount){
        return( (this.characters.length != charsCount) ? 1 : -1 );
    // Indicates whether:
    // - chars count equals linesCount
    // - frame DOES NOT overflow
    // YES -> -1  , NOT -> 1
    /*int*/ TextFrame.prototype.preserveLinesCount = function(/*int*/ linesCount){
        return( ((this.overflows) || (this.lines.length != linesCount)) ? 1 : -1 );
    // Indicates whether:
    // each x line isoceles linesSizes[x]
    // YES -> -1  , NOT -> 1
    /*int*/ TextFrame.prototype.preserveLinesSizes = function(/*arr*/ linesSizes){
        return( (this.isoceleLines(linesSizes)) ? -1 : 1 );
    //            COLUMN METHODS
    // intanciate the part of the abstract process for Columns
    /*bool*/ Column.prototype.isEmpty = function(){
        for (var i=this.cells.length-1; i>=0 ; i--)
            if (this.cells[i].characters.length>0) return(false);
        return(true);
    // Indicates whether AT LEAST a cell overflows
    // !! We can't trust Column::overflows !!
    /*bool*/ Column.prototype.isOverflowed = function(){
        for (var i=this.cells.length-1 ; i>= 0 ; i--)
            if (this.cells[i].overflows) return(true);
        return(false);
    /*int*/    Column.prototype.getWidth = function(){
        return(this.width);
    // Redim the column width by widthOffset
    // !! we HAVE TO update the display after resizing !!
    /*void*/ Column.prototype.resizeWidthBy = function(/*int*/ widthOffset){
        this.width += widthOffset;
        // updates the display
        if (APP_INT_VERSION > 3)        // CS2+
            this.recompose();
        else{
            // CS -- thx to Tilo for this hack --
            for(var i = this.cells.length - 1 ; i >= 0 ; i-- ){
                // Comparing the cell contents against null
                // seems to internally recompose the cell!
                if (this.cells[i].contents == null) {}
    // Returns the minWidth of the column according to embedded content
    // and inner space
    /*int*/ Column.prototype.computeMinWidth = function(){
        var iCell = null;
        var w = 0;
        var r = 0;
        for (var i=this.cells.length-1 ; i>= 0 ; i--){
            iCell = this.cells[i];
            w = iCell.computeIncludedObjectsWidth() +
                iCell.leftInset + iCell.rightInset;
            if (w > r) r = w;
        return(r);
    // Returns SIGNED chars count BY CELL (negatif if overflows)
    /*arr*/ Column.prototype.getCharsCount = function(){
        var r = new Array();
        var sgn = 0;
        for (var i=this.cells.length-1 ; i>= 0 ; i--){
            sgn = (this.cells[i].overflows) ? -1 : 1;
            r.unshift(sgn * this.cells[i].characters.length);
        return(r);
    // Returns lines count BY CELL
    /*arr*/ Column.prototype.getLinesCount = function(){
        var r = new Array();
        for (var i=this.cells.length-1 ; i>= 0 ; i--)
            r.unshift(this.cells[i].lines.length);
        return(r);
    // Matrix: returns the chars count BY LINE / BY CELL
    /*bi-arr*/ Column.prototype.getLinesSizes = function(){
        var r = new Array();
        for (var i=this.cells.length-1 ; i>= 0 ; i--)
                r.unshift(this.cells[i].createLinesSizesArray());
        return(r);
    // Indicates whether:
    // overflow sign BY CELL x equals sgn(charsCount[x])
    // YES -> -1  , NO -> 1
    /*int*/ Column.prototype.preserveCharsCount = function(/*arr*/ charsCount){
        var sgn = 0;
        for (var i=this.cells.length-1 ; i>= 0 ; i--){
            sgn = (this.cells[i].overflows) ? -1 : 1;
            if (sgn * charsCount[i] < 0) return(1);
        return(-1);
    // Indicates whether:
    // - lines count BY CELL x equals linesCount[x]
    // - no cell overflows
    // YES -> -1  , NO -> 1
    /*int*/ Column.prototype.preserveLinesCount = function(/*arr*/ linesCount){
        for (var i=this.cells.length-1 ; i>= 0 ; i--){
            if (this.cells[i].overflows) return(1);
            if (this.cells[i].lines.length != linesCount[i]) return(1);
        return(-1);
    // Indicates whether:
    // - in each CELL x, each LIGNE y isoceles linesSizes[x][y]
    // (if a cell overflows, returns 1)
    // YES -> -1  , NO -> 1
    /*int*/ Column.prototype.preserveLinesSizes = function(/*bi-arr*/ linesSizes){
        for (var i=this.cells.length-1 ; i>= 0 ; i--){
            if (this.cells[i].overflows) return(1);
            if (this.cells[i].isoceleLines(linesSizes[i]) == false) return(1);
        return(-1);
    //            METHODES CENTRALES
    // !! [CS2 only] Prevents a strange crash on wide table columns selection !!
    // !! Thx to Tilo for this hack --
    /*void*/ Object.prototype.manageFit = function(/*bool*/ FLUIDFITTING){
        if (APP_INT_VERSION>=4){
            $.gc();
        // NOP if empty object
        if (this.isEmpty()) return;
        // min width to preserve
        var minWidth = this.computeMinWidth();
        // let's go!
        this.processFit(FLUIDFITTING, minWidth);
    // Fits this object
    // if FLUIDFITTING -> fluid fitting, else: strict fitting
    // minWidth sets the threshold
    /*void*/ Object.prototype.processFit = function(/*bool*/ FLUIDFITTING, /*int*/ minWidth){
        if (FLUIDFITTING){ // FLUID FITTING
            if (this.isOverflowed()){ // NB : overflowed CELLS are "transparent"
                var charsCount = this.getCharsCount();
                var evalFlag = function(thisObj){return(thisObj.preserveCharsCount(charsCount));}
            else{
                var linesCount = this.getLinesCount();
                evalFlag = function(thisObj){return(thisObj.preserveLinesCount(linesCount));}
        else{ // STRICT FITTING
              // NB : overflowed columns are "intouchable"
            if ((this.constructor.name=="Column") && (this.isOverflowed()))
                return;
            var linesSizes = this.getLinesSizes();
            var evalFlag = function(thisObj){return(thisObj.preserveLinesSizes(linesSizes));}
        // DICHOTOMIC LOOP
        var sgnFLAG = -1;
        var w = ( this.getWidth() - minWidth ) / 2;
        while (w >= PRECISION){
            // resize width by +/- w
            this.resizeWidthBy(sgnFLAG*w);
            // +1 = increase | -1 = reduce
            sgnFLAG = evalFlag(this);
            // divide
            w = w/2;
        // exit with sgnFLAG==+1 -> undo last reduction -> +2w
        if (sgnFLAG>0) this.resizeWidthBy(2*w);
    // MAIN PROGRAM
    if ( app.documents.length > 0 ){
        if ( app.activeWindow.selection.length > 0 ){
            try{
                var thisDoc = app.activeDocument;
                var FLUIDFLAG = thisDoc.withinDelay();
                var memUnits = thisDoc.getUnits();
                thisDoc.setUnitsTo(MeasurementUnits.points);
                var selObjs = app.activeWindow.selection;
                var objsToFit = null;
                for (var i=selObjs.length-1 ; i>=0 ; i--){
                    objsToFit = selObjs[i].asObjsToFit();
                    if (objsToFit){
                        for (var j=objsToFit.length-1 ; j>=0 ; j--)
                            objsToFit[j].manageFit(FLUIDFLAG);
                thisDoc.setUnitsTo(memUnits);
                thisDoc.storeTimeStamp();
            }catch(ex){
                thisDoc.setUnitsTo(memUnits);
                exitMessage(ex);
        else
            alert("No object selected!");
    else
        alert("No document opened!");

InDesign table cells don't break across pages the way they do in Word. It's all or nothing.

Similar Messages

  • Table overflow, only header row fits on page, avoid header

    Hello together,
    I encountered the following problem with adobe forms. The form consists of a table with a header row and (for sure) a data part. The table is encapsulated on a subform. If the table doesn't fit on one page, it breaks correctly to the next page (including header).
    Because the table is not the onliest content of my page, it could happen that only the header row fits on the first page. So after the header, I get a page break. Is it possible to avoid the output of the table on first page, if only the header row will fit on it?
    Currently it looks like this:
    FIRST PAGE
    bla bla bla bla
    bla bla bla
    HEADER
    <-- page break -->
    NEXT PAGE
    HEADER
    DATA

    Hello Niels,
    thanks for you help. I tried a lot with the "Keep with:" options the last couple of hours and now I double checked the flags.
    I missed the flag "Keep with: NEXT" at table header level. Now it works as expected.
    The table is part of a subform of type "flow". For the subform, I also checked the Keep with flag becasue the subform contains more than just the table.
    Now, if only the header row fits on the first page, the whole subform starts at the next page. If the table needs much more space, it correctly breaks at the end of the next page.
    Thank you very much

  • Report crashes when table having lots of columns and rows, please help

    Hi, Everyone,
    Our system is Apex 4.0.2 with Oracle 11GR2 and Oracle HTTP server in the middle.
    We have a very simple report drawing data from a table with 46 columns ( no binary data) , when the maximun rows is 500, everything is fine; but if I increase the maximum rows to 500000, it crashes repeatedly. We are doing third party database integration , our goal is using Apex simple reports with CSV exporting capability to export tables into text files which can be imported by other databases. I know there are other ways to export table into CSV file, but APEX report seems very easy to use, best of all, non programmers can use it too....
    Our experience shows that: if the table has few columns, like 10 columns, we can use report to dump large number of rows like 200000, but we can't use APEX report for table with lots of columns. the HTTP server log doesn't show any meaningful information. ( we use the Apex Utilities like UNLOAD data with the same crash result).
    Any suggestions are greatly appreciated.

    "Disk cannot be read from or written to" error syncing iPod in iTunes.

  • InDesign Tables: Row and Column Strokes

    Using InDesign Tables: How do you get row and column strokes in a table to appear perfectly joined? When I choose "Column Strokes in Front" (Under Table Setup) i still see a tiny row stroke, and vice versus.. it's really visible in the PDF almost can't see it in InDesign though you can a little...any advice?

    http://lawrence.ecorp.net/inet/samples/dhtml-rollover-tble-cols-rows.shtml

  • Excel tables... columns and row formatting after I update the indesign page

    When my excel table gets updated in indesign I lose formatting (hight/wide) for the columns&rows. There are 26 columns and each one is a difference size. Do I have to formatting (hight&wide) each column and row every time the excel table is updated?

    We have many publications with statistical tables, which are done in excel. We want to try to do some publications with only tables and do it in-house. The problem is when we place the table in indesign and finish formatting the table. We will get a updated table that needs to be updated in indesign. But when we do we update we lose all of the indesign formatting. Fixing the fonts, type size, etc is easy but how do we get back the all column widths.

  • How to fix skewed table columns and rows after re-import XML

    My question is regarding XML Import in InDesign CS3.
    I have a XML that has a table of 5 columns and 5 rows, when I import it into InDesign, the table shows up fine with 5 columns and 5 rows. However when I revise my table to have an additional column, and re-import the XML file, the table gets updated, but instead of with an additional column, it gets 'appended' with an additional row instead (InDesign seems to blindly replace each cell from left to right, top to bottom, and ends up with 6 rows instead). The XML file specifies the number of columns and rows (5 and 5 before, 5 and 6 after), why doesn't InDesign recognize it and automatically add a new column when I re-import the file?  Is this problem fixed in CS5.5? Is there a script to fix this?
    Here is an example of my old XML vs new XML:
    Old:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid:table="table" aid:trows="5" aid:tcols="5">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>
    New:
    <frame5>
    <Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"
    xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="5" aid:tcols="6">
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1"></Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2007</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2006</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2005</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2004</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">2003</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores at beginning of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">123</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">678</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores opened during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">456</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">36</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">50</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">59</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">79</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Stores closed during the period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">789</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">13</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">9</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">7</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">4</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">Total stores at end of period</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">1368</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">869</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">846</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">805</Cell>
    <Cell aid:table="cell" aid:crows="1" aid:ccols="1">753</Cell>
    </Table>
    </frame5>

    What I mean is, right now there is a "workaround" which requires a user to manually add an extra column before re-importing the XML (with an extra column), otherwise the results get skewed. If by providing a script we can simply ask the user to "run" it, it would be a more "acceptable" solution.  
    Right. So, one solution would be to use Convert Text to Tables. If you find that works for you, then you can script it.
    That's why I asked you...
    Of course if nothing is required from the user other than simply re-importing, then that would be the best solution.
    Well, one could imagine a script that was attached to the re-import command, or to the link update notification, but probably the first step is to get something that works reasonably well without automating it completely. Especially because triggers to run scripts silently can introduce hard-to-debug problems.
    Sure we can switch to use "CALS table and see if this works. The question is, why should we need to? In the 2nd XML there is clearly a different "aid:tcols" value, and yet InDesign seems to ignore it and assume the same # of columns? This sounds like an Indesign bug, can someone confirm? Is there any plans to fix this?
    Not to be snarky, but do you want it to work or not? There are the tools you have and the tools you wish you had, and you can't really do much with the ones you wish you had. I'm kind of assuming you are looking for a solution today, not a solution in 2013.
    Yes,  I believe two of us have confirmed this appears to be a bug.
    Plans to fix? Well, we can't really tell you. You could try asking Adobe, but that's not easy information to get out. But you can certainly open a support case at http://adobe.com/go/supportportal and ask. It's not like we have special information here...
    But you're probably better off filing a bug first, in that same fashion.
    But let's assume no one had filed the bug. CS6 is expected in the March/April 2012 timeframe. That means that they're probably just putting the finishing touches on it right now, and it's going to be very difficult to fix things in it now. So then the earliest you'd likely get it fixed in CS6.5/CS7/whatever which presumably comes out by 2Q2013, and that's assuming Adobe decides to fix it...
    I also can't find much documentation on how to update my table to a "CALS table", any examples?
    Try this thread:
    Re: Importing a CALS table into InDesign CS3

  • To change the height of row of a table

    hi Experts,
    1) Can any one please help me to change the height of row of a table
    2) If i need to display data intable in such a way that data would be displayed in every alternate row, keeping one row empty.
    Points wil be rewarded to helpful answers,
    Regards,
    Sanjyoti.

    hi Jarrod, 
    i want to make a display iview where the data comes from a table, add image beside each data from the table,
    1) if i display data in table i am not able to add image beside each row.
    2)i have also tried using one form and one table displayed side by side where the table has data from data service and form has the images (static), but here again as the height of row can not be changed the image does not fit perfectly beside the rows.
    I have not worked in VC before, so dont know wat exactly cant be done,
    hope you will guide if you have any idea wat could be done
    I got the help given below but not able to understand the flow of what is done 
    First create a button to trigger an action (let's say the action is called "go").
    Drag a line and create a signal out set go as the event, name the signal out as "sig".
    Create 4 numeric fields in the signal out "num1",..,"num4".
    Map num1 <- 1
    Add a signal in to the model, name it "sig" and create 4 numeric field to it ("num1",..,"num4" as well).
    Drag a line from the signal in and choose a form from the context menu.
    4 recordsl will appear in the form. set them as visible and as spinner control.
    drag a line from the form's out port and add a signal out named "go".
    Map is as follows:
    num1 <= @num1+1
    num2 <= 1
    num3 <= if(@num2==1,1,0)
    num4 <= if@num3==1,1,0)
    Add a gaurd condition to the line @num1<4 and name the event "Next_Event"
    double click on num1 to open the properties popup.
    For num1 define a custom action named "Next_Event"
    For num2 define a custom action named "Pass1"
    For num3 define a system action move row - move next
    For num4 define a custom action named "pass2"
    drag a line from the form and add data store. Create 2 field in it "first" and "second"
    set the event to be pass1 and map the value you want from the table to "first".
    Create another line from the form to the data store with event pass 2 that maps value to second.
    Create a new form with 2 field which default vlaue is the value in the data store.
    Points would be awarded to helpful answers. 
    Regards,
    Sanjyoti.

  • Report Row Height and Column Width

    Hi,
    I have a cell in a report (a description column) that causes the row height to become very large (when there is a lot of text in the description). I can make the column wider on the report attributes page, but there doesn't seem to be any place to influence the maximum height of a row on a report, short of modifying the template.
    Adding style attributes (e.g. max-height:30px) to an element only affects the <span> that the element resides in, not the table cell or row.
    Displaying the column as a text area is a useful workaround. The downside is the border and scroll bars do waste a lot of screen real estate. Does there exist some other way of setting a limit on the height and/or width of a report, report column or report row?
    Oh, and another question- how do make line breaks in this forum? There's no support for <BR> or [br].

    Please reply to this thread, my customer is facing the same issue. He does not have issue with the excel and the pdf output but in the rtf output the table heght increases to accomadate the data.He want it to bevave in the same way as the pdf do.
    Regards,
    Ajay

  • Fit the image to window width, window height and  the window size

    hi all
    here we wrote the code for "fit the image to window width, window height and the window size". we are facing some problems in it. and all these operations have to perform even after zooming operations are done.if the below code doesnt satisfy kindly provide appropriate code .
    thanks .
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class DP extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public DP() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   drawPanel.fitwindowwidth();
              if(e.getActionCommand().equals("Fit window height"))
                   drawPanel.fitwindowheight();
              if(e.getActionCommand().equals("Fit the window"))
                   drawPanel.fitthewindow();
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, drawPanel.getBounds().width, drawPanel.getBounds().height);
            if(bgImage != null)
                g.drawImage(bgImage, 0, 0, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            DP wb = new DP();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                double x = (1.0 - m_zoom)*getWidth()/2.0;
                double y = (1.0 - m_zoom)*getHeight()/2.0;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
              public void fitwindowwidth()
                int w1=drawPanel.getWidth();
                int h1=drawPanel.getHeight();
                BufferedImage image2=image.getScaledInstance(w1,h1,Image.SCALE_DEFAULT);
                drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
               drawPanel.repaint();
              public void fitwindowheight()
           BufferedImage image2=image.getScaledInstance(500,680,1); 
           drawPanel.setImage(iicon);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
              public void fitthewindow()
           BufferedImage image2=image.getScaledInstance(1000,680,1);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

    thank you for giving reply.
    your code is very helpful to us.but i couldn't integrate it in my code.here's my code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class IS extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
         private     final int DISTORT = 3;
        private final int SCALE   = 4;
        private final int FIT     = 5;
        private final int FILL    = 6;
        int scaleMode = SCALE;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public IS() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   //drawPanel.fitwindowwidth();
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit window height"))
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit the window"))
              drawPanel.scaleImage(0,0,0,0);
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
              int w = image.getWidth();
            int h = image.getHeight();
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, w, h);
            if(bgImage != null) {
                int x = (w - bgImage.getWidth())/2;
                int y = (h - bgImage.getHeight())/2;
                g.drawImage(bgImage, x, y, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            IS wb = new IS();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                   super.paintComponent(g);
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                              int w = getWidth();
                    int h = getHeight();
                  int iw = image.getWidth();
                  int ih = image.getHeight();
                  if(scaleMode == SCALE) {
                double x = (w - m_zoom*iw)/2;
                double y = (h - m_zoom*ih)/2;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
                   else {
                scaleImage(w, h, iw, ih);
              private void scaleImage( int w, int h, int iw, int ih) {
                             Graphics2D g2d = image.createGraphics();
            double xScale = (double)w/iw;
            double yScale = (double)h/ih;
            AffineTransform at = new AffineTransform();
            if(scaleMode == DISTORT) {
                double x = (w - xScale*iw)/2;
                double y = (h - yScale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(xScale, yScale);
            } else {
                double scale = (scaleMode == FIT) ? Math.min(xScale, yScale)
                                                  : Math.max(xScale, yScale);
                double x = (w - scale*iw)/2;
                double y = (h - scale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(scale, scale);
            g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

  • Interactive Report Column Headings and Row Height

    I am using the div style="width:350px;" method to control the width of columns in various interactive reports. That works fine except for the following:
    1. When creating filters, the <div...> stuff shows up along with the actual column heading, thus confusing some end users
    2. Even when I uncheck the "Use same text for single row view" checkbox and then provide a simple single row view label, the <div> stuff still shows up on the single row view
    Does anyone have a better solution?
    Also, does anyone know of a way to limit the row height within an interactive report row? I have some columns of data that contain a large amount of HTML data and I'd like to be able to limit the number of rows that show on the report.
    Is Oracle planning to provide some better control over the Interactive Report columns in another version? The Interactive Report is such a huge improvement in usability in APEX - it would be great to take it to another level by providing some better control over column width and row height.
    Edited by: DaleB on Jun 18, 2009 8:54 AM
    Edited by: DaleB on Jun 18, 2009 8:54 AM

    Dale,
    Unfortunately we don't have much we can use to do what you would like. I would have said it's impossible until version 4 but you could actually do something similar to what Roel has done. His trick is in the edit button. He changed the edit button to use an "onload" call to a JavaScript process. You could do the same but call a process that goes across the rows and styles each column. Now because you don't have a way to identify the column (can't use the order because the end user could change it) you'll have to write the code to look at the top row first and then style the appropriate column. As far as I can tell, this would be quite difficult and inefficient. Having said that if you need it that bad and would like some help with it, put up an example application on apex.oracle.com and provide the workspace/username/password and I'll take a look.
    Regards,
    Dan
    http://danielmcghan.us
    http://sourceforge.net/projects/tapigen
    You can reward this reply by marking it as either Helpful or Correct ;-)

  • How to enter a data into the specified column and row in a created table

    Hi,
    I want to enter some data to specified column and row in a already created table. Please let me know how to do this.
    Regards
    Shivakumar Singh

    A table is just a 2D array of strings. Keep it in a shift register and use "replace array element" to modify the desired entry programmatically.
    If you want to modify it manually and directly from the front panel, make it into a control and type directly into the desired element. (In this case your program would need to write to it using a local variable).
    Atttached is a simple example in LabVIEW 7.0 that shows both possibilities.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    ChangeTableEntries.vi ‏41 KB

  • Finding missed sequence numbers and rows from a fact table

    Finding missed sequence numbers and rows from a fact table
    Hi
    I am working on an OLAP date cube with the following schema:
    As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers. 
    Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
    Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
    For example if a card has 1000 transactions then sequence numbers are as follows;
    Transaction 1 to transaction 256 with sequences from 0 to 255
    Transaction 257 to transaction 512 with sequences from 0 to 255
    Transaction 513 to transaction 768 with sequences from 0 to 255
    Transaction 769 to transaction 1000 with sequences from 0 to 231
    The problem is that:
    Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
    How can I find all missed transactions of all cards with a MDX QUERY?
    I really appreciate for helps

    Thank you Liao
    I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
    Relative transactions are also missed, so I think it is impossible to get them by your MDX query
    Suppose this:
    date
    time
    sequence
    20140701
    23:22:00
    149
    20140701
    23:44:00
    150
    20140702
    8:30:00
    160
    20140702
    9:30:00
    161
    20140702
    11:30:00
    162
    20140702
    11:45:00
    163
    As you can see the sequence number of the last transaction at the 20140701 is 150
    We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
    find missed sequence numbers

  • Mutating table and row state - this was unexpected

    So, I learned in a class about 3 years ago to expect the following
    SQL> create table p (pk number primary key);
    Table created.
    SQL> create table c (fk number references p(pk));
    Table created.
    SQL> create or replace trigger t_insrt
      2  before insert on p
      3  for each row
      4  begin
      5   insert into c values (:new.pk);
      6  end;
      7  /
    Trigger created.
    SQL> insert into p values (1);
    insert into p values (1)
    ERROR at line 1:
    ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated - parent key
    not found
    ORA-06512: at "FORBESC.T_INSRT", line 2
    ORA-04088: error during execution of trigger 'FORBESC.T_INSRT'and so it led me to think that replicating ON MODIFY PARENT - MODIFY CHILD functionality wouldn't work in a BEFORE ROW trigger, but it does
    SQL> drop trigger t_insrt;
    Trigger dropped.
    SQL> create or replace trigger p_updt
      2  before update on p
      3  for each row
      4  begin
      5   update c
      6   set fk = :new.pk
      7   where fk = :old.pk;
      8  end;
      9  /
    Trigger created.
    SQL> insert into p values (1);
    1 row created.
    SQL> insert into c values (1);
    1 row created.
    SQL> select * from c;
            FK
             1
    SQL> update p
      2  set pk = 2
      3  where pk = 1;
    1 row updated.
    SQL> select * from c;
            FK
             2Why would the first scenario fail while the second succeeds? The update seems prone to a parent record also not existing, at least not by the BEFORE ROW trigger.
    ---=Chuck

    < mutating table and row state >
    BTW, you don't seem to have run into the mutating table error though 2 other threads today are also about it. You have a constraint violation, a different thing entirely.
    I believe the second scenario works because you're neatly avoiding the error of the first. The error "ORA-02291: integrity constraint (FORBESC.SYS_C00169150) violated" means that on insert Oracle is looking up the value you're trying to insert, not finding it, and raising an error. With the before trigger you are taking the assigned value from the insert, updating the parent to it, so that on actual insert when the check happens the value is there due to the update.
    I'm not convinced this is a good idea because any on-the-fly approach to data entry needs to be examined carefully.

  • Dynamically size movieclip to fit text's string height and width

    Hello,
    I am trying to dynamically size a movieclip to fit the size of a text's string height and width (This text is inside the movieclip)
    here is my code so far..
    var Font1_ = new Font1();
    var Format2:TextFormat = new TextFormat();
    Format2.size = 36;
    Format2.align = TextFormatAlign.CENTER;
    Format2.font = Font1_.fontName;
    var MessageBox:MovieClip = new MessageBoxMC();
    MessageBox.Text1.defaultTextFormat = Format2;
    MessageBox.Text1.embedFonts = true;
    MessageBox.Text1.antiAliasType = AntiAliasType.ADVANCED;
    MessageBox.Text1.wordWrap = true;
    MessageBox.Text1.width = 800;
    MessageBox.Text1.height = 400;
    MessageBox.Text1.textColor = 0xFFFFFF;
    MessageBox.Text1.cacheAsBitmap = true;
    MessageBox.Text1.mouseEnabled = false;
    MessageBox.Text1.text = String("Use the Arrow Buttons to move");
    MessageBox.width = MessageBox.Text1.width;
    MessageBox.height = MessageBox.Text1.height;
      MessageBox.x = 400;
      MessageBox.y = 200;
      addChild(MessageBox);
    this isn't working for me.. anyone know the best way to do this?
    I also want the text to be centered in the movieclip, with a border of around 2-4 pixels
    I am also not sure if i should be using text.length? any advice and input is greatly welcomed.
    thanks in advance!

    Essentially, you need to check for a change in .textWidth or .textHeight, which are different from .width and .height.
    This code works for me (assumes a background box called bg and a foreground text instance fg inside a moveclip and an X and Y bounds offset variable to say how far away you want the box from the text and a textFrameNudge to provide a tweak value).
         // Resize background box
         thisBox.bg.x = thisBox.fg.x - boundsOffsetX + textFrameNudge; // I'm using .4 as the tweak value for textFrameNudge
         thisBox.bg.y = thisBox.fg.y - boundsOffsetY;
         thisBox.bg.width = thisBox.fg.textWidth + boundsOffsetX*2 +textFrameNudge*thisBox.fg.getTextFormat().size;
         thisBox.bg.height = thisBox.fg.textHeight + boundsOffsetY*2;

  • How do I copy frame width & height and apply to all other frames in Indesign CS5?

    I design albums using lots of photos. I often find myself copying a particular frame's width and height then pasting it individually across other frames. Is there a way to copy and paste a frames width and height and apply it across numerous frames? I'm not changing the content dimensions (photo) just the frame dimensions.
    Thanks in advance for all your time and understanding. It's much much appreciated.
    Fuiru

    This would be a good question for the InDesign forum.

Maybe you are looking for

  • How can I restore contact On My Mac?

    How can I restore contact On My Mac?  The account is listed under accounts but it seems there is nothing is in it. My Contacts window only shows iCloud  and Smart Groups.

  • Flash File (swf) in Powerpoint won't play after 1st time

    Windows XP, Powerpoint 2003 Captivate4 FlashPlayer 10 I've created a flash file using Captivate4 and successfully embedded it in a Powerpoint presentation using the controls toolbox. It plays, but once I save and close the Powerpoint file then reopen

  • Two problems with a grep solution?

    Hello! I have two problems that I need some help with. I've been searching around for solutions, but are unsure what approach that is the best: A: I need a new (or next) paragraph style after TWO hard line breaks. How do I do this? Do i search for tw

  • Display all columns but only unique values in one column

    My table looks like this; ApprovalKey (PK) ApprovalCCN (Links to main table) ApprovalName ApprovalDate ApprovalMsg ApprovalResult Typical data would look like; Key CCN ApprovalName ApprovalDate ApprovalMsg ApprovalResult 1 1 John Smith 12/12/2014 16:

  • "Show in Project in New Tab"?? or alternative?  "Viewing History" list??

    Hi. The biggest rock in my Aperture workflow is not being able to instantly return to a view I had been recently using. I often work in a Smart Album, need to go to the Project in which a Version resides, and then return to the Smart Album. I sometim