473,385 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Automatize layout of applications

Hi,

I have a web application, that takes from excel a range of rows and columns...

The method that gets the data in the ranges returns an Array of two
dimensions with the data...

Then i render the data in the browser for instance using html tables....

My problem its that:

In my company we have to do a lot of applications of this type (with excel),
and i would like to automatize the resulting layout, cause i allways obtain
an array of two dimensions (sometimes biger, sometimes smaller) to render
after....

Usually im using a StringBuilder to append into the c# code the html, but i
dont like this solution cause if i have to modify the layout, i have to open
the code, recompile, and then put it on-line again...

I thought that xml maybe its a good solution. But really i dont know.

Could you give some advices about the way to do this?

--
Thanks
Regards.
Josema
Nov 16 '05 #1
3 1468
You can use OLEDB to connect to your spreadsheet and fill a DataSet or
DataTable then use the DataSet or DataTable as the DataSource for a DataGrid
control.

Alternatively, you could create a Web Custom Control with appropriate nested
loops to extract your data regardless of how many columns there are.

Do you have some samples of what you are doing now?

I know this isn't much, but you haven't given us much to work with on what
you are doing up to now.

HTH

DalePres
MCAD, MCDBA, MCSE

"Josema" <Je******@ocu.org> wrote in message
news:F2**********************************@microsof t.com...
Hi,

I have a web application, that takes from excel a range of rows and
columns...

The method that gets the data in the ranges returns an Array of two
dimensions with the data...

Then i render the data in the browser for instance using html tables....

My problem its that:

In my company we have to do a lot of applications of this type (with
excel),
and i would like to automatize the resulting layout, cause i allways
obtain
an array of two dimensions (sometimes biger, sometimes smaller) to render
after....

Usually im using a StringBuilder to append into the c# code the html, but
i
dont like this solution cause if i have to modify the layout, i have to
open
the code, recompile, and then put it on-line again...

I thought that xml maybe its a good solution. But really i dont know.

Could you give some advices about the way to do this?

--
Thanks
Regards.
Josema

Nov 16 '05 #2
Hi DalePres,

First of all thanks for your early response....

My problem its that i cant use OLEDB to connect to your spreadsheet and fill
a DataSet.

We are forced to use a object created in our company to rescue ranges of
data from excel...
This object returns an array of arrays (jagged array), and its the only way
to rescue data that we have...

Taking in count that the only way its get all data from excel, in a jagged
array... What could be a good way to automatize the layout of all the
applications?...
--
Thanks
Regards.
Josema


Nov 16 '05 #3
Here's a quick way to do it by just iterating the data into a table. You
could also iterate the data into a DataTable and set the DataSource of a
DataGrid to the DataTable as well.

HTH

DalePres

protected System.Web.UI.WebControls.Table Table1;
private void Page_Load(object sender, System.EventArgs e)

{

// creating jagged array for demo purposes

string [][]arr=new string[4][];

arr[0]=new string[3];

arr[1]=new string[2];

arr[2]=new string[5];

arr[3]=new string[4];

int z = 0;

for(int i=0 ; i < arr.Length ; i++)

{

for(int x=0 ; x < arr[i].Length ; x++)

{

arr[i][x]=z.ToString();

z++;

}

}
// dynamically populating the table with the array contents.

for(int x=0 ; x < arr.Length ; x++)

{

TableRow row = new TableRow();

for(int y=0 ; y < arr[x].Length ; y++)

{

TableCell cell = new TableCell();

// Adding some color just to make the

// cells easier to distinguish on the page

cell.BorderStyle = BorderStyle.Solid;

cell.BorderWidth = 1;

cell.BorderColor = Color.Blue;

cell.Text = arr[x][y];

row.Cells.Add(cell);

}

Table1.Rows.Add(row);

}

"Josema" <Je******@ocu.org> wrote in message
news:43**********************************@microsof t.com...
Hi DalePres,

First of all thanks for your early response....

My problem its that i cant use OLEDB to connect to your spreadsheet and
fill
a DataSet.

We are forced to use a object created in our company to rescue ranges of
data from excel...
This object returns an array of arrays (jagged array), and its the only
way
to rescue data that we have...

Taking in count that the only way its get all data from excel, in a jagged
array... What could be a good way to automatize the layout of all the
applications?...
--
Thanks
Regards.
Josema


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nunya D. Bidness | last post by:
If anyone is interested in testing these components goto http://www.vibrantinnovations.com/vibrantlayouttools.asp The Vibrant Layout Tools ActiveX component is a suite of tools that allow...
47
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
20
by: Tammy | last post by:
What would be a good alternative to using frames? I need something that will section my webpage into two halves and can change both frames on a single click. Thanks in Advance, Tammy
3
by: Samuel Shulman | last post by:
I am looking for good guidance for positioning controls on the form.document, it is absolute nightmare and I don't know where to begin Thank you, Samuel Shulman
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
2
by: =?Utf-8?B?QmVydA==?= | last post by:
Hi I am a asp.net 2.0 newbie and I was looking for some basic layout pages for asp.net objects. I dont want to use masterpages thanks Bert
5
by: Ed Sproull [MSFT] | last post by:
First I'm pretty new to ASP.NET and I'm having a simple problem. I have small website with a header, sidebar and the the content. I want my content to appear beside my sidebar which seems to be a...
10
by: Ole Nielsby | last post by:
James Kanze <james.kanze@gmail.comwrote: COM does rely on vtable layout. COM interfaces are declared as pure virtual classes, all methods using stdcall convention, and this works because most...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.