Native PDF Generation for MX DataGrid, AdvancedDataGrid and Spark DataGrid

clock February 22, 2016 07:24 by author Flexicious

For those of you who recently upgraded to our latest 3.3 release, one of the biggest enhancements was support for Native PDF generation. AT the time of release for 3.3 we had only implemented this for our Ultimate DataGrid. However, we are aware that a significant number of you are also using our Classic product - our Extended DataGRid, AdvancedDataGrid and Spark DataGrid. - and to accomodate your needs, we have implemented the same support for those three products. 

You do need a new build get this support - so please request a build even if you have 3.3. 

Below is the complete sample project:

PDF Test.zip (290.27 kb)



Native PDF Generation From Flex DataGrid with images

clock February 16, 2016 00:18 by author Flexicious

For those of you who recently upgraded to our latest 3.3 release, one of the biggest requests had been support for custom item renderers with images in the PDF generation routine.  The older PDF mechanism basically grabs screen shots of the grid and adds to the page. This works great and most scenarios but the biggest drawback of this mechanism is the quality of the PDF. This is because a screenshot is at the end of the day a bitmap image. It is not a vector and it doesn't scale. So in 3.3 we changed that and added support for generating PDF documents using the grids rendering mechanism - however, there was a catch - we could only render text. This made things like images not render in generated pdf documents. However, since a number of you asked for this, we added support for images as well.

Below is a sample that demonstrates this functionality. It was not very easy to accomplish this - but we always appreciate a challenge!

Quick Note : The developer who made this sample is a cricket fanatic, a game which some of you might be familiar with :-) For those of you who arent, its a game that originated in England but is played the word over very similar to baseball.  

Enjoy!

Sample code: Cricket.zip (192.18 kb)

Generated PDF: Test0.6235653976909816.pdf (135.43 kb) 

 



Maintain open items in Flex DataGrid

clock February 15, 2016 17:10 by author Flexicious

Question : "Could you point me to a tutorial or sample app that stores the open items on NestedDataGrid, then after updating of the dataProvider, opens up the same items on the displayed datagrid."

Answer :  

 

Have you set a selectedKeyField? Here is a key piece of information: The grid stores the list of open items in grid.openItems. When you replace the dataprovider, the grid will clear out the open items array, unless you set clearOpenItemsOnDataProviderChange to false. But even if you set it to false, for the grid to keep track of what is truly open, it needs to know which “object” in your dataprovider is open. Now, for this the default test is object equality. So, if you change the dataprovider, object equality test will fail, and items will still be closed (because the same business object in the new dataprovider may not match object equality test for the version of it in the old dataprovider – setting the selectedKeyField helps us bypass this problem by identifying ‘open’ and ‘selected’ records post a dataprovider refresh. please read this link to understand : http://htmltreegrid.com/newdocs/html/Flexicious%20HTMLTreeGrid.html?SelectedKeyField.html ). So, there are 2 options

 

1)       Set clearOpenItemsOnDataProviderChange to true (default) and set grid.openItems manually after you set the dataprovider

2)       Set clearOpenItemsOnDataProviderChange to false, and let grid maintain openItems, but set the selectedKeyField when you do this so the grid knows which object in the new dataprovider are equal to the ones from the old.

 

 

Attached is a sample

 

SelectionOptions.mxml (4.57 kb)