export database info to Excel (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


adavies -> export database info to Excel (10/30/2001 16:25:00)

Is it possible to create a button on a database results page which will export the database information (one table only...all columns and fields)to an Excel spredsheet ?

The Excel spreadsheet would be located on an intranet...be preformatted..and allow employees to print the database table in a user friendly format.

I imagine the button would activate a macro which would in turn have a sub routine to do the work.....any way you can steer me towarsds how to write the sub-routine / macro ? Or how to record it in Frontpage or Access so I can cut and paste it ?

thanks

Ashley





rdouglass -> RE: export database info to Excel (10/31/2001 20:42:00)

I think I don't understand. If all you're going to do is print it, then why go thru the trouble of Excel. WHy couldn't you present it in a format that looks like a spreadsheet? Creative use of tables should give you that, you'll just have to put the page on a Spooky diet...




adavies -> RE: export database info to Excel (10/31/2001 20:30:00)

quote:
Originally posted by rdouglass:
I think I don't understand. If all you're going to do is print it, then why go thru the trouble of Excel. WHy couldn't you present it in a format that looks like a spreadsheet? Creative use of tables should give you that, you'll just have to put the page on a Spooky diet...

The spreadsheet when printed (landscape) will be more than one page....how else can I keep a header at the top (column titles) and a footer at the bottomof each page (legend) ?

please adsvise

thanks

Ashley





rdouglass -> RE: export database info to Excel (10/31/2001 23:19:00)

Working under the premise of leaving Excel out of it, I would limit the number of records on a page to no more than would fit on 1 page. Then you could still put all your column headings, etc. However, I don't think it would be easy to put totals anywhere except the last page.

If you must use Excel, this link from MS may help...

http://support.microsoft.com/support/kb/articles/Q189/1/98.ASP?LN=EN-US&SD=gn&FR=0&qry=download%20to%20Excel%20file&rnk=28&src=DHCS_MSPSS_gn_SRCH&SPR=ASP





adavies -> RE: export database info to Excel (10/31/2001 13:04:00)

quote:
Originally posted by rdouglass:
Working under the premise of leaving Excel out of it, I would limit the number of records on a page to no more than would fit on 1 page. Then you could still put all your column headings, etc. However, I don't think it would be easy to put totals anywhere except the last page.

If you must use Excel, this link from MS may help...

http://support.micros oft.com/support/kb/articles/Q189/1/98.ASP?LN=EN-US&SD=gn&FR=0&qry=download%20to%20Excel%20file&rnk=28&src=DHCS_MSPSS_gn_SRCH&SPR=ASP


Is there any way to get the database results page to print and have the column headings on each page...not just the first ?

thanks

Ashley





Mojo -> RE: export database info to Excel (10/31/2001 13:50:00)

The spreadsheet when printed (landscape) will be more than one page....how else can I keep a header at the top (column titles) and a footer at the bottomof each page (legend) ?

Use page breaks. Example:

Place this in the header section:

<STYLE TYPE="text/css">
P.newpage {page-break-before: always}
</STYLE>

Place this where you want the page break to occur:

<P CLASS="newpage">

Then place any header or footer after you create a new page. You could dynamically create the new page...

Is there any way to get the database results page to print and have the column headings on each page...not just the first ?

If you assign the column headings to variables, you can use them anywhere on the page. So, use the pagebreak above > add your header > then add any column headings > now add the rest of your data.

Joe





adavies -> RE: export database info to Excel (11/1/2001 16:10:00)

quote:
Originally posted by jbennett:
The spreadsheet when printed (landscape) will be more than one page....how else can I keep a header at the top (column titles) and a footer at the bottomof each page (legend) ?

Use page breaks. Example:

Place this in the header section:

<STYLE TYPE="text/css">
P.newpage {page-break-before: always}
</STYLE>

Place this where you want the page break to occur:

<P CLASS="newpage">

Then place any header or footer after you create a new page. You could dynamically create the new page...

Is there any way to get the database results page to print and have the column headings on each page...not just the first ?

If you assign the column headings to variables, you can use them anywhere on the page. So, use the pagebreak above > add your header > then add any column headings > now add the rest of your data.

Joe[/B]


Can this be done if the page I am working with and from is a database results page ?

The database is always changing ...new jobs are added...old jobs are dropped...even the row height can vary depending on what data and amount of data entered in various fields. There is no place to insert the
<P CLASS="newpage">

That is why I thought I had to export everything to Excel to get it to print in a structiured format with a header and footer on each page.

any advice ?

thanks

Ashley





Mojo -> RE: export database info to Excel (11/4/2001 20:27:00)

Ashley,

You can still do it without using Excel. You will need to be clever with your coding.

If you are sure everyone will have Excel, I would follow the link rdouglas posted and use ASp / Excel.

Joe





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125