473,406 Members | 2,705 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,406 software developers and data experts.

Method to Create Excel Charts in ASP

Hi, I am facing problem in ASP application where I am getting error message
"Server object, ASP 0178 (0x80070005)
The call to Server.CreateObject failed while checking permissions. Access is denied to this object." on
Set MyExcelApp = Server.CreateObject("Excel.Application")
i have learnt that calling Excel.Application on web server is not a good practice so
I am using the following method
Response.ContentType = "application/vnd.ms-excel"
'Response.AddHeader "Content-Disposition","attachment;filename=Tool_Report(Date ).xls"

i am able to generate and download Excel Sheet from the above method but my problem is how can I dynamically create Excel Charts with the Sheet that i have generated. I urgently need the solution please guide me

Here is the Code that i have written,

session.lcid=2057
dim Cn,Rs,strFromDate,strToDate,strQuery
strFromDate = Cstr ( FormatDateTime(cDate(Request.Form("txtStartDate")) ,2) )
strToDate = Cstr ( FormatDateTime(cDate(Request.Form("txtEndDate")),2 ) )
strQuery= ""
strQuery = "select * from tool_candidate,tool_master where tool_master.tool_id=tool_candidate.tool_id and tool_master.tool_Date >='" & strFromDate & "' and tool_Date<='" & strToDate & "'"
set Cn=server.createobject("ADODB.connection")
set Rs=server.createobject("ADODB.recordset")
Cn.open "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("tool.mdb")
Rs.open strQuery,Cn,1,3
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Tool_Report(Date).xls"
if Rs.eof <> true then
Response.Write("<Table Border='1'>")
while not Rs.eof
'response.write "<tr><td>" & Rs.fields(0) & "</td><td>" & Rs.fields(1) & "</td><td>" & Rs.fields(2) & "</td><td>" &Rs.fields(3) & "</td><td>" & Rs.fields(4) & "</td><td>" & Rs.fields(5) & "</td></tr>"
Rs.movenext
i = i + 1
wend
response.write "</table>"
end if
set rs=nothing
Cn.close

Thanks & Regards
Rohit
Dec 12 '07 #1
2 3243
liqdok
3
maybe you need to use some third party excel spreadsheet components.
http://www.smartxls.com
Dec 13 '07 #2
hi rohit..
did you find a solution to your problem...
i am lookin for something similar..
Mar 23 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mscir | last post by:
Date: Thu, 08 Jul 2004 17:02:27 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <10ero4l3kp2qa65@corp.supernews.com> Reply-To: mscir@usa.com User-Agent: Mozilla/5.0...
10
by: Mark Day | last post by:
Hi All, I am using Access 2000 to generate over 40 Excel charts and pivot tables using early binding to the Excel 9.0 object library. I am finding that if I show the Excel object while processing...
2
by: twins | last post by:
Hi, I have an excel template with values & charts. Please let me know how I can edit the xls file and change certain values so that the chart changes for each user I send the excel (xls) file....
5
by: Takeadoe | last post by:
I'm doubtful that the group is unbiased, but I will ask anyhow :o). If one intends to plot lots of data, primarily XY line and scatter plots, and mass produce them (in many cases I will be doing...
3
by: implicate_order | last post by:
Greetings, I'm new to python and am in the process of writing a script to parse some CSV data, spread it across multiple Excel worksheets and then generate charts. I searched the internet to...
0
by: Ankush Shankar | last post by:
Hi, Can somebody help me out in automating the following? - I have been dealing with mailing list in which I receive 1000s of emails as an inquiries. I reply those emails on daily basis., - I...
3
by: saragoesnuts | last post by:
I have a program that automates to Excel with information in tables. I want to add charts to the excel file (pie charts, bar charts, etc). Is this possible?
0
by: eolmos | last post by:
Hello everyone, I am currently working on a project that requires a webform in asp.net using C# as the code behind. The page must allow the user to create a report in excel. This report must also...
9
by: AGP | last post by:
I have a VB6 application that has an OLE container with an embedded Excel chart. Our office updated to Excel 2007 and now although the app works the charts looks like crap. Since the app is fairly...
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: 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?
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.