Printing with multi window applications

clock February 14, 2011 11:36 by author Flexicious

We have had a couple of customers report issues with printing in multi window Air applications. Basically the issue revolves around the print preview not using the current window, and appearing in the parent top level application window instead.

This issue has been addressed with 1.5.2. Attached, is a sample application that uses the new popupParent property to control which window owns the preview popup.

As always, drop your licensed copy of the library into the libs folder.

PopupTest.zip (51.93 kb)

 

================

For Ultimate, use the attached CustomPagerControl Instead.

MyPager.mxml (941.00 bytes)



Print Customization Questions

clock February 14, 2011 10:40 by author Flexicious

Some Print Related questions:

Is there a way to force Flexicious to print multiline / wordwrap content.
-> On your datagrid, try setting variableRowHeight=true, and wordWrap=true. Please see attached example for a demonstration.
MultilineTest.mxml (4.39 kb)

Another issue we have is the font size of the print out, it is too large so we aren’t able to fit much content, is there a way to decrease the font size for printing purposes
-> You can do this by applying a global stylesheet. See style.css from our sample and search for PrintDataGrid. You can specify font-size in there.

One other issue is we like to print out large data grids on 11x17 paper, and that’s not one of the options for PDF or printing.
-> You should be able to add a custom page size in MyPreviewRenderer.mxml. Please see attached MyPrintPreviewRenderer.mxml that demonstrates how to add your own custom page size. Please note, adding a page size here, or changing the orientation does not actually print. It just shows you a preview. Flex runs inside the browsers security sandbox, and we have no means of accessing the print dialog.

MyPreviewRenderer.mxml (9.79 kb)



ICustomMatchFilterControl example

clock February 11, 2011 21:23 by author Flexicious

We have had a couple of requests for an example of ICustomMatchFilterControl. This was a newly added feature to 1.5.2, and does not exist in the sample. Attached is a sample project that demonstrates how to use the custom match control. This is applicable in scenarios where you filter control needs to perform additional logic beyond what is covered by the built in filter operators. For example, in this case we search that that text that the user entered exists in either the first name or the last name of the employees. As always, you will need to drop your licensed copy of the Flexicious Library in the libs folder for the example to run.

custommatch.zip (14.06 kb)



How do I prepopulate the print columns to only include the currently visible columns?

clock February 11, 2011 06:45 by author Flexicious

To do this, you may use the printOptions columnsToPrint property. Attached are a couple files that demonstrate how to do this. A slightly modified version of the CustomPagerControl, that passes in the current grid to the MyPrintOptions.as file, which iterates through the currently visible columns and adds them to the columnsToPrint property.

 

for each(var col:Object in grid.visibleColumns)
      myPrintOptions.columnsToPrint.addItem({"name":col.headerText});

 

Please note, if you want to completely prevent a column from being printed, you can use the excludeFromPrint property.

MyPrintOptions.as (2.19 kb)

CustomPagerControl.mxml (8.75 kb)



Multiple initializers for property 'dataProvider'.'dataProvider' is the default property of

clock February 3, 2011 10:34 by author Flexicious

Who wants to guess what is the cause of this error with the below markup:

 

<ExtendedAdvancedDataGrid ...

dataProvider="{getHosts_pagedResult.lastResult}" ...

           columns:SelectAllAdvancedCheckBoxHeaderColumn width="15"

           ... (more columns here)

</ExtendedDataGrid>

If you figured it out, kudos for being able to read the compilers mind :-)

The issue is the missing declaration of the columns tag.

<grids:ExtendedAdvancedDataGrid ...

dataProvider="{getHosts_pagedResult.lastResult}" ... >

<grids:columns>

            <columns:SelectAllAdvancedCheckBoxHeaderColumn width="15"/>

           ... (more columns here)

</grids:columns>

</grids:ExtendedAdvancedDataGrid>

 If only the compiler spoke the same language as we do :-)