1、编辑模板 

  1. 运行Designer.WinForms.exe
  2. 新建页面

页面属性设置

3、创建数据库链接

4、创建数据源

5、控件的使用

ReportTitle:标题

Header:列标题

Data:列表数据

Footer:一般用于统计

设置样式:

运行F5查看效果

Panel控制的使用,在同一行上使用不两组数据源,必须使用panel控制来区分不同的数据源 

 

 

 

2、Stimulsoft.Report web报表的展示

前台代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Report.aspx.cs" Inherits="SIT.Application.Web.Areas.ReportPage.Report" %>

<%@ Register Assembly="Stimulsoft.Report.Web, Version=2013.2.1612.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a"
    Namespace="Stimulsoft.Report.Web" TagPrefix="cc1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <cc1:StiWebViewer ID="viewer1"  runat="server"  GlobalizationFile="zh-CHS.xml"  ShowBookmarksButton="False" ShowParametersButton="False" Visible="true" />
        </div>
    </form>
</body>
</html>

后台代码:

    void czlReport()
        {
            string dtTime = Request.QueryString["dtTime"].ToString();
            StiReport stiReport = new StiReport();
            //模板
            exportPath = HttpContext.Current.Server.MapPath("/ReportTemplate/Report.mrt"); 
            stiReport.Load(exportPath); 
            //添加日期参数
            stiReport.Dictionary.Variables.Add(new StiVariable("DateTime", "DateTime", typeof(string), dtTime, false));
            viewer1.ViewMode = StiWebViewMode.WholeReport;
            this.viewer1.Report = stiReport; 
        }

 

Logo

永洪科技,致力于打造全球领先的数据技术厂商,具备从数据应用方案咨询、BI、AIGC智能分析、数字孪生、数据资产、数据治理、数据实施的端到端大数据价值服务能力。

更多推荐