zoukankan      html  css  js  c++  java
  • Ms rdlc 打印

      

      
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using Microsoft.Reporting.WinForms;

    using Microsoft.Practices.EnterpriseLibrary.Data;
    using Microsoft.Practices.EnterpriseLibrary.Common;
    using System.Data.Common;
    namespace Client
    {
        
    public partial class Form3 : Form
        
    {
            
    public Form3()
            
    {
                InitializeComponent();
            }


            
    private void Form3_Load(object sender, EventArgs e)
            
    {   
                
               
                 
                
    this.reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("RailwayDataDataSet_BridgeList", ReturnData()));
                
    this.reportViewer1.LocalReport .ReportPath=@"D:\铁路\Client\Client\Report1.rdlc";
        
                
    this.reportViewer1.RefreshReport();
                 
    this.reportViewer1.SetDisplayMode(DisplayMode.PrintLayout);
              
               
               
            }

          
            
    public DataTable ReturnData()
            
    {
                
    string sql = "select   * from BridgeList";
                Database db 
    = DatabaseFactory.CreateDatabase();
                DbCommand dc 
    = db.GetSqlStringCommand(sql);

                
    return db.ExecuteDataSet(dc).Tables[0];
            }


        }

    }




  • 相关阅读:
    如何在Ubuntu 18.04上安装Memcached
    ubuntu安装mysql添加密码
    Django学习---快速搭建搜索引擎(haystack + whoosh + jieba)
    django3.x 使用haystack 报错:ImportError: cannot import name 'six' from 'django.utils'
    spring boot2之Jackson和ObjectMapper
    python之装饰器强制函数上的类型检查
    python之*args和**kwargs的区别
    Python之@property
    python基础语法之and,or,not
    小案例
  • 原文地址:https://www.cnblogs.com/gwazy/p/987758.html
Copyright © 2011-2022 走看看