$ ("#btn_search"). Click (function () {
var computetime = $ ("#txt_computeTime_"). Val ();
var endcomputetime = $ ("#txt_EndcomputeTime_"). Val ();
var Simulationnumber = $ ("#txt_simulationNumber_"). Val ();
var Riskbookid = $ ("#txt_select_"). Val ();
var checked = $ ("#chk_3d"). Checked;
var ViewType = "2d";
if (checked) {
ViewType = "3d";
}
var url = "/reporteg/report2.aspx?_method=getreport&txt_computetime_=" + computetime + "&txt_simulationnumber _= "+ simulationnumber +" &txt_select_= "+ riskbookid +" &viewtype= "+ ViewType +" &txt_endcomputetime_= "+ en Dcomputetime + "";
$.ajax ({
Async:true,
Type: "GET",
Url:url,
Data: {},
DataType: "Text",
Success:function (data) {
$ ("#VisifireChart1"). HTML ("");
if (Data.length > 0) {
var vchart = new Visifire2 ('.. /sl. Visifire.Charts.xap ', 800, 500);
Vchart.setdataxml (data);
Vchart.render (' VisifireChart1 ');
}
}
});
});
Background:
if (request["_method"] = = "GetReport")
{
String riskbookid = request["Txt_select_"]. ToString ();
String computedate = request["Txt_computetime_"]. ToString ();
String endcomputedate = request["Txt_endcomputetime_"]. ToString ();
String simulationnumber = request["Txt_simulationnumber_"]. ToString ();
String ViewType = request["ViewType"]. ToString ();
Txt_computetime_. Value = computedate;
Txt_simulationnumber_. Value = Simulationnumber;
if (string. IsNullOrEmpty (riskbookid) | | String. IsNullOrEmpty (computedate) | | String. IsNullOrEmpty (Simulationnumber))
{
throw new Exception ("Query parameters are not nullable!) ");
}
Framework.queryinfo info = new Framework.queryinfo ();
Info. Queryobject = "Rskbookhistogram";
Info. Customsql = "Select Tick_value,frequency_value from Rsk_book_histogram where Compute_date>=:compute_date and Compute _date<=:endcomputedate and simulation_number= "+ simulationnumber;
Info. Parameters.Add ("Compute_date", DateTime.Parse (computedate));
Info. Parameters.Add ("Endcomputedate", DateTime.Parse (endcomputedate));
DataSet dt = Dao.excutedataset (info);
Vchartdataset = DT;
String outputtext = "<script language= ' javascript ' type= ' text/javascript ' >";
var dataxml = "";
if (ViewType = = "3d")
DataXML + = "<vc:chart xmlns:vc= ' clr-namespace:visifire.charts;assembly=slvisifire.charts ' Width= ' Height= ' + ' theme= ' Theme1 ' borderthickness= ' 0 ' view3d= ' True ' watermark= ' false ' scrollingenabled= ' false ' > ';
else if (ViewType = = "2d")
DataXML + = "<vc:chart xmlns:vc= ' clr-namespace:visifire.charts;assembly=slvisifire.charts ' Width= ' Height= ' ' Theme= ' Theme1 ' borderthickness= ' 0 ' view3d= ' false ' watermark= ' false ' scrollingenabled= ' false ' > ';
DataXML + = "<vc:chart.titles><vc:title text=" Analysis Figure 2 '/></vc:chart.titles> ";
DataXML + = "<vc:chart.axesx><vc:axis title= ' histogram horizontal ' ></vc:Axis></vc:Chart.AxesX>";
DataXML + = "<vc:chart.axesy><vc:axis title= ' frequency value '/></vc:chart.axesy>";
DataXML + = "<vc:Chart.Series>";
DataXML + = "<vc:dataseries legendtext=" renderas= ' Column ' labelenabled= ' true ' labelstyle= ' OutSide ' cursor= ' Hand ' > ";
DataXML + = "<vc:DataSeries.DataPoints>";
foreach (DataRow row in dt. Tables[0]. Rows)
{
DataXML + = "<vc:datapoint axisxlabel=" + row["Tick_value"]. ToString () + "' yvalue= '" + row["Frequency_value"]. ToString () + "'/>";
}
DataXML + = "</vc:DataSeries.DataPoints>";
DataXML + = "</vc:DataSeries>";
DataXML + = "</vc:Chart.Series>";
DataXML + = "</vc:Chart>";
Response.Write (DataXML);
Response.End ();
}
Asynchronous loading of report pages