Important alert: (current site time 7/15/2013 11:42:02 PM EDT)
 

winzip icon

webREPORTS

Email
Submitted on: 12/17/2003 4:58:41 PM
By: Chad Snyder  
Level: Advanced
User Rating: By 26 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 21884
(About the author)
 
     This code will create a report from any database table you specify and your able to export out to an EXCEL/CSV/TXT/XML file. This code works very much like ASP Report Wizard but simplified. I did use the ASP Reports Wizards export.asp page with some minor modifications. I plan in the near future to have multiple where statements and joined table functionality. Change the dbase.inc file to point to your database. See live demo at http://www.personalwebsolutions.com/webreports/ Don't forget to vote.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

12/18/2003 8:54:10 AM

I've never seen the ASPreports, but this webReports app ROCKS! Very powerful and extremely easy to use.

(If this comment was disrespectful, please report it.)

 
12/18/2003 3:20:14 PM

i have many prob to configure this! i have a mdb named TABELLA1 and his contain a taìble named TABELLA, wath i change in this script ....

Tks for your work
(If this comment was disrespectful, please report it.)

 
12/18/2003 3:52:51 PMChad Snyder

I'm not sure what problems you are having but you should only have to change the location of where your database sits. You change this in the database.inc file. The file needs to be in a folder under your web page. Let me know if you have any more problems.
(If this comment was disrespectful, please report it.)

 
12/18/2003 4:07:15 PMChad Snyder

Sorry, change the dbase.inc file not the database.inc file.

thanks
Chad
(If this comment was disrespectful, please report it.)

 
12/19/2003 4:34:19 AMVbNick

nice start...maybe choosing a pre-defined report layouts would be nicer.....
(If this comment was disrespectful, please report it.)

 
12/19/2003 7:58:09 AMChad Snyder

I agree, I will do that and the other items I mentioned and repost.

Thanks for the feedback

Chad
(If this comment was disrespectful, please report it.)

 
12/19/2003 8:22:12 AM

Cudos! Very useful and simple to use.
(If this comment was disrespectful, please report it.)

 
12/19/2003 9:42:44 AMCodeClub

1. please use template for exporting
2. please allow user to use css so as there will be a lot less hard-code html tags like "bgcolor=#ff0000" etc.
(If this comment was disrespectful, please report it.)

 
12/19/2003 11:11:14 AMChad Snyder

No problem. Thats a great idea. I hope to finish this code after the holidays so be looking for a new version with the request you all asked for.

Thanks

Chad
(If this comment was disrespectful, please report it.)

 
12/21/2003 8:38:35 PMTrond Larsen

I really like your work. Have been working on a similar, but simpler code myself. One thing I did that I think looks better and more efficient is the use of a multiple select list instead of using checkboxes. The same would also be nicer for te table select option. A drop down list would be nicer (in my opinion), and a second possibility to select from queries as well.
My own next investigaions will be in selecting with multiple where clauses, although I dont kno how to make this efficient in this kind of a query yet.

Trond
(If this comment was disrespectful, please report it.)

 
12/21/2003 9:08:18 PMChad Snyder

Thanks, you can also see the queries with the tables by changing the ShowTablesOnly to FALSE. Your right I may want to change the check boxes to dropdowns. Thanks for your suggestions. Don't forget to vote.
(If this comment was disrespectful, please report it.)

 
12/22/2003 2:07:03 PMTanwani Anyangwe

The Original product is ASP Report Wizard. I wrote it. You can see it from
http://www.aspwebsolution.com


(If this comment was disrespectful, please report it.)

 
12/22/2003 2:54:25 PMChad Snyder

I know that’s where I got the idea. I love ASP Report Wizard but wanted to have the ability to join tables and have multiple were clauses. I have not finished the code yet but plan to soon. That’s the reason why I wrote my own version of your product. Also wanted the experience.
(If this comment was disrespectful, please report it.)

 
1/2/2004 11:32:41 AM

This is great! I'm glad to see someone pick this project back up. The other one you mentioned is no longer free. They charge for it, bugs and all!

In any case - I have a lot of ideas for you. I'd be glad to help or give input. Contact me via email.
(If this comment was disrespectful, please report it.)

 
1/4/2004 9:39:39 AMJon Webb

Nice slick code - very good, well done
(If this comment was disrespectful, please report it.)

 
2/3/2004 2:03:26 AMFrank

Hello, an other possible selection that should be available in the criteria list:
'is null'

Thanx !
(If this comment was disrespectful, please report it.)

 
2/7/2004 11:43:25 PM

Any more progress on this?
(If this comment was disrespectful, please report it.)

 
2/9/2004 8:20:26 AMChad Snyder

Not yet but I hope to soon. Sorry!
(If this comment was disrespectful, please report it.)

 
2/12/2004 10:23:24 AM

Great! This is great stuff. I would love to help if you need any.
(If this comment was disrespectful, please report it.)

 
2/12/2004 8:52:02 PMmike

I viewed your work on your site and was thouroughly impressed. I'm trying to get it to work using MySQL. Here's the error I recieve followed by my connection string. Is there something I'm missing?
Thanx,
Mike
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-4.0.16-nt]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '[meetinglist]' at line 1

/index.asp, line 89
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;"_
& "DATABASE=blahblah;"_
& "UID=blahblah;PWD=blah; OPTION=35;"
(If this comment was disrespectful, please report it.)

 
3/5/2004 7:24:02 AM

i found it very intersting carry on with ur good work.
best of luck
(If this comment was disrespectful, please report it.)

 
3/5/2004 8:10:38 AMChad Snyder

Thank you so much!
(If this comment was disrespectful, please report it.)

 
3/12/2004 11:33:00 AM

why i can't run your code?

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/ASP_Report/dsn.asp, line 13


can you give me solutions?

i will surely vote for you..tnx

(If this comment was disrespectful, please report it.)

 
3/12/2004 11:40:34 AMChad Snyder

Try changing the permision on the database and database folder to include "IUSER_machinename" give this full permissions. Let me know if this works. Thanks! Chad
(If this comment was disrespectful, please report it.)

 
3/14/2004 11:45:39 PM

Still nothing new yet? Hung-up on something?
(If this comment was disrespectful, please report it.)

 
3/15/2004 8:26:02 AMChad Snyder

Have you done a search on this error? Try this link "http://support.microsoft.com/default.aspx?scid=kb;en-us;q306518"
(If this comment was disrespectful, please report it.)

 
3/15/2004 4:10:17 PMAdrian Priest

Another excellent piece of coding, well done again.
(If this comment was disrespectful, please report it.)

 
3/25/2004 11:11:20 AMlorenzo

WOW! This rocks! Thanks!
(If this comment was disrespectful, please report it.)

 
4/25/2004 4:45:13 AMJohn Galanopoulos

Man this source is really good job but no security measures are taken into consideration. Your authoring talent is glowing but this source, the way it is, is of no use. Even an amateur with little knowloedge of SQL could inject your source. For example click on the orders table, and move your mouse pointer over an export option (eg. Excel) Right click on it and select "Copy Shortcut". Finally paste it on the explorer address bar, change "select" to "Delete" and press enter. Boom! There goes [Orders] and [Order Details] due to their reationship. i won't vote but if you fix it i will post for 5.
(If this comment was disrespectful, please report it.)

 
4/25/2004 8:21:47 PMChad Snyder

I wrote this in a couple of hours and thought it may be useful for others. Your right you would need to fix some of the security issues if you wanted to use this in a production environment.

Thanks for the post I will look into fixing this ASAP.

(If this comment was disrespectful, please report it.)

 
5/23/2004 1:46:45 AM

(indonesia)anda memang layak mendapat bintang...
(If this comment was disrespectful, please report it.)

 
5/27/2004 11:08:50 PM

thanks by your code
(If this comment was disrespectful, please report it.)

 
7/23/2004 8:35:13 AM

Ohhh this is good!!
Once of the best (if not the best) export codes i've seen. Love the Excel/CSV/XML choice,

Nice one Chad.
(If this comment was disrespectful, please report it.)

 
9/2/2004 11:55:29 PM

No new progress?
(If this comment was disrespectful, please report it.)

 
1/5/2005 6:35:05 PMtward3017

I used your code in another project I posted here for WMI IIS Monitor to generate reports it is great I hope it's ok I added it to mine if not let me know
(If this comment was disrespectful, please report it.)

 
3/17/2005 8:29:56 PM

This worked out great for me. I couldn't figure out how to do aggregation (sum function) easily, so I just used the access queries that were doing it already. Since I then really only wanted queries that had been built for my Access database, I changed the objTable.Type to be VIEW to see them and listed the queries by name in the strTables variable. The "where" conditions worked fine with the queries. I had to change the name of the aggregated fields in the query, since Access was naming them "Sum of fieldx" and when I tried to sort by clicking the column header of the aggregated field I got an error. Renaming the aggregate in the Access query to "fieldx_sum" fixed that problem. Overall, I am very happy with the results and the professional looking output. Thanks!
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.