IIF condition in the RDL file
hi i have two rdl tables which are generated as two tabs in the excel report. i need to hide one of the table based on the front end UI selection. hence i need to use 2 IIF clauses in the visiblity expression. but im not sure how to write two IIF clause =IIF(Parameters!t_typeSelection.Value= "Employee", True, False) =IIF(Parameters!t_Emp_ID.Value = 0, True, False) these are the 2 IIF conditions which should be checked and if emp_id =0 AND type selection = employees only then this table should be hidden. can u help me out here thanks justin
December 29th, 2010 3:38pm

Hi Justin, try this into Visiblity tab, for the Hidden Expression as:- = IIf( Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_Emp_ID.Value = 0, True, False) Please let me know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 3:42pm

You may slightly simplify the expression: = (Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_Emp_ID.Value = 0) Remember to mark as an answer if this post has helped you.
December 29th, 2010 3:49pm

ok thanks guys for prompt reply this think works but got another issue when the IIF condition fails "Employee", True, False) =IIF(Parameters!t_Emp_ID.Value = 0, True, False) if this condition fails both the tables are being displayed on the same excel tab. previous each table was displayed on seperate tab. now when this condition fails both the tables are being displayed in the same tab - one below the other. i have checked ' insert page break after this table option' but no effect display's the same can u suggest something =IIF(Parameters!t_typeSelection.Value=
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 4:45pm

ok thanks guys for prompt reply this think works but got another issue when the IIF condition fails "Employee", True, False) =IIF(Parameters!t_Emp_ID.Value = 0, True, False) if this condition fails both the tables are being displayed on the same excel tab. previous each table was displayed on seperate tab. now when this condition fails both the tables are being displayed in the same tab - one below the other. i have checked ' insert page break after this table option' but no effect display's the same can u suggest something =IIF(Parameters!t_typeSelection.Value=
December 29th, 2010 4:45pm

Hi Justin, Please frame your question correctly, so that we can understand your question correctly. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 5:14pm

Hi Justin, Please frame your question correctly, so that we can understand your question correctly. Thanks KumarKG, MCTS
December 29th, 2010 5:14pm

well i have table1 and table 2 on the same rdl file when the user selects table 1 and gives emp id - the report displays table1 data when the user selects table 2 and gives staff id - the report displays table 2 data to establish this i used the way u suggested FOR table 1 =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_Emp_ID.Value = 0, True, False) for table 2 =IIF(Parameters!t_typeSelection.Value= "staff" AND Parameters!t_staff_ID.Value = 0, True, False) now this is working fine. when the user selects employee and give employee id - table 1 gets displayed and when the user selects staff and gives staff id - table 2 gets displayed. now the problem is when the IIF condition in the rdl for visibility fails - for instance when the user selects either employee or staff and doesnt mention any ID then I should DISPLAY both employee and staff information in the report - which is happening but both the employee data and staff data are on the same spread sheet of excel one below the other. i want to show table1(employee) on one tab and table2(staff) on other tab. i checked " insert page break after this table option'" option in table properties for rdl but no use. all i want to show is employee data and staff data on different tabs in excel but as of now both the data is coming on the same sheet one below the other. thanks for ur help
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 5:53pm

well i have table1 and table 2 on the same rdl file when the user selects table 1 and gives emp id - the report displays table1 data when the user selects table 2 and gives staff id - the report displays table 2 data to establish this i used the way u suggested FOR table 1 =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_Emp_ID.Value = 0, True, False) for table 2 =IIF(Parameters!t_typeSelection.Value= "staff" AND Parameters!t_staff_ID.Value = 0, True, False) now this is working fine. when the user selects employee and give employee id - table 1 gets displayed and when the user selects staff and gives staff id - table 2 gets displayed. now the problem is when the IIF condition in the rdl for visibility fails - for instance when the user selects either employee or staff and doesnt mention any ID then I should DISPLAY both employee and staff information in the report - which is happening but both the employee data and staff data are on the same spread sheet of excel one below the other. i want to show table1(employee) on one tab and table2(staff) on other tab. i checked " insert page break after this table option'" option in table properties for rdl but no use. all i want to show is employee data and staff data on different tabs in excel but as of now both the data is coming on the same sheet one below the other. thanks for ur help
December 29th, 2010 5:53pm

Hi, Please try the below 1. right clicking the second table and open tablix properties 2. Under page break option, check the 'Add a page break before' Hope this helps Please click "Mark as Answer" if this resolves your problem or "Vote as Helpful" if you find it helpful. BH
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 10:51pm

did the same but no effect..... im still getting both the tables on the same tab of the report any other suggestion
December 30th, 2010 9:32am

Hi Justin, Thank You for your detail clarification. Bilal reply should work for you, you can also try this:- 1. right clicking the first table and open tablix properties 2. Under page break option, check the 'Add a page break after' Please let us know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 9:42am

try this out, https://docs.google.com/leaf?id=0B9kG9JjPJGAvNjY3MTQ2MjMtYmNhNi00OWNlLWI5NDQtOGZjMTA1MGMyODU4&hl=en&authkey=CNKi3YkJ Please let us know your feedback. Thanks KumarKG, MCTS
December 30th, 2010 10:59am

try this out, https://docs.google.com/leaf?id=0B9kG9JjPJGAvNjY3MTQ2MjMtYmNhNi00OWNlLWI5NDQtOGZjMTA1MGMyODU4&hl=en&authkey=CNKi3YkJ Please let us know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 10:59am

i did the following as u suggested 1. right clicking the first table and open tablix properties 2. Under page break option, check the 'Add a page break after' but didnt work both the tables are coming on the same sheet. what i found is if i remove the IIF clause in the visibility expresseon field the tables are coming on different tabs so is my IIF clasu imapcting here....? below is the IIF clause FOR Employee table =IIF(Parameters!t_typeSelection.Value= "Staff" AND Parameters!t_staff_ID.Value > 0, True, False) for Staff table =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_EMP_ID.Value > 0, True, False)
December 30th, 2010 12:26pm

i did the following as u suggested 1. right clicking the first table and open tablix properties 2. Under page break option, check the 'Add a page break after' but didnt work both the tables are coming on the same sheet. what i found is if i remove the IIF clause in the visibility expresseon field the tables are coming on different tabs so is my IIF clasu imapcting here....? below is the IIF clause FOR Employee table =IIF(Parameters!t_typeSelection.Value= "Staff" AND Parameters!t_staff_ID.Value > 0, True, False) for Staff table =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_EMP_ID.Value > 0, True, False)
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 12:26pm

Hi Justin, For me everything is working fine as you have requested, please fine my sample example I have attached in my previous reply. Please let us know your feedback. Thanks KumarKG, MCTS
December 30th, 2010 12:35pm

Hi Justin, For me everything is working fine as you have requested, please fine my sample example I have attached in my previous reply. Please let us know your feedback. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 12:35pm

is this happening because im using opposite selection for tables for instance for employee table i'm doin IIF type selection staff, true, false and for staff IIF(type selection employee, true, false) thanks ps: im not able to download ur rdl at work....!!!
December 30th, 2010 1:37pm

Hi Justin, No I don't think so it is issue, you might be doing some other minor mistake but cannot guess exactly what it might be. Otherwise both either "Add a page break after" under TablixA or "Add a page break before" under TablixB I tried both the ways and works fine by inserting two tables in two different sheets of an Excel. Please let us know your feedback. At the maximum I have created and uploaded an example for you now. Thanks KumarKG, MCTS
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2010 1:56pm

hey kumar the issue is still not resolved with me. thank u for your help when i look at your rdl u have the following IIF condition =IIF(Parameters!t_typeSelection.Value= "Staff" AND Parameters!t_staff_ID.Value = 0, True, False) =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_EMP_ID.Value = 0, True, False) you have equal to 0 while i have the following iif condition FOR Employee table =IIF(Parameters!t_typeSelection.Value= "Staff" AND Parameters!t_staff_ID.Value > 0, True, False) for Staff table =IIF(Parameters!t_typeSelection.Value= "Employee" AND Parameters!t_EMP_ID.Value > 0, True, False) i have value >0 for some reason the sql server is assuming that both are the same and showing them on the same sheet. but if i totally remove the IIF clause they are being displayed on two seperate tabs. so if i remove the IIF clause totally i can satisfy one of the business req to show both the tabs when no selection is made but when the user selects either the employee tab or staff tab is there any other way to hide the table which is not selected in the rdl. thank u for the help. let me know if i can modify my iif condition or if there is any other way of hide one table when the other is selected justin
January 4th, 2011 12:54pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics