Solved

Grand total doesn't render to pdf when using Code for the total

Posted on 2014-04-07
9
404 Views
Last Modified: 2014-05-14
We have a report that requires grand totals.  Because some of the values in the grouping lines are just the first value of that field we can't use the normal sum to get a grand total.  We've used Code to get the total.  When the report runs, the total shows on the screen properly.  But when you save it as a pdf or print it the totals created using Code do not display.  What is the work around for this?
0
Comment
Question by:cindyfiller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 27

Expert Comment

by:planocz
ID: 40000323
Please post your code expression.
and what you are placing in the textbox area.
0
 

Author Comment

by:cindyfiller
ID: 40001824
here is the code that is used and then below that is how the code is used in the detail line and in the total line (where it isn't working).  BTW I have since taken this report into excel and the totals that display on the report  (from the code) are way off from the totals when done in excel.  


Public Dim FVTotal as Double = 0
Public Dim ABTotal as Double = 0

Public Function AddFVTotal (Amt as Double) as Double
      FVTotal = FVTotal + Amt
      AddFVTotal = 0
End Function

Public Function GetFVTotal as Double
      GetFVTotal = FVTotal
End Function

Public Function AddABTotal (Amt as Double) as Double
      ABTotal = ABTotal + Amt
      AddABTotal = 0
End Function

Public Function GetABTotal as Double
      GetABTotal = ABTotal
End Function

--------
detail line:   =First(Fields!NPV.Value)+Code.AddFVTotal(First(Fields!NPV.Value))

final total:   =Code.GetFVTotal()
0
 

Author Comment

by:cindyfiller
ID: 40001858
Ignore the comment about excel totals not equaling -  I know why that is and I can't just take a summary of the total.  Mostly I have to figure out how to get the totals to render to pdf's and excel and/or find an alternative way of creating totals.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:cindyfiller
ID: 40001934
BTW I tried creating a page footer and put the totals in there... it is doing something similar.  On the report on screen, the totals are fine but if you save it as a pdf (which we do often) the totals are completely different from what shows on the screen.  Its maddening - our CFO uses this report for so many things but she always wants it in a pdf.
0
 
LVL 27

Expert Comment

by:planocz
ID: 40001960
How are you grouping  the items? By a line number? A group type?
0
 

Author Comment

by:cindyfiller
ID: 40001967
A group - we have gifts that come in and each gift goes toward a certain fund.  I'm grouping on that fund.
0
 
LVL 27

Accepted Solution

by:
planocz earned 500 total points
ID: 40002004
Here is a sample that I use in some reports
Change the ItemCode to your Funds field....

SUMMING A GROUP INSIDE A GROUP
Public Dim ToT as Double
Public Function TotalItems(Byval value as Double, ByVal Reset as Boolean) as Double
       ToT += value
       If Reset = TRUE Then
          ToT = value
       End If
      Return TOT
End Function
=Code.TotalItems(Fields!PlanDetailQuantity.Value, IIF(Fields!ItemCode.Value <> Previous(Fields!ItemCode.Value),True,False))

IF this does not work for you , let me know  I do have other codes.
0
 

Author Comment

by:cindyfiller
ID: 40002240
Do you know if this renders ok?  The code does do the correct totals - the problem only shows up when I render it as a pdf or excel file.  Then the totals are either 0 or wrong.
0
 
LVL 27

Expert Comment

by:planocz
ID: 40002875
All the SSRS reports that I work with are exported to PDF files.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
A recent question popped up and the discussion heated up regarding updating a COMMENTS (TXT) field in a table using SSRS. http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/MS-SQL_Reporting/Q_27475269.html?cid=1572#a37227028 (htt…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question