Results 1 to 12 of 12

Thread: [RESOLVED] passing value to crystal report

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] passing value to crystal report

    hi,
    How to pass value to crystal report text object?

    ex. form1.label1.text pass to crystal text object.

    popskie

  2. #2
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    not totally familiar with crystal reports, mostly this is what i did. In the crystal report i used the parameter fields in order to hold values coming from my form, so this would be.

    Code:
    ParameterDiscreteValue pd = new ParameterDiscreteValue();
    		ParameterValues pv = new ParameterValues();
    
    		private void button1_Click_1(object sender, System.EventArgs e)
    		{
    			CrystalReport1 cr = new CrystalReport1(); 
    			pd.Value = this.textBox1.Text;
    			pv.Add(pd);
    			cr.DataDefinition.ParameterFields["name"].ApplyCurrentValues(pv); // "name" is the parameter set in my crystal report
                crystalReportViewer1.ReportSource = cr; // report viewer
    		}
    hope that helps.

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: passing value to crystal report

    My crystal report has no table involve. Just only a textbox but what I want during runtime my form pass the value to report textbox.

  4. #4
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    then you should put a parameter fields in you crystal report and that code above.

  5. #5
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    here....
    Attached Images Attached Images  

  6. #6

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: passing value to crystal report

    ok fret, how to show the field explorer .

  7. #7
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    it is already there in your crystal report design.

  8. #8

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: passing value to crystal report

    It is invisible in my c# app. but in crystal report designer its ok.

    popskie

  9. #9
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    Quote Originally Posted by popskie
    It is invisible in my c# app. but in crystal report designer its ok.

    popskie
    what do you mean by that? i don't quitely get it? could you explain it more, because i actually what i did, in my c# app i add a new item>>crystal report, just that, you'll only see the field explorer in the crytal report itself.

  10. #10

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: passing value to crystal report

    pls take alook the attach doc file.

    popskie
    Last edited by popskie; Mar 22nd, 2007 at 02:21 AM.

  11. #11
    Hyperactive Member fret's Avatar
    Join Date
    Sep 2004
    Posts
    472

    Re: passing value to crystal report

    i see....ehehe there's no "field explorer" try press Ctrl+Alt+T.

  12. #12

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: passing value to crystal report

    ok thanks a lot .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width