Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Print problem with firefox

    Hello,

    We are having an issue with Content being clipped to 1 page in Firefox when trying to print a ListGrid. I've recreated the problem in the SDK as well. I spent some time researching this and found this blog post which describes the same problem and offers various suggestions on how to fix it. The blog appears to discuss Firefox2 but the symptoms match what we see in Firefox3 as well as Firefox 2: http://jafferhaider.wordpress.com/2007/12/29/fix-for-the-firefoxcss-one-page-printing-bug/

    I experimented with the settings suggested on our smartclient page extensively but I think this may be an issue with how SmartClient lays out the page?

    Here is how I recreated. Use the following jsp code in the SDK. If you click File > Print Preview in IE7, you'll see multiple pages (although it looks like the grid is only fetching partial data, not sure why this happening) and can print multiple pages including all of those seen on the sceen. However, if you click File > Print Preview in Firefox 3, it will only show you 1 page and that 1 page is cut off and not showing all the data you see on the screen.

    Code:
    <!--------------------------------------------------------------------
        SmartClient SDK
        Component Data Binding example
    
        Copyright 2001-2007 Isomorphic Software, Inc. (www.isomorphic.com)
    ---------------------------------------------------------------------->
    
    <%@ taglib uri="/WEB-INF/iscTaglib.xml" prefix="isomorphic" %>
    <HEAD><TITLE>
            SmartClient SDK - Supply Example
    </TITLE></HEAD><isomorphic:loadISC skin="SmartClient"/>
    <BODY BGCOLOR=#D3D3D3>
    
    <SCRIPT>
    <isomorphic:loadDS name="supplyItem"/>
    <isomorphic:loadDS name="supplyCategory"/>
    
    isc.setAutoDraw(false);
    
    
    
    // so no fields, and no DS leads to error, but it's a different one
    // no fields, but a DS doesn't lead to error (thought I thought it would)
    // No DS, but fields...
    
    isc.ListGrid.create({
    	ID:"supplyGrid",
    	dataSource:"supplyItem",
    	useAllDataSourceFields:true,
    	fields:[
    		{name:"itemName", title:"Name", showHover:true},
    		{name:"unitCost", 
             formatCellValue:"return isc.Format.toCurrencyString(parseFloat(value))", 
             editorType:"spinner", editorProperties:{step:0.01}},
    		{name:"SKU", canEdit:false},
    		{name:"description", showHover:true},
    		{name:"category", canEdit:false},
            {name:"inStock", width:55, align:"center",
                formatCellValue : function (value, record, field, rowNum, colNum) {
                    if (value) return isc.Canvas.imgHTML("demoApp/checked.png",13,13);
                    else return isc.Canvas.imgHTML("demoApp/unchecked.png",13,13)
                }},
            {name:"nextShipment", showIf:"false"}
    	],
    	canEdit:true,
        modalEditing:true,
    	cellChanged:"this.updateDetails()",
    	alternateRecordStyles:true,
    	canDragRecordsOut:true,
    	useCellEvents:true,
    	hoverWidth:200,
        hoverHeight:20,
    	selectionType:"single",
        
        // Function to update details based on selection
        updateDetails : function () {
            var record = this.getSelectedRecord();
            if (record == null) return itemDetailTabs.clearDetails();
            
            if (itemDetailTabs.getSelectedTabNumber() == 0) {
                // View tab: show selected record
                itemViewer.setData(record) 
            } else {
                // Edit tab: edit selected record
                itemDetailTabs.updateTab("editTab", editForm);
                editForm.editRecord(record);
            }
        }
    
    });
    
    
    
    
    <%-- **************overall page layout ************************--%>
    isc.VLayout.create({
    	ID:"pageLayout", 
    	width:"100%", 
    	height:"100%", 
    	members:[
     
        	isc.HLayout.create({
        		ID:"mainLayout", 
        		layoutMargin:5, 
        		members:[
            		supplyGrid
        		]
        	})
    	]
    });
    
    
    function initPageLayout(){
    
    
       pageLayout.draw();
       supplyGrid.setOverflow("visible");
       supplyGrid.body.setOverflow("visible");
    
    
    
    }
    
    supplyGrid.fetchData({units:"Box"},"initPageLayout();");
    
    </SCRIPT>
    </BODY></HTML>

    Just for comparison sake, I tried the same Print Preview action with a plain old html table and both browsers can print it fine with multiple pages:

    Code:
    <HEAD><TITLE>
           PLAIN OLD TABLE
    </TITLE></HEAD>
    <BODY BGCOLOR=#D3D3D3>
    
    
    <table>
    
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    <tr><td>test</td></tr>
    
    
    </table>
    
    </BODY></HTML>

    #2
    Excellent question. Printing is one of those areas that seems like it should "just work", but turns out to be more involved.

    There are two issues - one is that it almost never makes sense to just print a RIA page - typically what's needed is more of a reporting style functionality where different contexts have a print functionality attached to them and generate output that looks significantly different than what's shown in the UI. The reasons for this are pretty obvious - you really never want to print scrollbars or any other UI controls that allow you to reveal content - instead the content should overflow on the printed page.

    The other issue is the one you're pointing out - which is that that default browser behavior wrt printing a page is underwhelming. The primary reason for this is the browsers' inability to intelligently chunk absolutely positioned components.

    Solutions to both are coming in SmartClient 7. This is an area where we've been actively developing the framework to provide reasonable defaults and an extensible system that allows customization of printed views. We'll have more to share soon.

    Since you're an enterprise support customer, we'd be happy to share a beta version of this functionality if you're interested.

    Comment


      #3
      I have downloaded version7..Request you to point to the place where the PrintPreview Example is present in the feature explorer...I have asked this question earlier also and no clear answer..

      Hope you will point to the exact place of printpreview in your version7 SDK / Feature Explorer..

      Thanks
      Bhim


      Originally posted by Isomorphic
      Excellent question. Printing is one of those areas that seems like it should "just work", but turns out to be more involved.

      There are two issues - one is that it almost never makes sense to just print a RIA page - typically what's needed is more of a reporting style functionality where different contexts have a print functionality attached to them and generate output that looks significantly different than what's shown in the UI. The reasons for this are pretty obvious - you really never want to print scrollbars or any other UI controls that allow you to reveal content - instead the content should overflow on the printed page.

      The other issue is the one you're pointing out - which is that that default browser behavior wrt printing a page is underwhelming. The primary reason for this is the browsers' inability to intelligently chunk absolutely positioned components.

      Solutions to both are coming in SmartClient 7. This is an area where we've been actively developing the framework to provide reasonable defaults and an extensible system that allows customization of printed views. We'll have more to share soon.

      Since you're an enterprise support customer, we'd be happy to share a beta version of this functionality if you're interested.

      Comment


        #4
        If you are running it on your local machine on port 8080 (the default), it's at: http://localhost:8080/isomorphic/sys....html#printing. Or, you can find it in the Feature Explorer example tree under "Basics"

        Comment

        Working...
        X