Sign in to follow this  
pdaniel

.SWF as Embedded Resource Files?

Recommended Posts

I have created a class library assembly to be a wrapper to the Fusion files. I have added the .swf files as embedded resources in the project and I'm trying to reference these for use in the RenderChart funciton. See my code snippet below.

 

 

 

url = Page.ClientScript.GetWebResourceUrl(GetType(ChartControl), "CFN.Web.UI.Controls.ChartControl.Pie2D.swf")

 

 

 

chartDisplay.Text = FusionCharts.RenderChart(url, "", ConvertDataSetIntoXML, "CFNChart", ChartWidth.ToString, ChartHeight.ToString, False, False)

 

 

 

The url converts to /Applications/APP360/WebResource.axd?d=YLFeAETZsBmqQEgBXxjSQFSxN5RnEZuFIJUEjNSceEbGk51IWHsbVz7EgPQDJcnFR4jON4zz6vCwI8vRg-0G5GLxH2CV3gfVD40OnqDPWG81&t=633528315360254502". Is this possible to accomplish? If not, how can I reference the .swf files so that they are located in only 1 directory and referenced by my class library project.

 

 

 

Thanks!

 

Patrick

Share this post


Link to post
Share on other sites

Thanks for the reply. I'm not sure if I understand your question. When I execute the code in my snippet, no chart is rendered. There is no error, but there is no chart either.

Share this post


Link to post
Share on other sites

I thing may be your Resource path not correct. Can you add this Resource Reference in your AssemblyInfo.cs file? Like this way?

  [assembly: WebResource("FusionChartsGen.resources.chartsFree.FCF_Area2D.swf", "application/x-shockwave-flash")]

  My project directory and root is FusionChartsGen. My FC swf location is resources/chartsFree  so my full path is FusionChartsGen.resources.chartsFree.FCF_Area2D.swf . so I listed all with in AssemblyInfo.cs that way.

  [assembly: WebResource("FusionChartsGen.resources.chartsFree.FCF_Area2D.swf", "application/x-shockwave-flash")]

 

  Calling swf file

  ====================

  // Sets SWF(FusionCharts) Path

  SWFPath = Page.ClientScript.GetWebResourceUrl(GetType(), "FusionChartsGen.resources.chartsFree.FCF_Area2D.swf");

  Render Charts

  =================

 

  chartDisplay.Text = FusionCharts.RenderChart(SWFPath, "", ConvertDataSetIntoXML, "CFNChart", ChartWidth.ToString, ChartHeight.ToString, False, False)

Please follow it.

Share this post


Link to post
Share on other sites

Thanks for the code samples! I tried to replicate that in my environment. I have a resources directory in my project that contains all the .swf files. My project name is ChartControl. Hence I plugged in the below code.

 

 

 

Code

 

url = Page.ClientScript.GetWebResourceUrl(Me.[GetType](), "ChartControl.resources.Pie2D.swf")

 

 

 

AssemblyInfo.vb Page

 

 

 

 

This does not work. The namespace to my project is "CFN.Web.UI.Controls.ChartControl" so I'm not sure if that changes anything.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this