本文介绍了Vs 2010我想按学生编号过滤只有一名学生的水晶报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据库,表格为毕业表,字段为(ID,STDID,年级,GPA)学生表,字段为(STDID,FName,LName)我想显示一个水晶报告,其中包含我放在文本框中的特定学生编号在窗体上,字段为(STDID,FName,LName,Grade,GPA)...



我已经制作了水晶报告和表格,带有文本框和按钮。按钮上的代码如下:

I have database with tables as Graduation table with fields as(ID,STDID,Grade,GPA) Student table with fields as(STDID,FName,LName) i want to show a crystal report with specific student number i put on textbox on the windows form, fields as (STDID,FName,LName,Grade,GPA)...

I have made the crystal report and Form with textbox and button. Code on the button as follow:

private void button1_Click(object sender, EventArgs e)
    {
        if (textBox1.Text == "")
        {
            MessageBox.Show("Plese Inter Student's ID");
            textBox1.Focus();
        }
        else
        {
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.Title = "Select Crystal Reports file";
            dlg.Filter = "Crystal Reports (*.rpt)|*.rpt|All Files (*.*)|*.*";
            dlg.InitialDirectory = "D:\\Graduation System\\Graduation System\\graduatedstudents.rpt";
cryRpt.SetParameterValue("STDID");
            CRV1.ReportSource = cryRpt;
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                this.Cursor = Cursors.WaitCursor;
                CRV1.ReportSource = dlg.FileName;
                this.Cursor = Cursors.Default;
            }

        }
    }







错误:

错误1方法'SetParameterValue'没有重载需要1个参数D:\ Graduation System \ Graduation System \Form2.cs 26 13毕业系统




the error:
Error1No overload for method 'SetParameterValue' takes 1 argumentsD:\Graduation System\Graduation System\Form2.cs2613Graduation System

推荐答案

cryRpt.SetParameterValue("STDID", textBox1.Text);


这篇关于Vs 2010我想按学生编号过滤只有一名学生的水晶报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 10:52