ExportPicture issue with OWC10

L

lily

Hi there,

I use the below codes to build a few Charts on the fly, it works on my XP
mechine but only export the last two charts on the 2K Server. Any ideas?

Private Sub ExportImage(ByVal oChartSpace As OWC10.ChartSpace, ByVal img As
System.Web.UI.WebControls.Image)

Dim strFullPathAndName As String

Dim FileName As String

FileName = "tmp\" + System.DateTime.Now.Ticks.ToString() + ".gif"

strFullPathAndName = Server.MapPath(FileName)

oChartSpace.ExportPicture(strFullPathAndName, "gif", 600, 400)

img.ImageUrl = FileName

img.Visible = True

' Thread.CurrentThread.Sleep(100)

End Sub
 
T

Thao Moua [ms]

Are you sure the generated FileName variable is unique
for each chart? If not then your new chart will always
clobber the previous chart.

Thao Moua
OWC Webchart Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 
A

Alvin Bruney

Use this for unique names
FileName = "tmp\" +
System.Text.RegularExpressions.Regex.Replace(DateTime.Now.ToString(),"\\D","
") + ".gif"
 
L

lily

After I changed the file from .gif to .jpg, all charts display correctly.
Don't know why.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top