Fremus.co.za

Demistifying Life and Web Development

Creating a pivot like structure – without using any server controls!

Ok, so programming is a challenge as all programmers should know, and this is the caveat that programming gives you. On the one hand its difficult but on the other hand you get to try so many approaches to developing one particular aspect that it gives you the opportunity to learn a lot. So here is my scenario:

I have to create a pivot-like table without the use of server controls – everything has to happen in the code. In most of my work at the moment we do not use server controls – everything is purely AJAX and uses SOAP calls to web services to generate the user interface. So there is no cool way of tallying things up, you gotta do it yourself, the SOAP response has to display the data. So typically this solution has a first column on the left and a first row on the top that represents the ‘labels’, and between the two aggregate values are generated in the area between the label areas where they intersect. So any intersecting value between the two should give you a total made up from the two. The last column in the table contains a running total of each row and the last row keeps a running total as well.

From the description it is clear that you have several ‘fixed’ variables, or fixed areas:

  • The y-axis labels
  • The x-axis labels
  • The y-axis running total
  • The x-axis running total
  • The data area

The variables or objects defined above should be able to accept any data and display it accordingly. How do you approach it though? What approach do you follow to achieve the correct SOAP response message? C# 3.0 provides several technologies to do this:

  • Generics, lists, dictionaries
  • ADO.NET which provides you with data access
  • Share/Bookmark
posted by fr3dr1k in Application Development,C#,General and have No Comments
Tags:

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment
Get Adobe Flash playerPlugin by wpburn.com wordpress themes