|
Regarding Dotnet framework |
Posted by Satish on Jan-28-2010 01:47 |
|
Hello,
i have been using chart director in asp version but now we are changing the application to dotnet version. i just want to know if it supports .net 3.5 framework.if not let me know the framework it supports.
Thanks
satish |
Re: Regarding Dotnet framework |
Posted by Peter Kwan on Jan-28-2010 18:00 |
|
Hi Satish,
Yes. ChartDirector for .NET is fully supports .NET 3.5.
ChartDirector for .NET supports .NET 1.0, 1.1, 2.0, 3.0, 3.5.
Please feel free to download a free trial version of ChartDirector from our web site http://www.advsofteng.com/download.html to try it.
Hope this can help.
Regards
Peter Kwan |
Re: Regarding Dotnet framework |
Posted by Satish on Jan-29-2010 03:20 |
|
Thanks a lot for your quick response
we gonna use chart director to integrate dotnet 3.5 with SQl Server database. So we might use business logic like BLL and Dam for this....I would appreciate if you let me know the code we have to adopt for this type.
the code in the trail version has hard coded values....I need the values to be pulled from database...you can take simple chart as an example for this.
Thanks
Satish |
Re: Regarding Dotnet framework |
Posted by Peter Kwan on Jan-29-2010 21:21 |
|
Hi Satish,
ChartDirector charts are similar to a HTML table. It is a method to display data. In a HTML table, the data are displayed as text. In ChartDirector, the data are displayed as a chart image.
The HTML table can be used in a normal web page with BLL and Dam. No specific changes are needed. Similarly, a ChartDirector chart can be used in a normal web page with BLL and Dam. No specific changes are needed.
Basically, your code may pass the data to ChartDirector, and ChartDirector will use the data to create a chart. Your code can get the data for a database, from your business logic or from any other places.
Most of the sample code filled the data arrays with hard coded data for simplicity. Instead of using hard coded data, your code can read data from your database (or from your business logic or from any other places) and use them to fill the data array.
Some of the sample code in ChartDirector read data from a sample database to create and fill the data arrays. Please refer to the section "Using Data Sources with ChartDirector" in the ChartDirector documentation for some examples.
Hope this can help.
Regards
Peter Kwan |
Re: Regarding Dotnet framework |
Posted by Satish on Feb-04-2010 02:59 |
|
Thanks peter for the Help
given below is the code we used for the ASP Pages...it would be a great help if you let us know the same script for .net framework
Code:
Set con = Server.CreateObject("ADODB.Connection")
con.open(MM_DARES_FLPBS_PBSIS_STRING)
Set mycommand = Server.CreateObject("ADODB.Command")
Set mycommand.ActiveConnection = con
mycommand.CommandType = adCMDStoredProc
mycommand.CommandText = "dbo.flpbs_slr_endyear_issossoverimplem"
mycommand.Parameters.Append mycommand.CreateParameter("p_schoolid",adChar,adParamInput,6)
mycommand.Parameters("p_schoolid") = v_schoolid
Set rs = mycommand.execute()
if not rs.eof then
arrDBData = rs.GetRows()
barray1 = true
end if
rs.close
set rs = nothing
con.close
set con = nothing
iFldF = LBound(arrDBData, 2)
iFldL = UBound(arrDBData, 2)
Set cd = CreateObject("ChartDirector.API")
' The data for the bar chart
labels = Array("ISS", "OSS")
' Create a XYChart object of size 400 x 240 pixels
Set c = cd.XYChart(735, 435)
' Add a title to the chart using 10 pt Arial font
if (barray1) then
Call c.addTitle(v_schoolname & "<*br*>ISS & OSS Over Years of Implementation", "", 10)
else
Call c.addTitle("No data is available for the selected report", "", 14)
end if
' Set the plot area at (50, 25) and of size 320 x 180. Use two alternative background
' colors (0xffffc0 and 0xffffe0)
Call c.setPlotArea(80, 50, 600, 310)
' Add a legend box at (55, 18) using horizontal layout. Use 8 pt Arial font, with
' transparent background
Call c.addLegend(50, 26, False, "", 8).setBackground(cd.Transparent)
Call c.getLegend().setKeySize(12, 12, -1)
' Add a title to the y-axis
call c.xAxis().setTitle("Suspension Type","",10,"00000000")
call c.yAxis().setTitle("Number of ISS & OSS Days","",10,"00000000")
' Reserve 20 pixels at the top of the y-axis for the legend box
Call c.yAxis().setTopMargin(28)
' Set the x axis labels
call c.xAxis().setlabelStyle(,10,,0)
Call c.xAxis().setLabels(labels)
'set margin on y axis
call c.yAxis().setLinearScale(0, cd.NoValue)
' Add a multi-bar layer with 3 data sets and 3 pixels 3D depth
Set layer = c.addBarLayer2(cd.Side, 0)
'colorArray is now brought in from the mitutil.asp page
colorSet = colorArray()
dim bottomMarker, counter
bottomMarker = iFldL - 4
if bottomMarker < 0 then
bottomMarker = 0
end if
'This section assigns a non-red code if the first value in the array is not the baseline
counter = 0
if bottomMarker > 0 then
counter = 1
elseif arrDBData(2,0) <> "Baseline" then
counter = 1
end if
for I = bottomMarker to iFldL
myChartData = Array(roundIt(chkNullNumber(arrDBData(3,I))), roundIt(chkNullNumber(arrDBData(4,I))))
Call layer.addDataSet(myChartData, colorSet(counter), arrDBData(2,I) & " - " & arrDBData(1,I))
counter = counter + 1
next
' Enable bar label for each segment
Call layer.setAggregateLabelStyle()
' output the chart
Response.ContentType = "image/png"
Response.BinaryWrite c.makeChart2(cd.PNG)
Response.End
set cd = nothing |
Re: Regarding Dotnet framework |
Posted by Peter Kwan on Feb-05-2010 00:57 |
|
Hi Satish,
I can help you to translate the charting part of the code. However, I cannot translate the other parts of your code. You have to translate them yourself.
' The data for the bar chart
Dim labels() As String = { "ISS", "OSS" }
Dim c As XYChart = New XYChart(735, 435)
' Add a title to the chart using 10 pt Arial font
if (barray1) then
c.addTitle(v_schoolname & "<*br*>ISS & OSS Over Years of Implementation", "", 10)
else
c.addTitle("No data is available for the selected report", "", 14)
end if
' Set the plot area at (50, 25) and of size 320 x 180. Use two alternative background
' colors (0xffffc0 and 0xffffe0)
c.setPlotArea(80, 50, 600, 310)
' Add a legend box at (55, 18) using horizontal layout. Use 8 pt Arial font, with
' transparent background
c.addLegend(50, 26, False, "", 8).setBackground(Chart.Transparent)
c.getLegend().setKeySize(12, 12, -1)
' Add a title to the y-axis
c.xAxis().setTitle("Suspension Type","",10,&H00000000)
c.yAxis().setTitle("Number of ISS & OSS Days","",10,&H00000000)
' Reserve 20 pixels at the top of the y-axis for the legend box
c.yAxis().setTopMargin(28)
' Set the x axis labels
c.xAxis().setlabelStyle("Arial",10,,0)
c.xAxis().setLabels(labels)
'set margin on y axis
c.yAxis().setLinearScale(0, Chart.NoValue)
' Add a multi-bar layer with 3 data sets and 3 pixels 3D depth
Dim layer As BarLayer = c.addBarLayer2(Chart.Side, 0)
.... your own code, please translate yourself ....,
layer.addDataSet(myChartData, colorSet(counter), arrDBData(2,I) & " - " & arrDBData(1,I))
.... your own code, please translate yourself ....
' Enable bar label for each segment
layer.setAggregateLabelStyle()
' output the chart
Response.ContentType = "image/png"
Response.BinaryWrite(c.makeChart2(cd.PNG))
Response.End
Hope this can help.
Regards
Peter Kwan |
Re: Regarding Dotnet framework |
Posted by Satish on Feb-10-2010 01:23 |
|
Thanks a lot Peter for your help
I have a function which uses patterncolor something like this:
wcol = "H0066CC"
bcol = "Hffffff"
actualColor = c.patternColor(Array(wcol, wcol, wcol, bcol), 4)...
i am trying to do something like
Dim actualcolor as string ={wcol, wcol, wcol, bcol}
actualcolor = c.patterncolor()
and i am ending u with errors
can you please convert this into asp.net code please
thanks in advance |
Re: Regarding Dotnet framework |
Posted by Peter Kwan on Feb-10-2010 18:12 |
|
Hi Satish,
Usually, we will help for translating the charting code. It is assumed the user is already familiar with the programming language he is using. If you are not too familiar with VB.NET, you may consider to refer to VB.NET documentation on how to use it.
In your case, even the origin ASP/VBScript code is incorrect. For example, the:
'incorrect code - because as according to ChartDirector documentation, the
'color should be an integer, not a text string
wcol = "H0066CC"
'Correct code - this is one of the valid syntax in VBScript for specifying an integer
wcol = &H0066CC 'correct code in VBScript
'correct code in VB.NET
Dim wcol As Integer = &H0066CC
.. same for bcol ...
To declare an array of integers, the code in VB.NET is as follows. Please refer to VB.NET documentation for details:
Dim myArray as Integer() = {wcol, wcol, wcol, bcol}
To create a pattern color, the code is:
Dim actualColor As Integer = c.patternColor(myArray, 4)
Hope this can help.
Regards
Peter Kwan |
|