Sign in to follow this  
Arindam

cannot get sample asp.net chart to display graph ( vwd2005)

Recommended Posts

HI All,

I am trying to play around with the simple charts in asp.net but with no luck. All I get is a blank page. I have added the reference "infosoftglobal.dll" so the code can call fusion objects, but i get an error with the code file saying that:

"the language of the file referenced by the codefile attribute does not match the language specified by the 'language' attribute in the current file"

I guess that makes sense since the langage is in "c#" but the file behind is in vb. Really not sure whether this makes a difference. So instead of using:

<%@ Page language="c#" Codebehind="BasicChart.aspx.vb" AutoEventWireup="false" Inherits="InfoSoftGlobal.GeneralPages.ASP.NET.BasicExample.BasicChart" %> <%@ Page language="c#" Codebehind="BasicChart.aspx.vb" AutoEventWireup="false" Inherits="InfoSoftGlobal.GeneralPages.ASP.NET.BasicExample.BasicChart" %>

VB.net uses the following and doesn't like the "codebehind" and instead used the "codefile". Kind of confused with the "InfoSoftGlobal.GeneralPages.ASP.NET.BasicExample.BasicChart" line. What do I need to do to get this to work????????.

<%@ Page language="c#" AutoEventWireup="false" CodeFile="BasicChart.aspx.vb" Inherits="BasicChart" %>

<

HTML>

<HEAD>

<TITLE>FusionCharts - Simple Column 3D Chart </TITLE>

</HEAD>

<body>

<form id='form1' name='form1' method='post' runat="server">

<%

=GetMonthlySalesChartHtml()%>

</form>

</body>

</HTML>

Share this post


Link to post
Share on other sites

Thanks Mate,

 

 

 

I downloaded the "FusionCharts_Evaluation.zip" and extracted the fusioncharts.dll to a bin folder in the project and added it as a reference ( will that be the only file I need or will i need to extract others as well??). I removed the old "infosoftglobal.dll". I took your link and basically cut and paste this information into a new project so all the code should be intact. However when i go to load the page I get the following error here is the code. I see a sqigerly line under Namespace. When I hover over it says the the "end namespace must be matched with a preceding namespace" so I type in Namespace InfosoftGlobal. All looks good but then i back to my vb page "GetMonthlySalesChartHtml()" thows up an error saying that "get monthlysalescharthtml not declared". Pretty sure that I have the latest version of .net installed. If I dont have the preceding namespace it wont load. Is there something else I might be missing?

 

 

 

BTW, appoligies my my noobness.

 

 

 

 

 

 

 

 

 

Imports InfoSoftGlobal

 

 

 

Partial Class BasicChart

 

Inherits System.Web.UI.Page

 

 

 

Public Function GetMonthlySalesChartHtml() As String

 

Return FusionCharts.RenderChartHTML("../FusionCharts/Column3D.swf", "Data/Data.xml", "", "myFirst", "600", "300", False)

 

End Function

 

 

 

End Class

 

 

 

End Namespace

Share this post


Link to post
Share on other sites

Thanks for your quick response Arindam, got the basic chart to work. Just a couple of things i am hoping you have a couple of minutes to explain:

1) what is the purpose of "<asp:Literal ID="Literal1" runat="server"></asp:Literal>" at line 27 on the basicchart.aspx do?

2) also what is the purpose of:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Literal1.Text = GetMonthlySalesChartHtml()

End Sub

3 ) what does it mean by partial class?

Thanks Again!

Share this post


Link to post
Share on other sites

Hi,

1) Literal control used as a place holder for FusionCharts. I am just forcing FusionCharts to be rendered in that region.

 

2) Page_Load run automatically when Asp.net aspx page run and when Page_Load event called it invokes GetMonthlySalesChartHtml() and return a string redirect to Literal control.

 

3) When you generate Vb.Net aspx code behind program this time class must be be partial. This is a Microsoft syntax please visit Microsoft MSDN site for details.

Edited by Guest

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