I have data in Grid.MVC and now I want export data after filtered or sorted. I don't know how to do it.
Please help me.
Thank all.
I need to export the data in Grid.MVC to Excel. I used the solution in this link:
http://www.adambielecki.com/2013/05/exporting-data-to-excel-and-csv-in.html
It working but i have a problem, i want export data after filted or sorted.
So heres the help I can give you... I had to do this a few years ago with the same technology. Think of the Grid.MVC filtering as "client side". On the server's point of view, the bucket of objects filling the table has not changed when you do filtering, so what I had to do was hook into the filterboxes on the top of the grid by their css names and use a post back of filter objects to the viewbag which were then used in a linq query to filter the objects to the set I desired, from there I was able to export. This was super hard, and I cant access any of my old code b/c it was for a different company.
I would suggest not puttin the effort in, see if your users are okay with "post filtering" since excel is pretty much made to filter / sort data anyways.
Sorry I could not be more help but I hope this gets you started. good luck.
Related
What is the best way to create a Custom Report Template to print in Oracle Apex ? I saw some posts that've already been answered, but since they were Apex 5.1, I was wondering if these were still up to date, or if there are easier way no (I am using Apex v21.1). Also, the "Printing" attribute in the Reports does not give me the possiblities to do these specific things :
I would like the users to print an Interactive Report, which will display the logo of the company, the export date, and the data obviously. Is it possible to set custom margin so the list take more space on the page, and to set a custom size for the column, in case I have a column with a long text in it ?
Thanks in advance,
Thomas
Welcome to one of the weakest points of Oracle APEX, printing.
Honestly, the best option is Apex Office Print(AOP), but they are a paid plugin.
They enable lots of different printing, quite easy to grasp, and I am quite satisfied with them.
Other options I have seen are:
Make an excel sheet from within the database and you can generate that dynamically(you can also expand fields, colour them, probably can also put an image in there but I havent tried that).
I once decided to torture myself and I tried printing through HTML, as in I created an HTML document with the data I wanted(I made an invoice), but that has many problems, chief among them being page breaks.
Another option that was recommended to me, but that I have not yet tried was setting up an Apache FOP, having the Oracle database generate an XML, send it there and get back a nice looking pdf(http://www.apex-reports.com/videos.html).
I hope you get something working, and if you try this Apache FOP approach please let me know how it goes.
On our website, it is possible to tag content by a country list. This country list could be implemented as a tag control but I'm concerned about mis-spellings creeping in over time. However, the country list is very long (150+) so not ideal for a dropdown multiple control either.
What I'm looking to do is have a control that has the same type + autocomplete functionality as the existing tags control but limit the possible values to those retrieved from a database table.
I also want to be able to list all tags that a piece of content has been tagged against as well as searching for content based on tags e.g. GetNodesWithTags
Has anyone developed anything like this before? I've had a look at packages etc but can't see anything similar. Does anyone have any advice before I start off?
Definitely, using Tags datatype for this may cause a lot of problems :)
In my opinion, the perfect solution will be to use nuPickers (https://our.umbraco.org/projects/backoffice-extensions/nupickers/) package and available there TypeaheadList Picker.
Depending of your additional requirements, you may use Lucene index / C# accessed source (totally custom - db, static, enum etc.) / XML file source as a prevalues for your control.
Then, you'll be able to create logic which will enable you to perform search based on this field as it will be a typical property with value on the nodes. Once again - suggested way is to use Lucene Examine index as it's tailored to be fast with searching. You can read more about searching with Examine here: https://our.umbraco.org/documentation/reference/searching/examine/.
Hopefully it will solve your problem.
I have an ASP.NET MVC website and my client would like to export data to an excel spreadsheet but a certain template needs to be used. All the data is pulled dynamically from a MS SQL database.
I have used this thread as a start up point, open xml excel Insert actual value in the placeholder. It works well for me with regards to replacing placeholders in an excel template with data from the database.
However, I am completely stumped when it comes to placing a complete table with data directly into a cell, i.e. A10. Also, each row in the table has an image in the first column.
I thought about replacing the "{table}" placeholder with a html table containing the data, but with the research I have done, it doesn't look like that would work. If I am correct about it not working, could you please point me in the right direction?
Thanks in advance for any help.
I have found a solution using OpenXML through this tutorial by Eric White on the MSDN site.
Hope this can help someone else.
I'm currently working on a drilldown filter in MVC but I don't really know how to make this the fastest and most flexible as possible.
click here
Now my question is, how do you think they are doing this?
I've really no idea how to make this kind of drilldown but it seems they use some kind of hash they save for quick querying.
Maybe (pseudo)code anyone?
If you're willing to give up a little browser compatibility (it won't work on ancient and some console only browsers but then again neither will anything else), jQuery DataTables is a great way to make drilldowns.
Here is the main site, and Here is a good example of using a dropdown select to filter.
Basically all you have to do is throw all the data into a large <table> and use javascript on the client side to filter. The big benefit is there is no latency when you make a selection, unlike the site you linked.
I think it is not a good idea to put all data on the client side.
It is more reasonable to trust the data filtering to the database server (of couse it depends on your data size).
To speed up receiving the filtered data you can save it in your cache server with hash or select query as tag. Query to cache is faster than to database.
The answer after carefull looking at how they do it:
They send a normal http POST to the server with a querystring of all
choices.
The server sends back a http GET which returns an URL with the
hash.
The server caches the hash with the query so the next time the query is called it is faster.
Thanks everyone for your "usefull" responses.
I am running a code with ASP .NET MVC jqgrid that populates the grid with data from the database.
The code is taken from :
http://jetmathew.wordpress.com/2011/03/02/asp-net-mvc-2-with-entity-framework-json-jquery-and-jqgrid/
The problem is that when I go to second page and sort the data with any column. It sorts the whole data but takes me to 1st page.
I want to remain on second page with whole sorted data. Is this a bug? And is there anyway around to get things go my way?
The sane thing is happening on all examples on this link as well.
http://www.trirand.com/blog/jqgrid/jqgrid.html
It's not a bug. Think about it, what meaning does the pagenumber have when the sortcolumn changes? IMHO none since you are looking at a different dataset...
What are you trying to achieve here?
edit
Craig Stuntz added Jquery BBQ integration to Jqgrid. This enables url history to jqgrid.
Using this you can take the current page from the querystring.
http://craigstuntz.github.com/jqGrid/
I still stand by my original answer though :)
/Daddy