title image


Smiley Re: Sehr spezielle Frage: VB.net/ASP.NET 2003: binarywrite von Chart?
Hi,



stimmt. Wenn man gerne ungeschriebenes liest.



GetPicture Method





Returns a picture of a chart from a binary data stream.



expression.GetPicture(FilterName, Width, Height)



expression Required. An expression that returns a ChartSpace object.



FilterName Optional String. The name of the graphics filter to use. The default value is "GIF".



Width Optional Long. The width of the chart in pixels.



Height Optional Long. The height of the chart in pixels.

Remarks



You can use the BinaryWrite method to write the picture returned by this method to the current HTTP session.

Example

This example uses an ASP script to create a chart based on data in a SQL Server database. Once the chart has been created, an picture of the chart is displayed in the browser window.



<%

Dim PictType

Dim NewChart

Dim chConstants



Set NewChart = CreateObject("OWC10.ChartSpace")



Response.Expires = 0

Response.Buffer = True

Response.Clear



PictType = "jpg"

Response.ContentType = "image/" & PictType



Set chConstants = NewChart.Constants



NewChart.ConnectionString = "Provider=SQLOLEDB.1;persist Security Info=TRUE;User ID=sa;Initial " & _

"Catalog=Northwind;Data Source=servername;PASSWORD=;"

NewChart.DataMember = "Order Details"



NewChart.SetData chConstants.chDimCategories, chConstants.chDataBound, "ProductID"

NewChart.SetData chConstants.chDimValues, chConstants.chDataBound, "Quantity"



NewChart.Charts(0).Type = chConstants.chChartTypeColumn3D

NewChart.Charts(0).HasTitle = True

NewChart.Charts(0).Title.Caption = "Server-Rendered Chart"



Response.BinaryWrite NewChart.GetPicture(PictType, 500, 400)

%>





man muss wirklich sehr viel Phantasie haben.

Nur wenn man nicht so viel Zeit hat: Alte Würste in neue Würste zu verpacken, passieren solche Doc-Fehler. Sie ziehen sich leider wie ein roter Faden durch das ganze Framework.

Programmierst Du noch frei oder wirst Du schon von Microsoft verwaltet ( .NET)?



geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: