zoukankan      html  css  js  c++  java
  • rdlc报表开发笔记

    rdlc报表开发是以DataSet为基础的,所以首先你得新建一个xsd文件,在xsd文件里添加DataTable.

    接下来新建rdlc文件,拖入Table控件,向导会提示你建数据源,选择DataSet,以及给DataSet命名(这个名字需要与程序中对应)

    rdlc的文本的值支持多语言的写法:

    =IIF(Parameters!Language.Value="zh-CN","区域","Region")

    =IIF(Parameters!Language.Value="zh-CN",Fields!RegionCN.Value,Fields!RegionEN.Value)

    若要执行脚本,请选中此文本框,右键文本框属性,Action,Go to URL,Select URL其表达式为:= "javascript:ViewStoreLicense("& Fields!StoreLicenseId.Value &")",然后页面中要有对应的javascript函数,如下:

    <script type="text/javascript">
            function ViewStoreLicense(StoreLicenseId) {
                var x = screen.width / 2 - 800 / 2;
                var y = screen.height / 2 - 600 / 2;
                window.open("../LicenseManager/StoreLicenseInfo.aspx?Action=5&BusinessDataID=" + StoreLicenseId, "StoreLicense", "location=1,status=1,scrollbars=1, left=" + x + ",top=" + y + ", width=800,height=600");
            }
        </script>

    页面中:

    <rsweb:ReportViewer ID="rpViewer" runat="server" Width="100%" Font-Names="Verdana"
                        Font-Size="8pt" ShowDocumentMapButton="False" ShowRefreshButton="False" ShowZoomControl="False"
                        SizeToReportContent="True" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt"
                        HyperlinkTarget="_self" BackColor="Transparent" BorderColor="Transparent"
                        ShowPrintButton="False">
                        <LocalReport EnableHyperlinks="True">
                        </LocalReport>
    </rsweb:ReportViewer>

                rpViewer.LocalReport.ReportPath = @"bin\Forms\Report\StoreList.rdlc";
                rpViewer.LocalReport.SetParameters(new ReportParameter("Language", Language));
                rpViewer.PageCountMode = PageCountMode.Actual;
                DataTable dtMain = CAReport.GetCompliancedStoreList(LicenseTypeId, StoreNo);

                if (dtMain.Rows.Count > 0)
                {
                    rpViewer.LocalReport.DataSources.Clear();
                    ReportDataSource rds = new ReportDataSource("objReportCN", dtMain);
                    rpViewer.LocalReport.DataSources.Add(rds);
                    rpViewer.LocalReport.Refresh();
                }

    隔行换色:

    选中一个TextBox,设置其BackgroundColor=IIF(RowNumber(nothing) mod 2 = 0, "#d3f0ff", "Transparent")

  • 相关阅读:
    (24)码表
    (23)IO之打印流 PrintStream & Printwriter
    (22)Properties,这不会Io流中的类,但是通常和IO流中的一些流配合使用
    (21)IO流之对象的序列化和反序列化流ObjectOutputStream和ObjectInputStream
    (20)IO流之SequenceInputStream 序列流
    01.vue基础
    02.1插值操作-Mustache语法
    jQuery对节点的增删改查和一些常用的逻辑处理
    递归 阶乘
    电脑远程连接
  • 原文地址:https://www.cnblogs.com/zhangsongshan/p/3054656.html
Copyright © 2011-2022 走看看