How can I pass a value for sub report parameter From textbox ?
I am having two reports (Parent and sub report), The total score value should be passed from Parent to Subreport
I try to pass an expression value for the sub reports parameter like this one (=Sum(Fields!NumberOfCC.Value, "dsCountofCC") )
It show an error Subreprot can not be shown,
While when I place this expression in total score textbox, It is dispalyed correctly
I decide to place the expression into a textbox and pass to subreport the value of this textbox through reportitems (=reportitems!txtTotalScore.Value )
I found the textbox become invisible , and Sub report is not dispalyed
When I pass to the subreport a hardcoded value ,
The txtTotalScore become visible
Passing parameter to sub report cannot be through expression for through control , is not it ?khaled Mohamed
July 10th, 2012 9:53am
Hi,
See this link same Issue was resolved
http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/9b0edaf5-5917-4853-8233-f3b62e4cfd8a
Hope this will help you !!!
Sanjeewan
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2012 9:58am
When the value of the text box is not
expression , It work for me ,
While when the value of the textbox is an expression It will not work
Expression of the text box is : =sum(Fields!NumberOfCC.Value, "dsCountofCC")
Expression for sub report pramter is =reportitems!txtTotalScore.Value
Sub report work for me If I pass hardcoded value , Or pass a value from textbox when the textbox value is not an expression
khaled Mohamed
July 10th, 2012 10:11am
Hi,
What type of value are getting and what is datatype of subreport parameter.
1. your textbox value and subreport parameter should same
2. you can do one thing create a calculated field 1)Right click on dataset add field name the field and add expression =sum(Fields!NumberOfCC.Value, "dsCountofCC")
3. Then use this field expression in textbox
4. Now you can pass this field as parameter expression =fields!<your field name>.value
Note this is your calculated fields
Hope this will help you !!!
Sanjeewan
Free Windows Admin Tool Kit Click here and download it now
July 10th, 2012 12:17pm
Look for the name of the textbox for the value you want to pass Right click on the sub-report and goto propertiesOn the parameters tab click add and then click on the drop-down, it will show you the list of parameters for your sub-report you need to pass the values for all those parameters
select a parmeter and on the right hand side use this expression =reportitems!nameonyourtextbox.valuePlz mark as Answer if your problem is resolved. Reddy
July 10th, 2012 2:20pm
I have developed the report 2 times and Notice that the issue is due to an issue in Item render sequence.
In my case the parameter of sub report is taken from Textbox named totalScore by expression (=reportitems!txtTotalScore.Value)The value of this total score textbox come from summation of 11 textboxs values.The value of each of those 11 textboxes come from expression ( database value divided by constant , Multiplied by parameter )
.I notice in some cases the total Score text box consider the value of some of the 11 textbox as ZERO . and When I refresh the reprot without doing any thing else, the value is calculated correctly . I though I consider zero value because they do not have
value yet.khaled Mohamed
Free Windows Admin Tool Kit Click here and download it now
July 11th, 2012 6:35am
My final Notice and what drive me crazy is sub report parameter behavior
I have a sub report which accept a parameter and just display it, to make sure it is passed correctly
1. When Parent report pass this expression as parameter value =Sum(Fields!CCScore.Value, "dsCountofCC"). It display an Error, and when I press refresh button without anything else it shows the correct value
2. When Parent report pass same expression plus 9 =Sum(Fields!CCScore.Value, "dsCountofCC")+9 , It will display 9 at first time and when I press refresh button It display the correct value
3. When parent report use first expression but instead of dataset dsCountofCC it use another dataset =Sum(Fields!Score.Value, "dsLYPersonalLoan") It show and error , and press refresh button will also display Error, keep in mind that this expression
can be displayed in textbox correctly
khaled Mohamed
July 11th, 2012 8:54am
Any Reply !!!
Any Help !!khaled Mohamed
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2012 7:25am