Excel like server side control for ASP.NET - asp.net

We have a requirement to increase the functionality of a grid we are using to edit on our webapp, and our manager keeps citing Excel as the perfect example for a data grid :/ He still doesn't really get that a Spreadsheet like control doesn't exist out of the box, but I thought I'd do a bit of searching nonetheless.
I've found a couple of products on Google, but was wondering if anyone else has any feedback around any such controls (obviously the cheaper or ahem freer the better)
EDIT We do currently have the Telerik controls, but what the 'current' requirement is, is a control that can copy and paste (e.g) 3 cells from one row and paste them on another, the row by row editing of Telerik doesn't really cut it. We are currently in competition with an 'Excel' based solution, which is always a nightmare in winning users around, who always prefer flexibility to structure

Update: with Silverlight fast approaching, maybe you can use a real excel control.
Devexpress has a powerful grid control for both web and windows. It is not free and I guess nothing really matches Excel. But once the users started using it, they wanted every app with it. Check these videos especially the data grouping one.

You may consider 3rd party tools of native Excel functionality. There are most buzzed on the forums:
Aspose Excel Cells
ComponentOne XLS for .NET
Or Excel Jetcell .NET.

This may not be directly related to your question, but on the server side have you considered what operations you will need to perform that will mimic Excel? You may want to check out SpreadsheetGear which will give you complete macro functionality.
They have new charting features that I haven't used yet, but they are supposed to work with Asp.net.

Related

Tool for Overlaying User Data on Government Form

I'm working on a project where user's submit data and then it is put onto a state form that they can print and submit. To give you an idea of what I'm talking about, the form looks similar to an IRS 1040 form (https://www.healthykids.org/_img/document_1040.gif).
We've recently discovered that the form generated by our software isn't close enough to be accepted by some state's OCR process.
We're looking for some way to quickly create stylesheets or something similar so that the data can be overlayed on a scan of the original form and then printed. We've tested to ensure this works, however the lost time of trying to get the positioning right for every version of the form for each state has become a huge problem.
I'm looking for a tool or technique that would help me roll out each form faster.
The web application is based on Code Igniter. Our company prefers open source solutions but if a proven proprietary product exists we would certainly use it due to the critical nature of the issue.
Thank you very much for any help.
First, the obvious. Most web IDE's do this with ease (I know both Microsoft Visual Studio and Adobe Dreamweaver would allow you to visually position the elements above the image without problems).
I take it you are looking for a tool that lets you design the forms as part of the web application itself. One of the related links points to Suggestions for a JavaScript form builder?.
Other than that, if you know your Javascript and jQuery/extjs etc, it should be pretty quick to write a simple "put the textfields above the image" (absolute-positioning + drag and drop) type of web interface.

Why should I choose Crystal Report or SSRS over plain HTML table?

I am using ASP.NET MVC. Sometimes I work with ASP.NET Web Forms too. I can pretty much create my queries using stored procs or LINQ and render my report just using a plain HTML table. With proper styling it should come out decent.
I don't know SSRS but I have some experience working with crystal from before. The only advantage I see from using crystal for my reports against just a simple HTML table is that it can export to PDF. But I could probably get some third-party library that can do that too. Regarding charts like pie and bar graphs there are a lot of javascript tools available out there that does that and they're free.
I guess I'm posting this to see what I'm missing with reporting tools like Crystal and SSRS.
EDIT: With ASP.NET MVC it is not particularly difficult to create the report. Just formulate the correct model, create the controller action and view with scaffolding (Detail) and you will have the code generated for you right away. With ASP.NET Web Forms it is probably easier, just use a GridView and you're done. For both cases all that is left is the CSS. With Crystal you also need to edit the layout you have generated the report, which is work still as well.
The reason we use SSRS for our internal reports is that our database guy can create reports without having any knowledge of how to format output using code.
your points are valid and I have been thinking about such things multiple times.
Personally I used CR in the past and SSRS more recently, but my absolutely best experience was with DevXpress XtraReports, super cool design and royalty free end user designer with or without Ribboned interface.
the difference between using a report engine or plain raw HTML is in the way you design the reports and the overall features.
in XtraReports for example, the lovely thing is that a report is simply a .cs file (C# class) and whatever you design with the UI designer is stored in that file exactly like the windows forms designer does ( or ASP.NET aspx and aspx.cs designer does ). So you see the report you are designing and you Drag & Drop controls and place them where needed. Then you have out of the box formulas, running totals, page breaks, as you mentioned export to pdf, excel, jpg, html, word and so much more.
if I was free to choice again I would go again for XtraReport and forget about plain and raw html table coding, let's focus on the real business of the application we write and not get nuts with page breaks, exporting things and in house implemented formulas or group/running totals... this is my idea and approach at least.
The biggest reason for me to use a reporting engine is for printing and page breaks. You can't always guarantee the way the HTML will format for all the various browsers and it's not great for setting hard page breaks. With a reporting solution, you can group things together to force page breaks to be more predictable.
This is especially important if you're looking for a more professional looking report.
as already stated above using another report generator can have much benefits. I've used very often List & Label. There is a completely different concept behind and depending on your needs it will be easier but still powerfull, especially for .NET reporting. It is worth to do a trial (there is even a free edition available).

UI control to display data in the form of Grid

Is there any UI control which displays data in the form of grid?! And have the following features:
I should be able to hide/unhide
columns.
A popup to show up on click of the
header. The pop-up will behave like a filter. It will have all the unique values in that particular column. The user can select the values that are to be displayed.
Is there such control in JQuery/Flex/extJS or any other UI framework?
Thank You
EDIT I want to replicate the Excel in the Web UI
Easy answer
Most of the commercially-available grids have this kind of stuff, but it depends what framework you're using.
jQuery Grid is pretty cool and of course doesn't really rely on a back-end framework. If you're using .NET WebForms, check out offerings from Telerik and DevExpress. Telerik also have a ASP.NET MVC suite of stuff (which, I believe, is free).
Devil's advocate
There is a school of thought that suggests grids aren't really a good UI. It's true that people love Excel, but even MS and Google are struggling to replicate Excel in a web UI (though they've done quite a good job). The reason WPF shipped without a datagrid is because the ListBox, when combined with DataTemplates, is soooooo much more powerful than a pre-prepared grid control that one wasn't really necessary.
One way out of this problem is to try and think your way out of needing a grid in the first place. Consider task based UI, and maybe CQRS, where the grid/reporting requirements are solved in a completely different way (e.g. SQL Server Reporting Services).

Creating a scheduling / calendar grid in ASP.NET

I am working on the prototype for a scheduling application on an intranet system. The application is for scheduling and tracking promotional workers at various locations on various dates.
Currently, only for prototyping, I am generating a data table of location/date, and from this I iteratively build an HTML table (asp:Table control). On visiting each cell, I query for people working that location-date and populate the cell accordingly. This is very inefficient, and will at worst be improved by querying cached data for the whole location/date grid.
I'm looking around for established patterns and techniques for dealing with scenarios like this in HTML in general, maybe a visualization library for jQuery or something, and for ASP.NET in particular, maybe a library for implementation on a GridView etc.
Am I going in the right direction with this, and if so, what recommendations are there regarding the previous paragraph?
As regards the user interface, I would take a look at the Telerik scheduler control and see how that one is done. You don't want table cells stretching the layout, and even filtering may not help you unless you truncate the displayed text as a link to a modal pop-up, or some kind of master-details set up.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/overview/defaultcs.aspx
Why don't you try placing the calender control on the left side and then select the current date by default. Thereafter user can select a date and you can list the data using a gridview based on the selected date-location. That should ease up the interface as well.
These controls are complex, and there are many third party vendors out there with components like these. Take a look around at some of the components available to you, as it is A LOT of work to develop a component like this yourself (we were going to attempt to do it, but realized to make it efficient and usable we needed to buy one, so we purchased Telerik).
HTH.

Who actually uses DataGrid/GridView/FormView/etc in production apps?

Curious if others feel the same as me. To me, controls such as datagrid/gridview/formview/etc. are great for presentations or demo's only. To take the time and tweak this controls, override their default behavior (hooking into their silly events etc.) is a big headache. The only control that I use is the repeater, since it offers me the most flexibility over the others.
In short, they are pretty much bloatware.
I'd rather weave my own html/css, use my own custom paging queries.
Again, if you need to throw up a quick page these controls are great (especially if you are trying to woo people into the ease of .NET development).
I must be in the minority, otherwise MS wouldn't dedicated so much development time on these types of controls...
­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­
Anyone that thinks nobody uses *Grid controls has clearly never worked on an internal corporate webapp.
I'm pretty much writing my own HTML - I'm using the ListView and Masterpages, but not really using the controls much anymore. My ListView laughs at your silly old repeater, by the way.
However, bloatware isn't necessarily a bad thing. If I needed a low volume intranet application built, I'd much rather pay a less experienced developer to drag and drop controls than for an HTML twiddler (like you or me) to craft each tag. There's definitely a place for the quick, simple approach. What's the cost of "bloatware" in that scenario, as long as the control based code is written in a maintainable fashion? Often wiring controls together requires less custom code, which means simple maintenance.
The one place I have to disagree with you - pretty much regardless of the application - is in crafting your own paging queries. You may like to do that kind of thing, but there's absolutely no business value in it. There are several professional-grade DAL tools which will usually write more maintainable, faster queries than most developers. Even if you lovingly craft the perfect paging query, it won't keep up to date with changes to the schema unless you continue to throw hours after it. I think better use of those hours is to build a lightweight system and put those hours into monitoring and fixing specific bottlenecks, rather than immediately jumping to the "database assembly language" layer.
I've been reading your posts guys and it made me feel dumb.
I mean in every application I made where I work there is at least one datagrid/gridview in it. And I didn't have the feeling I am missing something.
Sure I find datagrid/gridview kinda bloated but are they that much disgusting to use?
I think you need to learn to use GridViews before you condemn them. I use them extensively. At first it was a bit challenging to figure out certain things, but now they are indispensible.
GridViews within UpdatePanel with AJAX CRUD and pagination are lightning fast. One of the larger systems set up this way (for internal/external application) has a moderately sized db in the backend. There are many nvarchar(2000) fields and the transitions and updates are great.
In any event, if you've written your own version of displaying data, you may want to continue using it if it works. (Same argument could be made for writing your own compiler, writing your own version of HTML, writing your own version of data access binaries...) The advantage of using GridView is that there are a lot of people who are familiar with it and that MSFT has abstracted/modeled the class to do a lot of things that we used to have to do manually.
Every single app we development at my company has grids (the apps are all behind the firewall). That includes both web apps and Winform apps. For the web apps it's the good ole gridview with custom sorting for the winform apps we use Janus grid. I'm trying to get the developers/users to think of a better user interfaces but it's a tough to change. I gotta admit its still better than the alternative of the users building their "own" apps with Access that I would then need to support!
Using controls like the GridView are great for simple apps. Even if you are a server-side HTML bracket-twiddling ninja, they can make developing simple stuff much less time consuming. The problem is that they usually start to expose their shortcomings eventually, and you end up having to spend time tweaking them anyway. But at least you can get up and going quickly to start out with.
For example, the default paging in a GridView doesn't support paging in the database itself (you have to load all the rows before it will page them), so once you start feeling that pinch in performance, you may need to think about rolling your own or, perhaps better, find a more capable grid control.
Anyway, the point is that pre-built components are good. They help. But as usual, it depends on what you need them to do.
I've actually used GridView extensively for an adminsitrative console. I even created a custom DataFieldControl that sets the field's header text and sort expression based on data field, creates an Insert row in the bottom and automatically collects the values in the row and forwards them to the data source's insert method, and generates a list box if an additional list data source is specified. It's been really useful though a huge time investment to build.
I also have another control that will generate a new data form based on the fields' metadata when there are no records (in the EmptyDataTemplate).
<asp:GridView ...>
<Columns>
<my:AutoField HeaderText="Type"
DataField="TypeId"
ListDataSourceID="TypesDataSource"
ListDataTextField="TypeName" />
</Columns>
<EmptyDataTemplate>
<my:AutoEmptyData runat="server" />
</EmptyDataTemplate>
</asp:GridView>
I really like the telerik radgrid. Their product ain't cheap, but you get a lot of controls and features. And the data binding support is pretty good, both in a simple asp.net data source binding way and in a more custom handle-your-own-databinding-events kind of way.
At my company we use grids everywhere, mostly ComponentArt Grid (http://www.componentart.com/). Yeah it's bloatware but you get a lot of functionality that wouldn't be much fun to re-invent: sorting, paging, grouping, column reordering, inline editing, templating (server-side and client-side). The client-side APIs are nice too.
I like the GridView control and have used it in several custom DotNetNuke modules for my company's web site. For one thing, using the built-in controls means less dependencies to worry about. And once I had it set up how I wanted it, I basically copied the code to other pages and just had to do minor tweaks.
I've found that there are so many options with modern grid controls (Infragistics, Telerik, etc) that it takes longer to configure the grid than anything else. The MS controls are pretty simple yet they can do pretty much anything.
They are one of the benefits of asp.net. Up until just recently I hated them, but the more you use them the easier they become, once you learn what setting you must change for which instances. Mainly I like the form view and listview the gridview still needs some work.
We use the Infragistics UltraWebGrid + LinqDataSource on our intranet apps.
It gives us ajax, sorting, filtering, paging all server side.
The "export to excel" also is a killer feature.
We have 5000+ users,lots of data, performance is excelent.
I largely abandoned grids once I started designing from user stories, rather than from database table requirements. And never editable grids. The old way was just how we coerced users into doing data entry/table maintenance for our systems, and it never matched their workflow - any real job ended up skipping from one master/child form to another.
And the users never figured it out - but they sure knew our applications were harder to use than they should be.
An exception is analytical applications. But there are relatively few of those, and they are largely read-only.
I too would like to see an expanded answer on why GridView et al are considered "bloatware." I have extensively used GridView as well as 3rd party products (Telerik, etc) and find that for the majority of internal and some external projects, they work great. They are fast, easy to use, customizable - and BEST - I can hand them over to someone who knows GridViews who can then easily pick up where I left off. If I were to hand-code all of the numerous apps/controls, the overhead in the next person figuring out what is going on would be enormous even under the best of circumstances.
For me, I can see some of the 3rd party products being bloatware (but still sometimes useful), but the bare-bones GridView I've found to be quite fast with moderate queries.
For my corporate intranet projects, grids are indispensable. They are the foundation for easy reporting on the ASP.NET webforms platform.
Easy to Design
Paste the grid on the page. Insert BoundField objects for simple binding. asp:HyperlinkField for easy linking.
Binding
You can bind grids in a handful of ways:
a collection of objects (List, ArrayList, Hashtable, or any simple collection)
SqlDataReader in your code-behind (yikes, that would require SQL in your presentation tier)
SqlDataSource (specify a stored proc. All the columns on the resultset map directly to the grid's columns. It's a very quick and dirty if the report doesn't mimic your domain object nicely. i.e. summations of different things.)
objectDataSource (binding to a method on your BL)
For those who might call out SqlDataSource and ObjectDataSource, you don't always have to have them declared in your .aspx.cs or .aspx.vb . I am not advocating them here, just pointing out the possibilities.
I don't think you can discount the RAD benefits of the built-in GridView and other 3rd party grids. Management types love and want tabular data.
Components like the GridView/FormView/DataGrid follow the 80/20 rule.
This means that 80% of the time when you use them for simple purposes they get the job done and are extremely easy to implement.
But 20% of the time you will be trying to build something complex (or weird) and you will be forced to jump through a dozen hoops and bend the code in many ways to try to implement a solution.
The trick is to learn whether the problem is an 80 problem or 20 problem, if you can identify the 20 problem early you are much better off writing the code from scratch yourself and ditching the "time saving" one.
I use them extensively in the corporate environment I work in and I'm working with one right now. The people who don't use them remind me of all those "I built it with Notepad" developers of years past. What's the point of using asp.net if you're not going to take advantage of the time savings?
I have never used it. I completely agree, it's bloatware. I usually end up using the repeater with custom controls that i made.
For anything long term I would try to avoid datagrid/gridview, it sometimes becomes too hacky making it do exactly what you want, after a certain number of these tweaks you start to realise its not saving time in the long run and you might not be getting the control over markup that you need.
However the built in paging and sorting functionality works well and in 2008 there is a new ListView control which aims to sort some of these problems out and give you tighter control of the html that is output.
I have wondered about this for a long time. There seems to be a consensus here that the grid controls are bloatware. But, can anyone definitively cite the cost of using these controls? Is there excessive HTML sent to the browser? Too much resource devoured on the server? Is generating the HTML table faster (assuming it's well-written)?
In addition to the bloatware issue, I have often run aground when UI requirements are enhanced to include features beyond the scope of the standard controls. For example, in early ASP.Net versions, I struggled with putting images in column headers. And, I believe it's still a challenge to add a second, top-level header row spanning multiple columns. At some point, it becomes really difficult to wrestle with the control to achieve the desired effect. And it's frustrating if you know the HTML you want, but you just can't make the control do it.
On one project, I finally gave up and wrote myself an HTML table class to generate a very complicated grid. It took a couple of days to get it just right. But, now I have the basic code, and it will be much more efficient to tweak that for future grids.
No doubt about it, though. It's hard to beat the fancy grid controls for speedy development, if you can just live within their limitations.
If you work with designers a lot on public facing web sites then you should ditch the GridViews and stick to repeaters. That's my opinion anyway - I've had to pull apart hundreds of GridViews and turn them into simple repeaters in order to fulfill the design requirements.
If you go near DataGrids or GridViews with a 10-foot pole on a public facing web site then you HAVE to use the CSS friendly Control Adapters. (At this point you might find it easier just to do it in the Repeater.) Prior to Control Adapters being available I would have considered these controls broken out of the box.
I find that too many .NET developers do not have a good understanding of design, accessibility, CSS, javascript, standards etc. which is why they succumb to GridViews, ObjectDataSources etc.
GridView is fine and very powerful control and works well with css or theme. The only thing that is annoying me is that VirtualCount property was dropped when old 1.1 DataGrid was replaced with GridView in asp.net 2.0 and it was useful for implementing custom paging. However same can be done via data adapters.
Though working with repeaters is maybe clearer and you have total control over rendered html still I wouldn't recommend going on that ways because is harder to implement and maintain.
I never really used the standard WinForms grid before but at my last job we used the ComponentOne FlexGrid extensively and it worked beautifully. There were still some annoyances with trying to get all the customization we wanted but overall it saved us a ton of time and produced beautiful results.
Currently I'm working with Silverlight 3 and RIA Services and I can't imagine trying to produce what we're doing without the DataGrid and DataForm controls. The time being saved far outweighs any of the overhead.
i am a moderate level developer i can say without these controls i couldn,t ever learn developing.just you have to admit yourself to it for a while till you find your way to customize it and the end result will be great
I'm trying to look at it all in context. I have a page that has a nice gridview (displays 10 rows at a time, 6 columns, sorting, and paging) and if I just look at the html table that is created along with the viewstate, I'm only seeing 29k of code.
Is 29k vs. 18k for using a repeater or listview really worth all the effort in these broadband times?
I personally stick with the gridviews however the design guy I work with sometimes gripes about trying to style it via css.
Just reading your posts. I agree PHP is easier than asp. but I just started using visual studio for formviews and gridviews. Can not get much easier for either vb or C# programmers. ASP still has problems uploading large files. PHP it's a snap. I run PHP under IIS 7.5

Resources