SSRS Won't display Excel but runs PDF without issue

Ok So I was Tasked with creating a GL account based report. I developed it in SSRS. During the review I was then asked that Users be allowed to run it but that it would only show the applicable GL Segment to them. OK this is a challenge but I got this. I created a customization that took the user name and translated it into an interger and passed it into the report. This worked great. I then created custom code in the report to return a boolean based on the GL segment value and the report parameter passed in. This works great as a PDF. The report how ever is a 12 month report and it has obvious issues fitting on one page. The task changed again that it has to either be on one PDF page or run into excel. Ok no big deal I will just make the output excel and viola I am done this report and can move on. Well I came to find out that when running output as excel with the custom code call in the visibility for the group it creates a server error about hidden expression. So here I am asking if anyone has had this issue or knows a way to make this report possible,

Thanks
Matt

Never mind. As I was Typing my questions a stupid idea popped in my head. I had to pass the report param to the custom code in order to save it into a variable to evaluate it. I did this but I did not do it before the group was evaluated. I move the expression to before the group appeared on the report and now excel runs fine. I am sorry for jumping the gun. Deadlines and stress make me panic. Have a great weekend everyone.