473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1482
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.o rg> wrote in message
news:F2******** *************** ***********@mic rosoft.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.W ebControls.Tabl e Table1;
private void Page_Load(objec t sender, System.EventArg s 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.BorderStyl e = BorderStyle.Sol id;

cell.BorderWidt h = 1;

cell.BorderColo r = Color.Blue;

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

row.Cells.Add(c ell);

}

Table1.Rows.Add (row);

}

"Josema" <Je******@ocu.o rg> wrote in message
news:43******** *************** ***********@mic rosoft.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
1755
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 developers to create WYSWIG Layouts in a snap. The toolset allows developers to easily impliment object oriented rich visual layouts that can be saved in a structured developer defined (extension wise) file format that is similiar to MS Word and can...
47
9120
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
24985
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
1536
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
4837
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 can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
2
1063
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
1621
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 pretty standard layout. However when ever I resize my browser the content resizes below the sidebar. I've been digging through example websites can't seem to stop this behaviour. I had one person suggest Tables but I see a few posts that say...
10
3635
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 (if not all) C++ compilers for the MSW use a very similar vtable layout. In COM, this is handled by proxies provided by system dlls,
0
8114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8615
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8422
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5536
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2554
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1699
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.