日期:2011-11-05  浏览次数:20554 次

///Form文件
namespace SimpleApp
{
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.WinForms;
using System.Data;

public class SimpleForm : System.WinForms.Form
{
    private System.ComponentModel.Container components;
    private System.WinForms.Button btnSelectReport;    
    private SeagateSoftware.WinForms.CrystalReportViewer crystalReportViewer1;

    public SimpleForm()
    {
        //
        // Required for Win Form Designer support
        //
        InitializeComponent();
        EnableViewer(false);
    }

    public override void Dispose()
    {
        base.Dispose();
        components.Dispose();
    }

    private void InitializeComponent()
    {
        this.components = new System.ComponentModel.Container();
        this.crystalReportViewer1 = new SeagateSoftware.WinForms.CrystalReportViewer();
        this.btnSelectReport = new System.WinForms.Button();
        
        this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
        this.Text = "Viewing a Crystal Report";
        this.StartPosition = System.WinForms.FormStartPosition.CenterScreen;
        //@design this.TrayLargeIcon = false;
        //@design this.TrayHeight = 0;
        this.ClientSize = new System.Drawing.Size(664, 509);
        
        crystalReportViewer1.Location = new System.Drawing.Point(8, 40);
        crystalReportViewer1.Size = new System.Drawing.Size(648, 464);
        crystalReportViewer1.ActiveViewIndex = -1;
        crystalReportViewer1.SelectionFormula = "";
        crystalReportViewer1.DisplayToolbar = true;
        crystalReportViewer1.DisplayGroupTree = true;
        crystalReportViewer1.TabIndex = 2;
        crystalReportViewer1.Anchor = System.WinForms.AnchorStyles.All;
        crystalReportViewer1.DisplayBackgroundEdge = false;
        
        btnSelectReport.Location = new System.Drawing.Point(8, 8);
        btnSelectReport.Size = new System.Drawing.Size(96, 24);
        btnSelectReport.TabIndex = 1;
        btnSelectReport.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Bold);
        btnSelectReport.Text = "Select Report";
&nb