SSRS Reporting Error
I am using SQL server 2008 R2. In SSRS, i have added a field Base Hours using VBA code.The problem is, if the number of records are less (only on 1 page) everything is fine. but when it goes more then 2 page then problem start. when user view every page sequentially then grand total comes correct. or when user skip the 2 page and jump from 1 to 3 page then it show only the total of 1st and 3rd page. i am using shared variable in VBA code for sending the prev values to next page. is any one have the solution of this problem.
December 19th, 2011 3:39am

Hi, When you are going from one page to another reinitialize you value again.Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
Free Windows Admin Tool Kit Click here and download it now
December 19th, 2011 11:02am

Hi, When you are going from one page to another reinitialize you value again.Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
December 19th, 2011 11:02am

If you need Grand Total, then use the Sum Function =Sum(Fields!BaseHours .Value) =Sum(Fields!YearlyIncome.Value,"GroupByInitial") =Sum(Fields!YearlyIncome.Value,"GroupByInitial",Recursive) MAke the Field a Calculated field , and then you will not have any issues.
Free Windows Admin Tool Kit Click here and download it now
December 19th, 2011 4:36pm

If you need Grand Total, then use the Sum Function =Sum(Fields!BaseHours .Value) =Sum(Fields!YearlyIncome.Value,"GroupByInitial") =Sum(Fields!YearlyIncome.Value,"GroupByInitial",Recursive) MAke the Field a Calculated field , and then you will not have any issues.
December 19th, 2011 4:36pm

i have tried with all these function but now work for this. vikas gupta
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2011 12:51am

i have tried with all these function but now work for this. vikas gupta
December 20th, 2011 12:51am

ya you are right when i am going from one page to another page values get reinitialize. for this purpose i have used shared variables so the values are coming correctly when i am going from first to last page sequentially is right but when i skip the page then value not coming correctvikas gupta
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2011 12:52am

ya you are right when i am going from one page to another page values get reinitialize. for this purpose i have used shared variables so the values are coming correctly when i am going from first to last page sequentially is right but when i skip the page then value not coming correctvikas gupta
December 20th, 2011 12:52am

Hi, Then the values are not fully reinitialized.in every page navigation reinit your value to 0 then recalculate again and set the value. as per your approach when you skip the page 2 you are getting page 1 and page 3 value.so create another method (reset) when ever you set the value same time call this (reset )mehod this will work.hope it will help you.Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2011 4:27am

Hi, Then the values are not fully reinitialized.in every page navigation reinit your value to 0 then recalculate again and set the value. as per your approach when you skip the page 2 you are getting page 1 and page 3 value.so create another method (reset) when ever you set the value same time call this (reset )mehod this will work.hope it will help you.Best Regards, C.Gnanadurai ----------------------- Please mark the post as answer if it is helpfull to you
December 20th, 2011 4:27am

Hi, Then the question is how can i get the values in reset method. because grand total skip the 2nd page value.vikas gupta
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2011 4:34am

Hi Vikas, In my understanding, code block only get execute when that textbox get reder where you written your calling code. If page 2 is skipping then code block is not getting executed for that. I am afraid that there is solution for this. If you have not written anything complex in code block then you can think of using Kiranmayee solution above in this post.Regards, Asim Bagwan Kindly mark the replies as Answers if they help!
December 20th, 2011 5:41am

Hi Vikas, In my understanding, code block only get execute when that textbox get reder where you written your calling code. If page 2 is skipping then code block is not getting executed for that. I am afraid that there is solution for this. If you have not written anything complex in code block then you can think of using Kiranmayee solution above in this post.Regards, Asim Bagwan Kindly mark the replies as Answers if they help!
Free Windows Admin Tool Kit Click here and download it now
December 20th, 2011 5:41am

i have change my code VBA code to SSRS as " Kiranmayee " Solution. But still there some problem i explain you guys. Base_Hours_Value:- =iif(Fields!EMPLOYMENTTYPE.Value =3, iif(Fields!PAQtyQ.Value > Fields!BaseHours.Value, Fields!PAQtyQ.Value + ((Fields!PAQtyQ.Value - Fields!BaseHours.Value) * .5),Fields!PAQtyQ.Value),Fields!BaseHours.Value ) then i have a group Total =sum(Base_Hours_Value) and then grand Total =sum(Base_Hours_Value) but on both the place of sum i got #ERROR. but if i remove all the condition from the above expression then it works fine is any body have solution. vikas gupta
December 27th, 2011 12:18am

Hi Vikas, Does Fields!BaseHours.Value this field coming from database? If yes try following steps: Right click on dataset -> Add calculated field Give name to field. E.g. CalculatedBaseHour Add above expression in value. You will get one more field in your dataset. Use that field to for summation. E.g. SUM(Fields!CalculatedBaseHour.Value)Regards, Asim Bagwan Kindly mark the replies as Answers if they help!
Free Windows Admin Tool Kit Click here and download it now
December 27th, 2011 2:18am

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

Other recent topics Other recent topics