stimulsoft-reports 报表工具的使用方法笔记
1、运行Designer.WinForms.exe2、新建页面页面属性设置3、控件的使用ReportTitle:标题Header:列标题Data:内容数据设置样式:运行效果
·
1、编辑模板
- 运行Designer.WinForms.exe
- 新建页面
页面属性设置
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;
}
更多推荐
所有评论(0)