Sub report parameter
I want to pass the value of a textbox as a parameter to sub report, I use ReportItem collection, But the issue come from sub report capture the value of the textbox before it has been calculated, so it always consider zero value for the blank textbox,
I need to prevent sub report from start render before value is ready in the textbox khaled Mohamed
July 24th, 2012 7:56am
To access the textbox's value, you can use:
=ReportItems!Textbox1.value
It is into good idea to use a textbox as a parameter. It would be better to use a Variable instead.
Add a dataset and set the value of the variable from the dataset. Pass the variable as a parameter to the subreport.
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2012 9:06am
It will work only if the textbox contain hardcoded value
In my case the value of the text is the summation of other textbox values,
In the case When I use this expression
The subreport start to get a blank value before the textbox value itself being calculated
I need a work arround to prevent the subreport to get the value of the textbox untill it has been calculated
khaled Mohamed
July 24th, 2012 10:09am
Hi Khaled !
This is a default behavior of SSRS and its bug i think. What you can do as workaround is you can remove the Default Value in your Sub Report Paramter so it will wait until the Main report renders.
Please let me know if this helps. Hopefully i have answered you correctly.
Thanks, Hasham
Free Windows Admin Tool Kit Click here and download it now
July 24th, 2012 12:01pm
It will work only if the textbox contain hardcoded value
In my case the value of the text is the summation of other textbox values,
In the case When I use this expression
The subreport start to get a blank value before the textbox value itself being calculated
I need a work arround to prevent the subreport to get the value of the textbox untill it has been calculated
khaled Mohamed
The workaround is to use a variable. Pass the variable as parameter to the subreport and not the textbox's value.
July 25th, 2012 2:18am
when I try to use internal prameter , It show me an error
A value expression used for the report parameter 'prmtotal' refers to a field ,
Fields can not be used in report prameter expressions,
This is becuase the value I want to pass is a summation of values in 2 textboxes ,
and Values for those 2 Textbox is a combination between dataset fields and Constant
khaled Mohamed
Free Windows Admin Tool Kit Click here and download it now
July 25th, 2012 3:57am
Hi Khaled Tec...
This is what i understud ur prb...
1. You have one report say Rep1 have column say COlC combination of (Col1+Col2).
2. You have subreport having parameter say Par1, now you looking ColC value (Col1+Col2) for Par1.
If this is the case, things are running fine when i pass parameter for subreport (=ReportItem!ColC.value) against Par1..
even i instead of =ReportItem!ColC.value, you can also give expression against par1 in mapping of parameter against main report and sub report.
Please let me know if you have diff prob, also if possible send me your rdl file....my id is
amit.260183@hotmail.com
Amit
Please mark as answer if helpful
http://fascinatingsql.wordpress.com/
July 25th, 2012 7:29am
Hello Amit
My case is quite different
I am calculating score for my Agent in bank system
I have a dataset for Credit card has a column for Score
And another dataset for Auto loan with column form score
I need to place a textbox for total Score = Credit card score + Auto Loan score
I also need to pass the value of the total score textbox to sub report
I make a simple reports from AdventureWorks so you can be able to run the report on your machine .
Khaled Mohamed Abd El-hamid
Senior Business Intelligence specialist
Ext. 1631
Mobile : +2010 296 9256
Hi Khaled,
I have gone through your RDL files.
Please have a look on the solution below which is based on keeping an eye on your requirement of use of "=reportItems!txtTotalScore.Value" in the report.
1. use below expression in txtTotalScore textbox
=Sum(Fields!Credit_Card_Score.Value, "dsCreditCard")+Sum(Fields!Auto_Loan_Score.Value, "dsAutoLoan")
2. On mapping btw parent and child report, dont do any changes on that, i.e map with =ReportItem!txtTotalScore.Value as per your requirement.
Now execute the report, it will run fine.
Please let me know in case you still have any issue on the same.
Amit
Please mark as answer if helpful
http://fascinatingsql.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
July 26th, 2012 4:50am
Hi Khaled,
Please check your mail, just sent RDL Amit
Please mark as answer if helpful
http://fascinatingsql.wordpress.com/
July 27th, 2012 6:41am
Hi Khaled,
I f you find the soluiton, please close the post and share your solution else elaborate your issue.Amit
Please mark as answer if helpful
http://fascinatingsql.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
August 16th, 2012 6:46am