Milestones Professional ASP Example #1

This example uses Active Server Pages (ASP) to:
  
1     Open a Milestones Professional chart from a web server.
2 Generate a bitmap image with a random number.
3 Display the bitmap in the user's browser.
  
Note: this is a very simple example. You might have a form which prompts the user to select a schedule to display.  We'll have some more advanced examples soon.  Check back to this page.  Meanwhile, click here to visit our main programmer's page and check out our examples for Excel, Access and Microsoft Project.

About using Milestones with ASP Scripts on your WebServer

Run one of our examples on our server

   
ASP CODE   (Milestones interface calls shown in Blue)
   
<%@Language=VBScript%> 

<% Response.Expires = 0 Response.Buffer = TRUE %>

<html> 

<head> 

<title>Output Via ASP/IIS/JPEG Example</title> 

</head> 

<body> 

<p>Output Via ASP/IIS/JPEG Example</p> <hr>

<% If Len(Request.Form("FormAction")) = 0 Then

' Create the Milestones object using a file on the web server

 oMiles=GetObject("c:\miles2000\condo4.ml6","Milestones") 

'Activate Milestones

oMiles.Activate 

'Refresh Milestones

oMiles.Refresh

'Generate a random # and build a file name for the image

Randomize 

ImageName = "filtout"+CStr(Rnd)+".jpg" 

FullPathImageName = "c:\webfolder\webname\tempimage\"+ImageName 

WWWPathImageName = "http://www.webname.com/tempimage/"+ImageName

'Generate Bitmap

oMiles.SaveBitmap (FullPathImageName) 

oMiles.Close "NoSave"

'Show the Bitmap in the user's browser

Response.Write "<p><img src="""+WWWPathImageName+"""></p>"

End If %>

<hr>

</body> </html>

  

Click here to visit our main programmer's page.