CSDN博客

img add8849

用代码使水晶报表的文本对象,字段不可见

发表于2004/9/15 12:01:00  1412人阅读

比如你的文本对象的Name为Text1,则:

    try
   {
    CrystalReport1 crReportDocument;
    crReportDocument = new CrystalReport1();
    //crReportDocument.SetDataSource(Class1.ds1.Tables["au1"]);绑定Dataset数据集
    crystalReportViewer1.ReportSource = crReportDocument;    
    CrystalDecisions.CrystalReports.Engine.TextObject GetTextObject = crReportDocument.ReportDefinition.ReportObjects["Text1"] as TextObject;
    GetTextObject.Text = textBox1.Text.Trim();
GetTextObject.ObjectFormat.EnableSuppress = true;  //隐藏了
   }
   catch (Exception ex)
   {
    MessageBox.Show(ex.Message,"系统提示",MessageBoxButtons.OK,MessageBoxIcon.Error);
    
   }

0 0

相关博文

我的热门文章

img
取 消
img