User (Legacy) Posted January 14, 2005 Report Share Posted January 14, 2005 Hi, I want to reproduce a chart in a newly opened page, but if I save the chart object as Session, it seems does not work. I noticed actually there is a temp image file saved locally, like SRC="/chartfx62/temp/CFT0114_02291204E06.png" , is there an easy way to get the src and use it in another page? thanks michael Link to comment Share on other sites More sharing options...
Software FX Posted January 17, 2005 Report Share Posted January 17, 2005 Michael, If I am understanding you correctly, the best way to reproduce a chart in a newly opened page is to export as binary from oldPage and import as binary to newPage. This will keep all your properties intact and even your data if you want. See Import/Export API. I don't know if this would work in your situation but... you could store this chart in the cache using System.Web.Caching.Cache The only tricky part for you would be the key. The key that you use could be the value returned from GetHtmlTag that string would be unique something like this SRC="/chartfx62/temp/CFT0114_02291204E06.png" Something like this: string skey = Chart1.GetHtmlTag(...); m_cache = System.Web.HttpRuntime.Cache; MemoryStream memStream = new MemoryStream(); Chart1.Export(FileFormat.Binary, memStream); memStream.Seek(0, SeekOrigin.Begin); m_cache.Insert(skey, memStream, cacheDependency); Then all you need to do later is save the key and get it later like this Stream stream = (Stream) m_cache[skey]; if( stream != null) { stream.Seek(0, SeekOrigin.Begin); Chart2.Export(FileFormat.Binary, stream); } The other solution is to save the binary stream to a file. Hope this helps. -cjs "Michael Zhao" <mcchoice@hotmail.com> wrote in message news:1Zl5rKn%23EHA.1120@webserver3.softwarefx.com... > Hi, > I want to reproduce a chart in a newly opened page, but if I save the > chart > object as Session, it seems does not work. I noticed actually there is a > temp image file saved locally, like > SRC="/chartfx62/temp/CFT0114_02291204E06.png" , is there an easy way to > get > the src and use it in another page? thanks > > michael > > > Link to comment Share on other sites More sharing options...
User (Legacy) Posted January 17, 2005 Author Report Share Posted January 17, 2005 thanks for your reply, I have done through: this.Chart1.ImgTags = "id=img20050101 border=0"; --> set an unique id for the image and in html script: var obj = document.getElementById("img20050101"); --> get the IMG object and then I can use obj.src and point to it on another page michael "Software FX Support" <support@softwarefx.com> wrote in message news:HAXQowM$EHA.1580@webserver3.softwarefx.com... > Michael, > If I am understanding you correctly, the best way to reproduce a chart in a > newly opened page is to export as binary from oldPage and import as binary > to newPage. > This will keep all your properties intact and even your data if you want. > See Import/Export API. > > > I don't know if this would work in your situation but... > you could store this chart in the cache > using System.Web.Caching.Cache > The only tricky part for you would be the key. The key that you use could be > the value returned from GetHtmlTag > that string would be unique something like this > SRC="/chartfx62/temp/CFT0114_02291204E06.png" > > Something like this: > string skey = Chart1.GetHtmlTag(...); > m_cache = System.Web.HttpRuntime.Cache; > MemoryStream memStream = new MemoryStream(); > Chart1.Export(FileFormat.Binary, memStream); > memStream.Seek(0, SeekOrigin.Begin); > m_cache.Insert(skey, memStream, cacheDependency); > > Then all you need to do later is save the key and get it later like this > Stream stream = (Stream) m_cache[skey]; > if( stream != null) { > stream.Seek(0, SeekOrigin.Begin); > Chart2.Export(FileFormat.Binary, stream); > } > > The other solution is to save the binary stream to a file. > > Hope this helps. > -cjs > > > > "Michael Zhao" <mcchoice@hotmail.com> wrote in message > news:1Zl5rKn%23EHA.1120@webserver3.softwarefx.com... > > Hi, > > I want to reproduce a chart in a newly opened page, but if I save the > > chart > > object as Session, it seems does not work. I noticed actually there is a > > temp image file saved locally, like > > SRC="/chartfx62/temp/CFT0114_02291204E06.png" , is there an easy way to > > get > > the src and use it in another page? thanks > > > > michael > > > > > > > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.