2 Replies Latest reply on Apr 6, 2011 12:45 AM by Dezaxata

    Problem with Flex print- characters are being chopped off

    veeru_macromedia
      help please
        • 1. Re: Problem with Flex print- characters are being chopped off
          veeru_macromedia Level 1
          Bottom of the page characters are being chopped off I am using
          private function doPrint():void {
          var myPrintJob:FlexPrintJob = new FlexPrintJob(); myPrintJob.start();
          myPrintJob.addObject(printArea1);
          myPrintJob.send();
          }

          Code is:

          <mx:Canvas backgroundColor="white" height="70%" width="100%" visible="true">
          <!-- The following part of the code being executed when user clics on Print Button -->
          <mx:VBox width="90%" height="100%" visible="true" id='printArea1' includeInLayout="true">
          <mx:VBox paddingLeft="0" paddingRight="0" horizontalGap="0" >
          <mx:HBox>
          <mx:VBox width="20%">
          <mx:HBox>
          <mx:Label styleName="printFont" text="Role:" width="50"/>
          <mx:Label styleName="printFont" text="{role.selectedItem.DAFYROLE}"/>
          </mx:HBox>
          </mx:VBox>
          <mx:VBox width="40%">
          <mx:HBox id='idPrintFacility'>
          <mx:Label styleName="printFont" text="Facility:"/>
          <mx:Label styleName="printFont" text="{facs.selectedItem.LABEL}"/>
          </mx:HBox>
          </mx:VBox>

          <mx:VBox width="30%">
          <mx:HBox>
          <mx:Label styleName="printFont" text="Patient:"/>
          <mx:Label styleName="printFont" text="{patient.selectedItem.LABEL}"/>
          </mx:HBox>
          </mx:VBox>
          </mx:HBox>
          <mx:HBox>
          <mx:VBox width="20%">
          <mx:HBox>
          <mx:Label styleName="printFont" text="Filter By:"/>
          <mx:Label styleName="printFont" text="{filter.text}"/>
          </mx:HBox>
          </mx:VBox>
          <mx:VBox width="40%">
          <mx:HBox>
          <mx:Label styleName="printFont" text="From"/>
          <mx:Label styleName="printFont" text="{fromDate.text}"/>
          <mx:Label styleName="printFont" text="To"/>
          <mx:Label styleName="printFont" text="{toDate.text}"/>
          </mx:HBox>
          </mx:VBox>
          </mx:HBox>
          </mx:VBox>
          <mx:Repeater id="idCatsx" dataProvider="{myNotes}" width="100%" >
          <mx:HBox id="idCatLabel">
          <mx:HBox>
          <mx:Label styleName="printFontBold" text="{idCatsx.currentItem.LABEL}" fontWeight="bold" />
          </mx:HBox>
          <mx:HBox>
          <mx:Spacer width="10"/>
          </mx:HBox>
          </mx:HBox>
          <mx:HBox width="100%">
          <mx:VBox width="10%">
          <mx:Spacer width="10"/>
          </mx:VBox>
          <mx:VBox width="90%" height="100%">
          <mx:Repeater id="idTipsx" dataProvider="{idCatsx.currentItem.NOTES}" >
          <mx:HBox width="100%" verticalGap="0" >
          <mx:VBox>
          <mx:Label styleName="printFont" text="{idTipsx.currentItem.NOTES_DATE}" />
          </mx:VBox>
          <mx:VBox height="100%">
          <mx:HBox height="100%">
          <mx:Text width="500" styleName="printFont" text="{idTipsx.currentItem.NOTE_TEXT}" />
          </mx:HBox>
          <mx:HBox height="100%">
          <mx:Text styleName="bold" width="600" text="{idTipsx.currentItem.ADDMODIFYTEXT} on {idTipsx.currentItem.TIME_STAMP} for Assessment Date:{idTipsx.currentItem.ENCDATE_DATE}" />
          </mx:HBox>
          </mx:VBox>
          </mx:HBox>
          <mx:HBox verticalGap="0">
          <mx:VBox width="100%" verticalAlign="top" verticalGap="0" height="100%">
          <mx:VBox >
          <mx:Repeater id="idHistx" dataProvider="{idTipsx.currentItem.HIST}">
          <mx:HBox width="100%" >
          <mx:VBox>
          <mx:Spacer width="115"/>
          </mx:VBox>
          <mx:Canvas height="100%">
          <comp:StrikeThroughText width="500" height="100%" styleName="printFont" text="{unescape(idHistx.currentItem.NOTE_TEXT)}"/>
          </mx:Canvas>
          </mx:HBox>
          <mx:HBox>
          <mx:VBox>
          <mx:Spacer width="115"/>
          </mx:VBox>
          <mx:VBox height="100%" width="100%">
          <mx:Text width="600" styleName="bold" text="Notes {idHistx.currentItem.ADDMODIFYTEXT} on {idHistx.currentItem.TIME_STAMP} for Assessment Date:{idTipsx.currentItem.ENCDATE_DATE}" />
          </mx:VBox>
          </mx:HBox>
          </mx:Repeater>
          </mx:VBox>
          </mx:VBox>
          </mx:HBox>
          </mx:Repeater>
          </mx:VBox>
          </mx:HBox>
          </mx:Repeater>
          </mx:VBox>
          </mx:Canvas>
          • 2. Re: Problem with Flex print- characters are being chopped off
            Dezaxata

            I just encountered the same problem. I know the post is really old but maybe this will help someone else that runs into this.

            The solution in my case was to set the width of the label which is being chopped off. I set it to 100%, but I think anything would work as long as it's large enough to contain your text. And the width has to be set for it's container also.