Printing datagrid items or data

I have built an application that takes user input, searches
data in an XML file, and returns matches to a datagrid (with scoll
bars) on the stage. The next logical step would be to print that
data. Of course, the data could be one item or 100 items, so I have
no way of knowing how many pages would need to be printed. From
what I've read, this can be pretty dicey. Hence, I'm looking for
some general ideas about how to do it.

Printing datagrids is a complex task and results are somewhat
substandard, but basically what you'll need to do is:
Determine how long the datagrid is (in pixels)
Determine how many pages long the datagrid is
Start a print job
Run a loop through the number of pages
Each loop iteration, update the position of the datagrid to
the next page
Force the datagrid to render before the next addPage call is
made
(flash does not update the screen when in a code loop)
Send the print job
Reset the position of the scrollbar.
A very basic (and ugly) version CAN be done in about 10-15
lines of code.
Good luck ;)
Cheers,
FlashTastic

Similar Messages

  • Item level data in sap script

    Hello Friends,
    I have a report which prints Normal Tax invoice & Returns Tax, I modified this report just by adding one extra "delivery channel". The report call one more program which dose the printing job based on the delivery no.
    The issue, I can able to see the header data in th the print preview of the tax invoice, and not able to see item level data.
    Please help me how to resolve this issue.
    Regards,
    Shreekant

    Hi,
    You need to pass the line item data to the smartform/script. Please check in debug mode whether the data is passed correctly.
    Best regards,
    Prashant

  • How to print selected Item rows in AR Invoice under PLD?

    Hi,
    Customer is running on 2007A PL30. They are distributing drugs to clinics and hospital.
    Eg. In AR Invoice, they are selling 10 items to customer. The 10 items will be printed out in AR Invoice. Assume out of these 10 items 2 of it are poison.
    Customer wants to print out poison report to the government for same invoice but only appear 2 items rather than all the 10 items.
    May I know how to incorporate filtering in PLD to print out the 2 item only. FYI, we are going to use a marker in Item Master Data to indicate whether the item is poisoneous.
    How to derive poison report in this scenario?
    Regards
    Thomas

    Hi
    It will be possible to filter the rows (poison only) to show on a separate layout using the flag on the item master.
    You will need the flag field in the repetitive area as well as a formula field. You link your fields in the repetitive area to this formula field to determine whether a line in the invoice will show in the print or not.
    Have a look at the system layout 'Invoice_Item Type and Details (system)' - repetitve area which will give you a good idea of how this can be done.
    Regards

  • Maybe Flex SDK bug: Setting visible of DataGrid item renderers

    Hi all, I'm still a noob at flex but this looks a bit strange to me.
    I've been trying to hide a button renderer in a DataGrid but it just wouldn't hide.  I've been setting visible inside the mxml and also in the the class that extends buttonbut it just wouldn't hide.  I then overloaded the visible property set/get and traced what was setting the property to true and found that inside DataGridBase.as the function setupColumnItemRenderer always sets visible of the renderes to true.
    DataGridBase.as
    protected function setupColumnItemRenderer(c:DataGridColumn, contentHolder:ListBaseContentHolder,
                        rowNum:int, colNum:int, data:Object, uid:String):IListItemRenderer
            var listItems:Array = contentHolder.listItems;
            var item:IListItemRenderer;
            var rowData:DataGridListData;
            item = listItems[rowNum][colNum];
            if (!item || itemToUID(item.data) != uid
                || columnMap[item.name] != c)
                item = createColumnItemRenderer(c, false, data);
                if (item == null)
                    return null;
                if (item.parent != contentHolder)
                    contentHolder.addChild(DisplayObject(item));
                // a space is used if no data so text widgets get some default size
                columnMap[item.name] = c;
                if (listItems[rowNum][colNum])
                    addToFreeItemRenderers(listItems[rowNum][colNum]);
                listItems[rowNum][colNum] = item;
            //[Matt] moved from inside the block above to outside because
            //the item definitely exists at this point, and always needs
            //its data refreshed
            rowData = DataGridListData(makeListData(data, uid, rowNum, c.colNum, c));
            rowMap[item.name] = rowData;
            if (item is IDropInListItemRenderer)
                IDropInListItemRenderer(item).listData = data ? rowData : null;
            item.data = data;
            item.visible = true;
            if (uid && colNum == 0)
                contentHolder.visibleData[uid] = item;
            return item;
    Why does it do this?  Shouldn't it respect the visible property already set for the renderer in mxml and not force it to true on init?

    Renderers use the visible property for recycling.  Invisible renderers are not supported.  The hit detection logic would find it the cell it belongs to even if it was invisible.  You can set alpha=0, but it won't stop the hit detection logic.
    Why are you trying to hide a renderer?
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Steps involved to Configure a Smartform for printing TO Item

    Hi,
    I want to develop a Smartform to print TO for each Item.
    Currently it is being done using SAP Script.
    I checked the Configuration in OMLV and assigned my print program Z****** .
    This thing here is I don't see any values passed to my program like TO Number, Whse Number etc when called through LT31.
    Where as I assign the standard program RLVSDR40 and debug it all the details are being passed to this program.
    I am not sure if I am missing any configuration.
    Please help me to figure out the issue and let me know all the steps involved in configuring the Smartforms to print Transfer Orders.
    Thanks in Advance.
    MK.

    Hi Murali,
    The SAP delivers the solution to print the TO item by SAPScript, but we can do it by Smartform as well, as in
    You need to create a project for the enhancement MWMD0001, because EXIT_RLVSDR40_001 will fulfill your purpose of doing it the other ways i.e. via Smart from.
    For this you have to use CMOD transaction to create the project for the above said enhancement.
    Note: If you do this way any configuration done via OMNU wont't be considered.
    Then after in teh import parameters you have a table XRLDRI, which contains both the warehouse number and the transfer order number, the same can be passed on to the designed Smartform to fulfill your purpose.
    Sample Code, you can refer to:
    *local variable declaration.
       DATA: l_wa_fm_name            TYPE rs38l_fnam.
    * Local Field Symbols
       FIELD-SYMBOLS : <l_fs_rldri> TYPE rldri.
    * Local Constant declaration
       CONSTANTS : lc_fmname TYPE tdsfname   VALUE 'XYXYXYXY',  "Smartform name, here designated by 'XYXYXYXY'
                   lc_chk      TYPE rldrudruck VALUE 'X'.
    *Moving Transfer Order Print :Item level data into corresponding work area.
       LOOP AT xrldri ASSIGNING <l_fs_rldri>.
    * Determine smartform function module
         CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
           EXPORTING
             formname           = lc_fmname
           IMPORTING
             fm_name            = l_wa_fm_name
           EXCEPTIONS
             no_form            = 1
             no_function_module = 2
             OTHERS             = 3.
        IF sy-subrc = 0.
    * Call the function module of the smartform
           CALL FUNCTION l_wa_fm_name
             EXPORTING
               user_settings    = lc_chk
               tanum            = <l_fs_rldri>-tanum
               lgnum            = <l_fs_rldri>-lgnum
             EXCEPTIONS
               formatting_error = 1
               internal_error   = 2
               send_error       = 3
               user_canceled    = 4
               OTHERS           = 5.
           IF sy-subrc = 0.
           ENDIF.
         ENDIF.
       ENDLOOP."LOOP AT xrldri ASSIGNING <l_fs_rldri>. 
    Please validate the same at your end and let me know in case you require any further inputs from my end.
    BR/Thanks
    Pranav Agrawal

  • DataGrid Item Renderer loading duplicates after scroll

    HI,
    I have a report that loads into a datagrid, these reports are
    about thumbnail images that are on a server.
    I have a datagrid item renderer that loads the thumb nails.
    When the grid first loads the first set of rows that are visible
    display the correct images. But after I scroll the new rows have
    images that are repeated and not the correct ones.
    ?xml version="1.0" encoding="utf-8"?>
    <HBox xmlns="
    http://www.adobe.com/2006/mxml"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    creationComplete="{init()}">
    <Script>
    <![CDATA[
    import mx.controls.Image;
    [Bindable]
    [Embed(source="/images/folderBlack.png")]
    private var folderIcon:Class;
    private function suffix(url:String):String {
    var i:Number;
    if ((i = url.lastIndexOf(".")) > -1) {
    url = url.substr(i+1);
    return url;
    private function init():void {
    var fileSuffix:String = new String;
    fileSuffix = '';
    fileSuffix = suffix(data.filename);
    var staticPortalImage:String = new String;
    staticPortalImage = '/PULLIMAGE.php?type=small&id=' +
    data.FileID +
    '&path=' + data.filename +
    '&server=MTI3LjAuMC4x&siteurl=L0F1dGhNb2R1bGU=';
    var thumbNailImage:Image = new Image();
    thumbNailImage.height = 80;
    switch(fileSuffix){
    case 'jpg':
    thumbNailImage.source = staticPortalImage;
    break;
    imageContainer.addChild(thumbNailImage);
    texttest.text = fileSuffix;
    ]]>
    </Script>
    <Text id="texttest" />
    <HBox id="imageContainer" height="80" />
    </HBox>

    Thanks
    Great article I ended up getting rid of the creationcomplete
    changing my init():void too override public function set data(
    value:Object ) : void
    and adding
    super.data = value;
    I was able then to clean up my code considerably.
    Once again Thanks
    Dean

  • Add barcode in the item master data

    Hi All
    we have a field in the item master data called Bar Code.  if you have several hundred thousand items in the database how do you assign a barcode for each item?  do you enter the barcode manually for each item or is there any other way to enter this item's barcode automatically when the item is added into ware house?  if you have enter manually the barcode how we should follow with the number of characters in the field? is that should look like exactly on the barcode label when you print? or we need to follow our own naming convention in using the numbers?
    thanks
    Santhosh

    Check this Thread
    [Barcode scanner addon;

  • Avoid printing child items of Sales BOM in AR Invoice

    Hi All,
    I have a requirement to edit the print layout of AR Invoice to see only the parent item of the Sales BOM in SAP 2005.
    In SAP 2007, there is an option to Hide BOM Components in Print Out but how do I avoid printing child items in SAP 2005.
    Please advise.
    Thanks for your help!
    Regards,
    Payal

    Hi Payal,
    As a definition of B1, the children of the Sales BOM will always be shown in a marketing document.
    However, we can change the template to hide them from the printouts. Please kindly follow the steps as below:
    Print template editing for removing child items of Sales BOM
    1.Add a new Text Field with Text 'I' in the Repetitive Area. ('I' is the attribute for child items)
    2.Add a new Data Field in the Repetitive Area as below:
       a)In the Content tab, chose Table A/R Invoice # Rows and Column BOM Type
    3.   Add a Formula in the Repetitive Area as below In the Content tab, chose:
          i.Source Type: Formula
          ii.In the Formula Editor, insert Field 1: the newly created Data field
          iii.Operation: !=
          iv.Field 2: the newly created Text field e.g. Field_316!=Field_315
    4.Set the three fields added as Invisible, in order to set it as invisible, please uncheck the Visible box  under General tab
    5.Set Link to Field on the General tab of every field in the Repetitive Area (Row Level) to the exclusive number of the newly created calculation field.
    6.Double-click the Repetitive Area to open Repetitive Area Property, Check Area Height Adjustment box under Format tab to hide the blank lines.
    7 Save template and set as default, print preview.
    You will find that the row number is the original, not successive, number. It is better to hide the row number field.
    I hope it shall help.
    Regards,
    Varun
    SAP Business One Forum Team.

  • User exit to change item level data in purchase order

    Hi,
    Can anyone let me know the user exit to change item level data in purchase order . there is a badi ME_PROCESS_PO_CUST for this but the issue is its method process_item gets triggered only when the item is changed. My requirment is
    For purchase order document types u201CZSOu201D and u201CZCOu201D, where the purchase order is a u201CLimits Orderu201D only i.e. no materials or services on the purchase order, the print price indicator field should be set to u201Cblanku201D (unchecked).   now i cant use ME_PROCESS_PO_CUST  because process_item wont get triggered if there is no change in itemlevel data.
    Regards,
    Rahul

    Hi Rahul,
    Probably EXIT_SAPLMEKO_002.
    hope it helps,
    Edgar

  • Help - User exit to change item level data in Purchase Order

    Hi,
    Can anyone let me know the user exit to change item level data in purchase order . there is a badi ME_PROCESS_PO_CUST for this but the issue is its method process_item gets triggered only when the item is changed. My requirement is For purchase order document types u201CZSOu201D and u201CZCOu201D, where the purchase order is a u201CLimits Orderu201D only i.e. no materials or services on the purchase order, the print price indicator field should be set to u201Cblanku201D (unchecked).   now i cant use ME_PROCESS_PO_CUST  because process_item wont get triggered if there is no change in item level data.
    Thanks,
    Rahul

    Hi Rahul,
    Probably EXIT_SAPLMEKO_002.
    hope it helps,
    Edgar

  • Translation of UoM in Item Master Data

    Hi all,
    Problem:
    Our customer uses multi-language support. In the item master data they use the purchasing and sales UoM which is printed on the marketing documents. For example "ST" in German corresponds to "pc" in French (piece). They need to go into each item one by one and enter the translation even if the UoM is always the same.
    Possible solution:
    A table behind the UoM field so that you can select from a drop down list. You would then need to translate each entry in the table just once.
    Best regards,
    Gunther

    The company is called BoyumIT and the add-on is called B1 Usability Package and their website is www.b1up.net
    You may write to Soren the channel manager at this company.  His email is [email protected] and refer my name if required.
    There is a point system in SDN Forum which I am not sure if you are aware of this, but please take a look at how it works
    How do I reward points?
    I posted a thread and marked it as a question. Several people replied and gave me useful advice. I'd like to reward points. What do I do? 
    If you designated your thread as a question and are satisfied with one or more of the responses received, you may award points according to the following scheme:
    Designation ................. Point Value
    Solved My Problem..........10
    Very Helpful ...................... 6
    Helpful .............................2
    To award points, go to your user profile and select the relevant thread from the list of Recent Messages. Click on the hyperlinked title. You will be directed to a page that shows all the responses to your original post.
    Click on the star icon next to the response for which you wish to reward points. A popup window will appear. Use the radio buttons to mark a response "Solved My Problem," "Very Helpful," or "Helpful."
    You are allowed to grant only one 10 point "Solved My Problem" award and one six point "Very Helpful" award, so evaluate all the replies carefully. You may designate an unlimited number of two point "Helpful" awards.
    Suda

  • How populate itemrenderer items with data.

    How populate itemrenderer items with data. Ie after my app starts I generate an array collection that I want to assign as the data provider to each combobox in my item renderer, which im using in a datagrid.

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   minWidth="955"
                   minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
            <s:ArrayCollection id="booksWithStores">
                <fx:Object name="book1" stores="{new ArrayCollection(['store1','store2'])}"/>
                <fx:Object name="book2" stores="{new ArrayCollection(['store1','store3'])}"/>
                <fx:Object name="book3" stores="{new ArrayCollection(['store2','store3', 'store4'])}"/>
                <fx:Object name="book4" stores="{new ArrayCollection(['store1','store4'])}"/>
            </s:ArrayCollection>
            <s:ArrayCollection id="booksWithoutStores">
                <fx:Object name="bookA"/>
                <fx:Object name="bookB"/>
                <fx:Object name="bookC"/>
                <fx:Object name="bookD"/>
            </s:ArrayCollection>
            <s:ArrayCollection id="allStores">
                <fx:String>store1B</fx:String>
                <fx:String>store2B</fx:String>
                <fx:String>store3B</fx:String>
                <fx:String>store4B</fx:String>
            </s:ArrayCollection>
            <fx:Component id="renderer1" className="Renderer1">
                <s:MXDataGridItemRenderer>
                    <s:DropDownList dataProvider="{data.stores}" />   
                </s:MXDataGridItemRenderer>
            </fx:Component>
            <fx:Component id="renderer2" className="Renderer2">
                <s:MXDataGridItemRenderer>
                    <s:DropDownList dataProvider="{storesList}" />
                    <fx:Script>
                        <![CDATA[
                            import mx.collections.ArrayCollection;
                            [Bindable]
                            public var storesList:ArrayCollection;
                        ]]>
                    </fx:Script>
                </s:MXDataGridItemRenderer>
            </fx:Component>
        </fx:Declarations>
        <mx:Form>
            <mx:FormItem label="Dynamic Stores">
                <mx:DataGrid dataProvider="{booksWithStores}" width="354">
                    <mx:columns>
                        <mx:DataGridColumn dataField="name"/>
                        <mx:DataGridColumn dataField="stores" itemRenderer="{renderer1}"/>
                    </mx:columns>
                </mx:DataGrid>
            </mx:FormItem>
            <mx:FormItem label="Static Stores">
                <mx:DataGrid dataProvider="{booksWithoutStores}" width="354">
                    <mx:columns>
                        <mx:DataGridColumn dataField="name"/>
                        <mx:DataGridColumn dataField="stores" itemRenderer="{createRendererWithProperties(Renderer2, {storesList:allStores})}"/>
                    </mx:columns>
                </mx:DataGrid>
            </mx:FormItem>
        </mx:Form>
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                public static function createRendererWithProperties(renderer:Class, properties:Object):IFactory
                    var factory:ClassFactory=new ClassFactory(renderer);
                    factory.properties=properties;
                    return factory;
            ]]>
        </fx:Script>
    </s:Application>

  • Smart from item level data display?

    Hi EXPERTS,
    i want to display the item level data by maintaining the parent and child relation. how it possible?

    Hi  ,
    According to your requirement 
    Suppose
    Your header & Item  data  it_vbak   it_vbap
    Put the loop node for it_vbak
    Inside the loop as per your requirement   u can design the table  for it_vbap & print  it ..
    Let me know if any concerns...

  • Suppressing the printing of Item Master record remmarks.

    Hello
    How do I disable the printing of the Item Master Data Remmarks from the Marketing Documents when a Text Line is present.  Example - When a Text line is added to a Sales Order, the PLD priints the remmarks on the Item Master record in addition to the Text entry.  I will like to suppress the printing of the Item Master record's remmarks.
    Thanks.
    Man

    Hi,
    Please apply the following workaround:
    +Hide the field "item Details(INV1,text)
    +Link every existing field in the Repetitive Area to itself (this
    inlcudes hidden fields as well)
    +Add the following fields to the Repetitive Area:
    (Before adding the fields,Increase the Height of the Repetitive Area to
    allow placing the following field vertically below the exisiting fields
    of the Repetitive Area - tick Height Adjustment for the Area)
          Field_1:
          General Tab
          untick visible
          Left = 0 / Width = 0 / Top = 0 / Height = 0
          Content Tab
          Source Type: System Variable
          Variable No.: 157
          Field_2:
          General Tab
          untick visible
          Left = 0 / Width = 0 / Top = 0 / Height = 0
          Content Tab
          Source Type: Formula
          Field_1 !='T'
          Field_3:
          General Tab
          untick visible
          Left = 0 / Width = 0 / Top = 0 / Height = 0
          Content Tab
          Source Type: Formula
          Field_1 =='T'
       Field_4:
       General Tab
       Link to: Field_2
       untick visible
       Left = 0 / Width = 0 / Top = 0 / Height = 0
       Content Tab
       Source Type: Formula
       LineNum()
       Field_5:
       General Tab
       Link to: Field_3
       untick visible
       Left = 0 / Width = 0 / Top = 0 / Height = 0
       Content Tab
       Source Type: Formula
       LineNum()
       Field_6:
       General Tab
       Link to: Field_3
       Left =  / Width =  / Top =  / Height =(Remain as it is)
        => place vertically below the top row in the Repetitive Area
       Format Tab
       Line Break: Divide into Rows
       tick Field Height Adjustment
       Content Tab
       Source Type: Database
       Table:  A/R Invoice - Rows
       Column: Text
    I hope the above steps will solve your issue.
    Regards,
    Abhinav Banerjee
    SAP Business One Forums Team

  • DataGrid jumps on data refresh

    Hi,
    I have a datagrid control bound to an arraycollection. I also
    have a timer which updates the arraycollection with new data and
    call its refresh method every few seconds
    The problem is that the datagrid scrolls to the item that is
    selected and it looks very jumpy. How can i prevent this from
    happening?

    Actually, I discovered that I don't have to use itemUpdated()
    method when binding an arraycollection to a datagrid (notification
    of data change is sent to the view automatically)...
    What i did instead was simply update the properties of the
    objects inside of my arraycollection through a loop.
    for(var i:int = 0; i < mainCollection.length; i++){
    var item:Object = mainCollection.getItemAt(i);
    for (var qs:String in anotherCollection
    item[qs] = anotherCollection[item.id][qs];
    mainCollection.itemUpdated(item);
    But, since you are ADDING or REMOVING items, I'm not sure how
    useful the code above will be in helping you figure it out. Since I
    use it to update the items.

Maybe you are looking for

  • TIPS/Help--Vocal Mixes

    I am having a horrible time trying to tame my vocals. I am using Shure SM7 with Apogee Duet into iMac 24". I have all my levels crazy low, I'm recording at like -18db to -12 db. In that range, I'm leaving tons of headroom. I usually apply compression

  • How to force validator method instead of data type validation in af:table

    This post will probably once again illustrate exactly how new I am to the Java/JDeveloper world so thanks in advance for any help! I have tried searching but couldn't find anything that seemed to mirror my problem. I am using a modification of Frank'

  • PL/sql issue

    Hey, I tryed to use forall like this and its thorwing an error like this. PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL Please Help me regarding this issue and am trying insert bulkcollect and but its throwing an error mi

  • Mac mini start up shut down code

    I appreciate the two responses, from '300Tech' and TITOUMAX to my original question. I was reluctant to take the "sudo halt" terminal suggestion since a warning loomed over the danger of losing data. I was unable to post a copy of the code sequences

  • Content of my Apps isn't backed up

    I recently had the horrific experience of losing EVERYTHING on my iPhone because my battery just died. When I restored from my backups, none of the content in my apps was saved. The apps themselves were there, but I use a lot of organizing apps and n