Results 1 to 4 of 4

Thread: HOw to pass a dataset column as a parameter to Crystal?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    184

    HOw to pass a dataset column as a parameter to Crystal?

    I am using vb.net 2005 and crystal reports and I am wanting to pass a calculation I have in my select statement to crystal as a parameter.

    My select is like this

    Select (ks.TotWeight / 100) * price.mkprice)) As TotalPrice, ks.Pay, ......

    my select contains alot of other fields + a join on the price table.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: HOw to pass a dataset column as a parameter to Crystal?

    VB Code:
    1. If Not [Parameter] = "" Then Report.SetParameterValue(0, [Parameter])

  3. #3
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    5,034

    Re: HOw to pass a dataset column as a parameter to Crystal?

    Shak,

    This code sample you provided....it that within a VB.Net app or CR? Also, for the SelectionFormula....can you use an embedded SQL statement?

    Thanks,
    Blake

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    184

    Re: HOw to pass a dataset column as a parameter to Crystal?

    I tried that with no luck. The essential problem I am having is this:

    I have 2 tables with fields that appear in my report. My select statement does on a join to have conditions met on both tables. If I run the query in Query Analyzer, it returns 1 record, like it should. One of the fields on my report is a formula.

    ({ks.tot_c_weight} / 100) * {price.mkprice}

    Whenever I add this formula to the report, the report removes ALL data when I actually run it. If I remove the fomula from the report, then all of the data appears at runtime. I tried it by just adding any field from the Price table to the report, and it doesn't matter which field I drop onto the report, all data is removed.

    This is why I was going to try to pass it as a parameter.

    Any ideas what causes this? I am lost!

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