Chart disappears in stiwebviewer
Posted: Thu Jul 28, 2016 7:14 am
I have created a report which contains a chart. my report runs in web preview normally and the chart is visible. But when I load the report in stiweb viewer the chart is not visible? whats the problem?
Code: Select all
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ChartTestStimul.Default" %>
<%@ Register Assembly="Stimulsoft.Report.Web" Namespace="Stimulsoft.Report.Web" TagPrefix="cc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<cc1:StiWebViewer ID="StiWebViewer1" runat="server" />
</div>
</form>
</body>
</html>
Code: Select all
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Stimulsoft.Base;
using Stimulsoft.Report;
using Stimulsoft.Report.Dictionary;
namespace ChartTestStimul
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string cs = ConfigurationManager.ConnectionStrings["BA"].ConnectionString;
string s = Server.MapPath("~/Reports/rptVarLineChart.mrt");
StiReport rpt = new StiReport();
rpt.Load(s);
rpt.Dictionary.Databases.Clear();
rpt.Dictionary.Databases.Add(new StiSqlDatabase("BA", cs));
StiWebViewer1.Report = rpt;
}
}
}