Software FX Posted November 30, 2000 Report Share Posted November 30, 2000 Hi, I found a very detailed explanation about 'Bit Stream' in Chartfx IE 2000's help file. I copied it and pasted for you to have a better idea how to used. -- Regards, Percy Dyer Software FX, Inc. Tech Support Please reply to: Cfxie@softwarefx.com ================================================ Bit Stream Chart generation Since we released Chart FX Internet Edition many large corporations incorporated Chart FX as an essential reporting tool for their internet, intranet and extranet sites. Many of these companies impose strict security to their users through the use of firewalls and proxxy servers; some of them even go to the lenghts of configuring the browser so it does not accept anything that may become harmful to their network. Needless to say many of these companies do not allow users to download and use ActiveX controls or PlugIns on the browsers even if they come from trusted third party vendors like Software FX. Even though Chart FX Internet Edition can be easily configured to always generate images, for many corporations the fact that these images are being generated and stored in a particular directory (/CfxTemp) poses a security concern to many of them. For example, a hacker could easily determine a chart name, create a page and load the chart in his machine before it is actually erased by the SfxRemove application. Many sites display very sensible data where that risk can't simply be accepted. With this security concern in mind, Chart FX IE 2000 allows web developers to easily setup asp pages that return charts as bit streams instead of generating chart files and letting browsers download files that were previously generated in the CfxTemp Directory. The GetHtmlData is a method provided by the Chart FX Server component that allows the browser to receive a bit stream instead of generating a chart file in the /CfxTemp directory of your web server. The GetHtmlData method receives the same parameters as the GetHtmlTag method, except that the result will be a data push directly to the browser. No references to download a file will be generated when using this method (GetHtmlData). Actually, when the user attempts to view the source for the resulting asp, no information about the chart file will be displayed. This is because all the necessary information was sent to the browser via a bit stream instead of letting the browser download a chart file or image. There are actually two methodologies when using the GetHtmlData method: Technique #1: Creating a chart image without downloading a file This technique is used when a chart image (png or JPEG) will be generated by the server side component. The idea is as simple as including the <IMG> tag wherever you want the chart to be displayed and the SRC parameter points to the ASP that generates the Bit Stream by invoking the GetHtmlData method. the IMG tag should read as follows: <IMG SRC="CHART.ASP"> The CHART.ASP File will contain the necessary ASP code that generates the desired chart and invokes the GetHtmlData method as a result of the page. A very important issue when generating this ASP is to make sure there are no other HTML tags or Line feeds in the resulting file as the chart may not be correctly returned and displayed in the browser. In other words, make sure the CHART.ASP file only returns the results of the GetHtmlData method with no additional characters. For example a valid CHART.ASP file may look like: <!-- #include virtual="/Include/CfxIE4B.inc" --><% ' Please note the way this ASP is coded to avoid any newline or other characters ' to be sent to the client (all the code is SERVER side code) Set chart = Server.CreateObject("ChartFX.WebServer") ' Note the use of GetHtmlData instead of GetHtmlTag chart.GetHtmlData 500,350,"Image" %> Please note how there's no space or carriage returns between the <include> directive and the start of the ASP code (<%). If you press [Enter] then a carriage return wil be generated in the result of the ASP and teh IMG source will not be able to read the image gerated by the Chart FX server component. Therefore is strongly advised you use a plain text editor (such as Notepad) when generating these files as Visual InterDev, Frontpage or other advanced editors may include undesired HTML tags in the resulting file. Technique #2: Maintaining browser independence to display images or use client side components If you still want Chart FX to detect the browser being used and returned the appropriate <OBJECT>, <EMBED> or <IMG> tag but without any files being generated as a result of this request, then you just include the GetHtmlTag in your page and invoke the ASP that generates the chart and returns the bit stream using the GetHtmlData method. For example, if you want to include a chart in an asp page that generates no temporary file, but still detects the browser posting the request to send back a client side component or image: <%= chart.GetHtmlTag(550,250,"#Chart.asp?Param=1") %> Please note the third parameter of the GetHtmlTag, it has the following characteristics: a.. It starts with the # sign b.. The # sign is followed by the asp that must invoked to generate the bit stream using the GetHtmlData method c.. You can invoke, if necessary, thi sasp with parameters (such as the Param1 shown in the GethtlTag method above Then the Chart.asp looks like: <!-- #include virtual="/Include/CfxIE4B.inc" --><% ' Please note the way this ASP is coded to avoid any newline or other characters ' to be sent to the client (all the code is SERVER side code) Set chart = Server.CreateObject("ChartFX.WebServer4B") chart.Gallery = AREA ' Note the use of GetHtmlData instead of GetHtmlTag ' Also note that the third parameter can be set to both ActiveX or plugin ' since the same type of data is returned chart.GetHtmlData 500,350,"Auto"%> Please note how there's no space or carriage returns between the <include> directive and the start of the ASP code (<%). If you press [Enter] then a carriage return wil be generated in the result of the ASP and teh IMG source will not be able to read the image gerated by the Chart FX server component. Therefore is strongly advised you use a plain text editor (such as Notepad) when generating these files as Visual InterDev, Frontpage or other advanced editors may include undesired HTML tags in the resulting file. IMPORTANT NOTE: If you are using the "Image Maps" in the charts, you should be aware that this feature is not supported when using the BitStream generation. ================================================ "Einar" <einarfei@ax.is> wrote in message news:AbIsSEKVAHA.1428@sfxserver.softwarefx.com... > Is it possible to open stream to chart insted of using activeX or image > property when creating the chart component in .asp pages? > > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.