shockwave100

Members
  • Content count

    10
  • Joined

  • Last visited

About shockwave100

  • Rank
    Junior Member
  1. embed multiple charts in single page

    Hi there, I cant seem to find any documentation that lends itself to embeding multiple charts in a single page (probably obvious to most but not to poor old me). Do you have some sample code based one one of your basic examples that I can follow? One more question. Will I need to create another adodb connection again on the same page? What the best way around this? Thanks again Shock this is what I have in my code behind page: Imports InfoSoftGlobalImports System.TextPartial Class MultMultChartMDXTestBasicDataXML Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadLiteral1.Text = GetMonthlySalesChartHtml() End Sub Public Function GetMonthlySalesChartHtml() As String Dim cn Dim cel 'Declare cellset variable Dim strMDX 'A string that holds the MDX query Dim sConnect Dim sXML As String Dim intDCO Dim intDC1 Dim intPCO Dim intPC1 Dim yy Dim rcn = Server.CreateObject( "ADODB.Connection")cn.Mode = 3 cn.CursorLocation = 2 cn.IsolationLevel = 4096 sConnect = "DATA SOURCE=myservername;PROVIDER=MYOLAP;Location=myipaddress"cn.Open(sConnect, "username", "password") '--------------------------------------------------------------------------------- ' INSERT MDX STRING HERE strMDX = "SELECT {[accounts].[AAPT_REV],[accounts].[COS_AAPT]} ON COLUMNS,"strMDX = strMDX & "{[Month].[Jul],[Month].[Aug],[Month].[sep],[Month].[Oct],[Month].[Nov],[Month].[Dec],[Month].[Jan],[Month].[Feb],[Month].[Mar],[Month].[Apr],[Month].[May],[Month].[Jun]} ON ROWS"strMDX = strMDX & " FROM [Reportingaapt]"strMDX = strMDX & " WHERE ([Company].[TPWT],[transindicator].[All Indicators],[tradingindicator].[All tradingpartners],"strMDX = strMDX & "[accessmethod].[ALLAccessMethods],[coo_ausext].[Au_ext],[measures].[Financial],[Year].[2008],[Version].[Reported],[product].[TOT_PRODUCT])" '----------------------------------------------------------------------------------- ' OPEN Cellset Objectcel = Server.CreateObject( "ADOMD.Cellset")cel.Open(strMDX, cn) '----------------------------------------------------------------------------------------------intDCO = cel.Axes(0).DimensionCount - 1 intDC1 = cel.Axes(1).DimensionCount - 1 intPCO = cel.Axes(0).Positions.Count - 1 intPC1 = cel.Axes(1).Positions.Count - 1 sXML = "" '------ Define headings and labels -------sXML = sXML & "<chart caption='REVENUE v COS V OPEX V EBITDA (FY08)' numberPrefix='$' formatNumberScale='1' rotateValues='0' placeValuesInside='1' decimals='0' imageSave='1' imageSaveURL='FusionChartsSave.aspx' " & ">"sXML = sXML & "<categories" & ">" '------ Define categories --------------- For yy = 0 To intPC1 For r = 0 To intDC1sXML = sXML & "<category label=" & "'" & cel.Axes(1).positions(yy).Members®.Caption & "'" & " />" Next NextsXML = sXML & "</categories" & ">" '------- define first dataset ------- sXML = sXML & "<dataset seriesName='Revenue'" & ">" For yy = 0 To intPC1sXML = sXML & "<set value=" & "'" & FormatNumber(cel(0, yy).Value, 0, , , 0) & "'" & " />" NextsXML = sXML & "</dataset" & ">" '------- define second dataset ------- sXML = sXML & "<dataset seriesName='COS'" & ">" For yy = 0 To intPC1sXML = sXML & "<set value=" & "'" & FormatNumber(cel(1, yy).Value, 0, , , 0) & "'" & " />" NextsXML = sXML & "</dataset" & ">"sXML = sXML & "<" & "/chart" & ">" Return InfoSoftGlobal.FusionCharts.RenderChart("charts/MSline.swf", "", sXML.ToString, "productSales", "600", "300", False, False) 'crucial to use "sXML.ToString". You need to change it back to html so you read it in webbrowser. 'remember that xml acts as a way to pass information from one place to anohther. once its at it destination 'you need to change it back to html. 'Use below code for single chart only 'Return FusionCharts.RenderChartHTML("charts/Column3D.swf", "", sXML.ToString, "myNext", "600", "300", False) '------------------------------------------------------------------------------------------cn.close() cel = Nothingcn = Nothing End Function End Class
  2. Hi All, I am wondering if its possible to embed multiple charts in the same page? New to the world of asp.net. I can manage to create a multigraph pulling info from our db, but would like to create other graphs on the same page that do this as well. Has anyone been sucessful with this? and if so how the on earth did you do it? Cheers Shock
  3. 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!
  4. 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
  5. Anyone? its like smacking your head against a brick wall. Can anyone provide some good tutorials around asp.net so I can work through this myself?
  6. 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>
  7. Converting Graph in ASP to ASP.net

    Just found something in the doco that might help. When I get it work I will post it in the forum unless someone beats me to it. Cheers Shock
  8. Hi all, I am a newbie when it comes to web development and have been sucessful in creating a page in asp however I am having difficulty tring to convert this in to asp.net. Can anyone have a look at my code to see what parameter stuff I need to add in? Been pulling my hair out trying to trouble shoot and fill in the blanks with my limited knowledge. Hoping that a kind individual will be able help me with a quick fix. I have attempted to try and change it to make it asp.net compliant, but it was a little dodgy so I have just supplied the raw code below that works in an asp page. Here is the code: <%@ Language=VBScript %> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <SCRIPT LANGUAGE="Javascript" SRC="Charts/FusionCharts.js"></SCRIPT> <style type="text/css"> <!-- body { font-family: Arial, Helvetica, sans-serif; font-size: 12px; } --> </style> </HEAD> <% %> <!-- #INCLUDE FILE="Charts/FusionCharts.asp" --> <BODY> <CENTER> <h2>AAPT Australian Operations</h2> <p>This chart can be relicated to suit view based on mdx query.</p> <% Dim cn Dim cat Dim cel Dim strMDX Dim sConnect Dim sXML '------------- Open up connection to OLAP database ---------------------- Set cn = Server.CreateObject("ADODB.Connection") cn.Mode = 3 cn.CursorLocation = 2 cn.IsolationLevel = 4096 'Error when tyring to reference tm1 macro for parameter Location=" & Run("OPTGET", "AdminHost ") 'hardcoded instead sConnect = "DATA SOURCE=mydatasource;PROVIDER=MYOLAP;Location=Aunswa155" cn.Open sConnect, "username", "password" '--------------------------------------------------------------------------------- ' INSERT MDX STRING HERE strMDX = "SELECT {[accounts].[AAPT_REV],[accounts].[COS],[accounts].[OP_COSTS],[accounts].[AAPTEBITDA]} ON COLUMNS," strMDX = strMDX & "{[Month].[Jul],[Month].[Aug],[Month].[sep],[Month].[Oct],[Month].[Nov],[Month].[Dec],[Month].[Jan],[Month].[Feb],[Month].[Mar],[Month].[Apr],[Month].[May],[Month].[Jun]} ON ROWS" strMDX = strMDX & " FROM [Reportingaapt]" strMDX = strMDX & " WHERE ([Company].[TPWT],[transindicator].[All Indicators],[tradingindicator].[All tradingpartners]," strMDX = strMDX & "[accessmethod].[ALLAccessMethods],[coo_ausext].[Au_ext],[measures].[Financial],[Year].[2008],[Version].[Reported],[product].[TOT_PRODUCT])" '----------------------------------------------------------------------------------- ' OPEN Cellset Object Set cel = Server.CreateObject("ADOMD.Cellset") cel.Open strMDX,cn '---------------------------------------------------------------------------------------------- 'Get Dimension and position index to return data from cube intDCO = cel.Axes(0).DimensionCount - 1 intDC1 = cel.Axes(1).DimensionCount - 1 intPCO = cel.Axes(0).Positions.Count - 1 intPC1 = cel.Axes(1).Positions.Count - 1 Response.Write "<BR><H4>Results:</H4>" '------ Define headings and labels ------- sXML = sXML & "<chart caption='REVENUE v COS V OPEX V EBITDA (FY08)' numberPrefix='$' formatNumberScale='1' rotateValues='0' placeValuesInside='1' decimals='0'" & ">" 'sXML = sXML & "<chart caption='AAPT Australian Operations EBITDA V REVENUE' xAxisName='Month' yAxisName='Dollars' showValues='0' formatNumberScale='0' showBorder='1'" & ">" sXML = sXML & "<categories" & ">" '------ Define categories --------------- For yy = 0 to IntPC1 For r = 0 to intDC1 sXML = sXML & "<category label=" & "'" & cel.Axes(1).positions(yy).Members®.Caption & "'" & " />" Next Next sXML = sXML & "</categories" & ">" '------- define first dataset ------- sXML = sXML & "<dataset seriesName='Revenue'" & ">" For yy = 0 to IntPC1 For z = 0 to intPC0 sXML = sXML & "<set value=" & "'" & FormatNumber(cel(z,yy).Value,0,,,0) & "'" & " />" Next Next sXML = sXML & "</dataset" & ">" '------- define second dataset ------- sXML = sXML & "<dataset seriesName='COS'" & ">" For yy = 0 to IntPC1 For z = 0 to intPC0 sXML = sXML & "<set value=" & "'" & FormatNumber(cel(z + 1,yy).Value,0,,,0) & "'" & " />" Next Next sXML = sXML & "</dataset" & ">" '------- define third dataset ------- sXML = sXML & "<dataset seriesName='OPEX'" & ">" For yy = 0 to IntPC1 For z = 0 to intPC0 sXML = sXML & "<set value=" & "'" & FormatNumber(cel(z + 2,yy).Value,0,,,0) & "'" & " />" Next Next sXML = sXML & "</dataset" & ">" '------- define forth dataset ------- 'sXML = sXML & "<dataset seriesName='EBITDA'" & ">" 'For yy = 0 to IntPC1 'For z = 0 to intPC0 'sXML = sXML & "<set value=" & "'" & FormatNumber(cel(z + 3,yy).Value,0,,,0) & "'" & " />" 'Next 'Next 'sXML = sXML & "</dataset" & ">" '--- close graph ---------- sXML = sXML & "<" & "/chart" & ">" Call renderChart("Charts/MSLine.swf", "", sXML, "", 600, 300, false, false) cn.close Set cel = nothing Set cat = nothing Set cn = nothing %>