locked
using if condition in report RRS feed

  • Question

  • User-1474096950 posted
    i have a paramater in the report if the paramater value is R i need to display the feild residentail add else company address how do i write teh formuala to display one of the 2 fields
    Wednesday, May 23, 2012 5:24 AM

All replies

  • User346103577 posted

    Please share the type of Report.

    Crystal reports or RDLC reports

    Saturday, May 26, 2012 10:22 AM
  • User-1474096950 posted

    crystal report

    Sunday, May 27, 2012 2:14 AM
  • User346103577 posted
    if Field="R" then 
        residentail 
    else
        Company
    

    Sunday, May 27, 2012 11:47 AM
  • User-1474096950 posted
    if Field="R" then its not a field its a value passed from front end . if i take it as parameter i tried with above formula but its nt wrking
    Monday, May 28, 2012 4:58 AM
  • User346103577 posted

    Alternate:-

    Write your Sql somethink like.

    string strvar="R";

    string Sql="Select *, "+ strvar + " as CheckFormula from table";

    And in your report it will become Field to put if condition.

    Monday, May 28, 2012 6:31 AM
  • User-1474096950 posted
    i get invallid column name
    Monday, May 28, 2012 8:14 AM
  • User346103577 posted

    You need to add and than refresh your datasource to use this column in your crystal report.

    Is the "FIELD" is coming in you report ?

    Monday, May 28, 2012 8:21 AM
  • User-1474096950 posted
    without adding an additional feild just with the help of a variavle value is it not possible? do we need to have field on;ly??
    Monday, May 28, 2012 8:50 AM
  • User346103577 posted

    Cannot say.

    As I have used this alternate for such jobs.

    Monday, May 28, 2012 9:51 AM