Hi,
I've wrote the code GRAPHIC_ENGINE. ASPX.VB
but it doesn't work properly, because the chart appears only with one
dataline (the last line resulting from the query). Can anyone tell me
what i'm doing wrong?
Thanks in advance.
Marco Viana
Portugal
GRAPHIC_ENGINE. ASPX.VB:
Imports System
Imports System.Data
Imports System.Data.Sql Client
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.W ebControls
Imports System.Web.UI.H tmlControls
Imports Microsoft.Offic e.Interop
Imports Microsoft.Offic e.Interop.OWC
Public Class graphic_engine
Inherits System.Web.UI.P age
Protected WithEvents chartspace1 As OWC.ChartSpace
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
Response.Buffer = True
'''************ *************** *************** *************** ***
'''*** Query building
'''************ *************** *************** *************** ***
Dim v_campanha As String
v_campanha = Request.QuerySt ring("idcampanh a")
Dim a_campanha() As String
a_campanha = Split(v_campanh a, ",")
Dim v_estacao As String
v_estacao = Request.QuerySt ring("idestacao ")
Dim a_estacao() As String
a_estacao = Split(v_estacao , ",")
Dim v_parametro As String
v_parametro = Request.QuerySt ring("idparamet ro")
Dim v_profundidade As String
v_profundidade = Request.QuerySt ring("idprofund idade")
Dim a_sql_series(UB ound(a_estacao) + 1, 1) As String
'Criar primeira linha do array com uma query que vai criar
todas as campanhas
a_sql_series(0, 0) = "SELECT nome, 0 AS valor FROM l_periodo
ORDER BY codigo"
a_sql_series(0, 1) = "SELECT count(*) FROM l_periodo"
Dim j As Integer
j = 0
Dim k As Integer
k = 1
While j <= UBound(a_estaca o)
a_sql_series(j + 1, 0) = "SELECT periodo,cast(va lor AS
float),parametr o,profund,unid FROM l_medicoes WHERE parametro_codig o="
& v_parametro & " AND profund='" & v_profundidade & "' AND
local_codigo=" & a_estacao(j) & " AND (periodo_codigo = " &
a_campanha(0) & " "
'a_sql_series(j , 0) = "SELECT periodo_codigo, cast(valor AS
float),parametr o,profund,unid FROM l_medicoes WHERE parametro_codig o="
& v_parametro & " AND profund='" & v_profundidade & "' AND
local_codigo=" & a_estacao(j) & " AND (periodo_codigo = " &
a_campanha(0) & " "
a_sql_series(j + 1, 1) = "SELECT count(*) FROM l_medicoes
WHERE parametro_codig o=" & v_parametro & " AND profund='" &
v_profundidade & "' AND local_codigo=" & a_estacao(j) & " AND
(periodo_codigo = " & a_campanha(0) & " "
While k <= UBound(a_campan ha)
a_sql_series(j + 1, 0) = a_sql_series(j + 1, 0) & " OR
periodo_codigo = " & a_campanha(k) & " "
a_sql_series(j + 1, 1) = a_sql_series(j + 1, 1) & " OR
periodo_codigo = " & a_campanha(k) & " "
If k = UBound(a_campan ha) Then
a_sql_series(j + 1, 0) = a_sql_series(j + 1, 0) &
") "
a_sql_series(j + 1, 1) = a_sql_series(j + 1, 1) &
") "
End If
k = k + 1
End While
a_sql_series(j + 1, 0) = a_sql_series(j + 1, 0) & " ORDER
BY periodo_codigo"
j = j + 1
k = 1
End While
'''************ *************** *************** *************** ***
'''*** End Query Building
'''************ *************** *************** *************** ***
'declare chartsapce, chart and "series objects" of OWC
'new chartspace
Dim chartspace1
chartspace1 = New OWC.ChartSpace( )
chartspace1.Cle ar()
'new chart
chartspace1.cha rts.add()
'DB Connection
Dim ConnStr As String
ConnStr = f_conexion_stri ng_bd(Session(" username"),
Session("passwo rd"))
Dim PubsConn As New SqlClient.SqlCo nnection(ConnSt r)
PubsConn.Open()
'Loop--> creation of graphic
Dim m As Integer
m = 0
While m <= UBound(a_sql_se ries)
Dim countCmd As New SqlCommand(a_sq l_series(m, 1),
PubsConn)
Dim perfilCmd As New SqlClient.SqlCo mmand(a_sql_ser ies(m,
0), PubsConn)
'Declare DataReader object
Dim data_reader As SqlClient.SqlDa taReader
'Declare variables
Dim i As Integer
Dim numpoints 'number of datapoints
Dim categories() 'array with x values
Dim values() 'array with y values
'1st: find number of datapoints
data_reader = countCmd.Execut eReader()
data_reader.Rea d()
numpoints = data_reader.Get Value(0)
data_reader.Clo se()
'Redim arrays
ReDim values(numpoint s - 1)
ReDim categories(nump oints - 1)
'2nd: bind arrays
data_reader = perfilCmd.Execu teReader
i = 0
While data_reader.Rea d
categories(i) = data_reader.Get Value(0)
'Response.Write (categories(i) & "<br>")
values(i) = data_reader.Get Value(1)
'Response.Write (values(i) & "<p>")
i = i + 1
End While
'3th create graphs
chartspace1.cha rts(0).seriesco llection.add(m)
chartspace1.cha rts(0).seriesco llection(m).typ e =
chartspace1.con stants.chChartT ypeLineMarkers
chartspace1.Cha rts(0).SeriesCo llection(m).Set Data(OWC.ChartD imensionsEnum.c hDimCategories,
OWC.ChartSpecia lDataSourcesEnu m.chDataLiteral , categories)
chartspace1.Cha rts(0).SeriesCo llection(m).Set Data(OWC.ChartD imensionsEnum.c hDimValues,
OWC.ChartSpecia lDataSourcesEnu m.chDataLiteral , values)
data_reader.Clo se()
m = m + 1
End While
PubsConn.Close( )
'Format chart
With chartspace1.Cha rts(0)
.HasLegend = True
.Legend.Positio n =
OWC.ChartLegend PositionEnum.ch LegendPositionB ottom
.HasTitle = True
.Title.Caption = "Gráfico"
.Axes(0).HasTit le = True
.Axes(0).Title. Caption = "Campanha"
.Axes(1).HasTit le = True
.Axes(1).Title. Caption = "parametro"
End With
With chartspace1.Cha rts(0).SeriesCo llection(0)
.line.color = "white"
.interior.color = "white"
.border.color = "white"
.caption = ""
.Marker.Style = ChartMarkerStyl eEnum.chMarkerS tyleNone
'.DataLabelsCol lection.Add()
End With
With chartspace1.Cha rts(0).SeriesCo llection(1)
'.line.color = "black"
'.zorder = 200
End With
'chartspace1.Ch arts(0).SeriesC ollection(2).
'Legends
Dim n As Integer
n = 1
Dim sql_estacao As String
While n <= UBound(a_estaca o) + 1
sql_estacao = "SELECT nome FROM l_local WHERE codigo=" &
a_estacao(n - 1)
Dim estacaoCmd As New SqlClient.SqlCo mmand(sql_estac ao,
PubsConn2)
Dim lista_estacao As SqlClient.SqlDa taReader
lista_estacao = estacaoCmd.Exec uteReader()
lista_estacao.R ead()
chartspace1.Cha rts(0).SeriesCo llection(n).cap tion =
lista_estacao.G etValue(0)
lista_estacao.C lose()
n = n + 1
End While
PubsConn2.Close ()
Response.Conten tType = "image/gif"
Response.Expire s = 0
Response.Binary Write(chartspac e1.GetPicture(" gif", 600, 400))
Response.End()
End Sub
End Class 0 2230 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Dave |
last post by:
After following Microsofts admonition to reformat my system before doing a
final compilation of my app I got many warnings/errors upon compiling an rtf
file created in word. I used the Help Workshop program: hcw.exe that's
included with Visual Basic. This exact same file compiled perfectly with no
notes, warnings or errors prior to reformatting my system. Prior to the
reformatting, I copied the help.rtf file onto a CD and checked the box to...
|
by: wukexin |
last post by:
Help me, good men. I find mang books that introduce bit "mang header
files",they talk too bit,in fact it is my too fool, I don't learn it, I have
do a test program, but I have no correct doing result in any way. Who can
help me, I thank you very very much.
list.cpp(main program)
//--------------------------------------------------------------------------
-
#pragma hdrstop
#pragma argsused
|
by: Colin J. Williams |
last post by:
Python advertises some basic service:
C:\Python24>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
With numarray, help gives unhelpful responses:
|
by: Corepaul |
last post by:
Missing Help Files
When I enter "recordset" as the keyword and search the Visual Basic Help index,
I get many topics of interest in the resulting list. But there isn't any
information available from clicking on many of the available topics (mostly
methods but some properties are also unavailable). This same problem occurs
with many, if not most, keywords.
Is there any way I can activate these "missing" help topics? HELP!
|
by: MNFV |
last post by:
Hi,
I've wrote the code GRAPHIC_ENGINE.ASPX.VB
but it doesn't work properly, because the chart appears only with one
dataline (the last line resulting from the query). Can anyone tell me
what i'm doing wrong?
Thanks in advance.
Marco Viana
Portugal
| |
by: Steve |
last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp
My expectation is that a developer using my DLL would be able to access this help file during his development time using "F1" help within the VB IDE. Is this expectation achievable
In trying to test my help file in the IDE, I have a solution with 2 projects: the DLL and a tester. VB does not look for my help file; instead, it looks for path to my source code...
|
by: Mark |
last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my
home computer has an abbreviated help screen not 2% of the help on my laptop.
All the settings look the same on both including search the internet for
help, but the help is worthless. Any ideas?
|
by: JonathanOrlev |
last post by:
Hello everybody,
I wrote this comment in another message of mine, but decided to post it
again as a standalone message.
I think that Microsoft's Office 2003 help system is horrible, probably
the worst I
ever seen.
I almost cannot find anything I need, including things I
|
by: trunxnirvana007 |
last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"'
'UPGRADE_WARNING: Couldn't resolve default property of object Label. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
Label = New Object(){Box1, Box2, Box3, Box4, Box5, Box6, Box7, Box8, Box9, Box10, Box11,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |