• 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];
            }


        }

    }




  • 相关阅读:
    Spring Cloud 模块简介2
    Eureka简介
    Spring Cloud 模块简介
    成神之路-基础篇 转
    Java面试题无答案
    java程序猿常用Linux命令
    Java工程师成神之路 转
    大型网站技术架构 大纲
    Mockito 相关资料
    webApp路由控制-vue-router2.0
  • 原文地址:https://www.cnblogs.com/gwazy/p/987758.html
Copyright © 2020-2023  润新知