Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 17th, 2004, 10:56 AM
Authorized User
 
Join Date: Sep 2003
Location: , , United Kingdom.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default office web components trouble!!!

Hi everyone,
I hope someone will be able to help.... i am using ASP technology (incorperating a VB DLL as a middle tier) and I want to use office xp web components to generate dynamic graphs.. i have downloaded the owc toolpack too but nothing seems to work for me.... i have tried several differnt ways of coding this but with no success.

Basically..... I am returning a recordset with 2 variables "program" and "number".... I want to chart each "number" for each "program"... Below id the cde I have implemented.. (I have also registered the required DLLs)

Many Thanks. Kkathryne

Code:

<%@ Language=VBScript %>
<html>



<head>
<title>Create Report</title>
</head>

<body>

<%
dim strUserID
dim strTime
dim strProgram
dim strSeverity
dim strStatus
dim objProj
dim adoRS



Dim objConstants, objFont, objChart, objCSpace, objAxis
Dim objBinaryFile, FSO





  strUserID = Request.Form("txtUserID")
  strTime = Request.form("txtTime")
  strProgram = Request.form("txtProgram")
  strSeverity = Request.form("txtSeverity")
  strStatus = Request.form("txtStatus")

%>

<table id=TblTitle width="100%" >
    <tr height="63" style="HEIGHT: 63px">

    <td width="100" style="WIDTH: 100px"><img src="file:///D|/Inetpub/wwwroot/defect/images/logo.bmp" width="70" height="51"
      style="WIDTH: 86px; HEIGHT: 84px">
    </td>
      <td>
        <h1 align="center">Create Report</h1>
      <td>
      <td width="100" style="WIDTH: 100px"><h6 align="center">Nissan

      </h6><h6 align="center">Defect
      Tracking System
      </h6></td>
    </tr>
  </table>
  <P>
</P>

<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>


<%

'Get Data for graph

  set objProject1 = Server.CreateObject("Project1.Class1")
  set adoRS = objProject1.MakeChart()
  set objProject1 = nothing





Response.ContentType = "image/gif"


'create the chart object
set objCSpace = Server.CreateObject("OWC.Chart")

'set up chart and properties
set objChart = objCSpace.Charts.Add()
set objConstants = objCSpace.Constants

'create a clustered column chart
objChart.Type = objConstants.chChartTypeColumnClustered

'add a legend
objChart.HasLegend = True

'set the data source to the recordset
set objCSpace.DataSource = adoRS

'set the data points and categories

objChart.SetData objConstants.chDimCategories, 0, "Programs"
objChart.SetData objConstants.chDimValues, 0, "Defects"

'set up some additional properties
'add and format the chart title
objChart.HasTitle = True
objChart.Title.Caption = "Number of Defects outstanding by Program"
set objFont = objChart.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 12
objFont.Bold = True

'add and format a title to the category axis
set objAxis = objChart.Axes(objConstants.chAxisPositionBottom)
objAxis.HasTitle = True
objAxis.Title.Caption = "Programs"
set objFont = objAxis.Title.Font
objFont.Name = "Tahoma"
objFont.Size = 8
objFont.Bold = True

'add and format a title to the value axis
'set objAxis = cht.Axes(objConstants.chAxisPositionLeft)
'objAxis.NumberFormat = "Number"
'objAxis.HasTitle = True
'objAxis.Title.Caption = "Dollars"
'set objFont = objAxis.Title.Font
'objFont.Name = "Tahoma"
'objFont.Size = 8
'objFont.Bold = True


 'Save the current chart to a GIF file with a temporary
'filename using the FSO
set fso = Server.CreateObject("Scripting.FileSystemObject")
strFileName = Server.MapPath(".") & "\" & fso.GetTempName()
objCSpace.ExportPicture strFileName, "gif", 800, 400

'Use On Error Resume Next to make sure we eventually delete
'the temporary GIF file even if something fails in the next
'couple of functions
on error resume next

'The GIF file has been created. Return the contents of the
'GIF file as binary data using the BinaryFileStream COM object
set objBinaryFile = Server.CreateObject("BinaryFileStream.Object")
Response.BinaryWrite objBinaryFile.GetFileBytes(CStr(strFileName))

'Delete the GIF file since it is no longer needed
objBinaryFile.DeleteFile CStr(sFullFileName)

'clear variables
set objBinaryFile = nothing
set FSO = nothing
set objCSpace = nothing



%>



<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>







<table id=TblBottomBanner width="100%" bgcolor=lightgrey>
    <tr height="63" style="HEIGHT: 63px">
    <td>
      <P align=center><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; All rights
      registered 2004 Nissan Europe</STRONG></P>
      <td width="80" style="WIDTH: 80px">
      <button id="cmdDoBack" style="WIDTH: 80px" class="StdButton" onclick="DoBack();">Back
     </button>
    </td>
    </tr>
  </table>



<form id="frmMain" name="frmMain" method="post">
<input id="txtUserID" name="txtUserID" type=hidden value="<%=strUserID%>">

</form>



</body>
<script language=javascript>




//------------------------------------------------------------------------------
// DoBack()
// ~~~~~~~~~~~~~~~
//------------------------------------------------------------------------------
function DoBack()
{

   Navigate(frmMain, "MainMenu.asp");

}





</script>


</html>

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Web Components kalebson Access 1 July 16th, 2006 02:13 PM
Microsoft Office Web Components 9.0 (0x800A03EC) rekha_jsr Classic ASP Components 1 February 4th, 2006 08:19 PM
Embedding Office Web Components form JSP sunildath_019 JSP Basics 0 March 17th, 2004 06:11 AM
office web components with asp kathryne Classic ASP Professional 1 September 29th, 2003 08:50 PM



All times are GMT -4. The time now is 11:58 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.