Select to view content in your preferred language

Printing data in results window

1019
8
06-07-2012 12:35 PM
EricGardecki
Deactivated User
I've been asked to come up with a way to have a print-friendly, and quick, list of the features returned from a search (i'm using the eSearch widget).  Currently, the results appear in the data grid and can be exported to csv, which can be opened in Excel and formatted as-needed, but it's much more difficult than what our users were able to do with a previous system.  There, the selected features' attributes would be sent to a table on a webpage that would be preset for printing the results on a letter-sized page.  It was a quick way of selecting parcels and printing out a list of ownership information for them. 

I don't see any other widgets out there that may be able to help, but I may have missed something.  Ideally it would be some adjustment to the eSearch widget anyway as it is already in use.  I'm envisioning another export button that opens the data, in a structured way, in a webpage or a pdf, but I have no idea how to begin to go about that.  Is this possible?  Are there alternatives?  Any suggestions on the best way to handle this?  If it can be done with some editing of the eSearch, where do i begin?

thanks!
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Eric,

   Printing is so situation/data specific that I will not be adding any printing capability to my eSearch. You can though, just Google Flex 4 print datagrid and you will get lots of results. Flex has a print job component that would work. Best of luck to you.
0 Kudos
EricGardecki
Deactivated User
I'm pulling my hair out over here on the most simple thing.  Certainly feel stupid!  I can't for the life of me figure out how to bring the uncompiled files from eSearch into Flash Builder!   I can't start learning more if I can't even begin.  It's not a project that i can import and starting a new project doesn't seem to work either...maybe because I don't know where to put the files in the structure.  I can't find any tutorial on how to do it. ugh.

I found this article that seems to be something to work with http://flex.exposedout.net/2008/10/printing-datagrid-in-flex/ , at least to try out and see if it'll work for me.

My assumption was that I would take the mxml files that are attached there and add them to the eSearch, compile, and see what happens.

Am I even on the right track with that?  But more importantly, how do bring the widget into FB?

Thanks for any info that can get me started with my journey out of ignorance...
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   You have to get the Flex Viewers source code and import that. There is a ReadMe.txt in the download that will walk you though all the steps for importing the project. Then once you have the Flex Viewer project setup in Flash Builder than you can copy the eSearch uncompiled folder into your project under the widgets folder. Hope this gets you started.
0 Kudos
EricGardecki
Deactivated User
I didn't realize that it all had to be compiled together like that.  I already had the FV project loaded up. 

I couldn't get it to compile due to some errors with eSearch and the new files I added but I don't think it matters as after looking at the code it seems like it won't work.  It was hard coded to display a set list of data, not whatever data happened to listed in the datagrid at the moment.  Plus, I'm in over my head as I'm unsure of how to begin to make changes and I can't find much of anything on the internet.

I did find this thread from a few years ago:  http://forums.esri.com/Thread.asp?c=158&f=2421&t=292246  and it sounds like it could be what i'm looking for (although dated) but I don't know what to do with the code, where it goes and what needs to be changed.  Robert, in that thread you said that you are already doing this in an app of yours but here you said you won't in eSearch.  Do you have some other method/widget you are using that you could suggest or do you just no longer print data in your apps?

I really need to find a way to accomplish this (printing data from multiple selected parcels)...but I'm no developer

thanks
0 Kudos
EricGardecki
Deactivated User
Also...I've been spending quite awhile looking into "AlivePDF" to see if that'll help with my issue but despite tons of info out there, it's still very confusing.  Am I even on the right track looking into that?

No one prints search results/datagrid?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   That thread you referenced is not print form a datagrid it is just taking a graphics results and adding them to the bottom of a map on a print page (i.e. only on record). Alive PDF is good but it is also complicated. I don't print data from datagrids so I don't have any code examples. Maybe someone else does.
0 Kudos
EricGardecki
Deactivated User
I assumed that your search widget created a graphics layer and then displayed the data from that layer in the results.  So then I thought if it can be done with one record why not more than one?  But not sure where I got the idea that a graphics layer was involved.

Good to know that I'm on the right track with AlivePDF at least.  There are tons of posts available talking about it but I can't find one that is a thorough description of how to use it.  Most just say "here's my code" but I don't know where to put it.  Also, they mention the need of a pdf creator and there's no explanation of that.....and if Alive is creating a pdf why would there need to be another component? grr.  yes it's complicated.

I'll just keep digging. Hopefully someone familiar with AlivePDF in this way can assist further.

Thanks
0 Kudos
EricGardecki
Deactivated User
you'll probably be as amazed as I am...but I actually got this to work finally! 🙂  

I get a pdf with an image of the data grid.  Not really ideal but it appears as though it may work well enough.  (as long as there isn't more data than window size!)

My issue now is that I need to adjust things to get the image to display everything in the datagrid.  Resizing the grid so that all of the columns and rows are visible works but I'd like to experiment with some things.  There are two things I was hoping you could answer.  Where do I adjust the font size of the data in your widget's datagrid?  I can't seem to find it anywhere.  And Is is possible to have the datagrid sized to fit all of the contents automatically? As in, no scroll bars.

Oh and one other unrelated question.  I have a number field that somehow gets interpreted by AGS as having around 13 digits after the decimal place (despite the data only having 2), so I'm using the widget config to set it back to 2 when displayed.  However, it would seem that the code you have for sizing the column widths to fit the contents uses the data prior to the config's shortening of it.  Is it possible for this to change so that the column fits the adjusted formatting?

thanks!
0 Kudos