removing zeros on crosstab reports

This public forum is for user-to-user discussions of ASP Report Maker. Note that this is not support forum.

removing zeros on crosstab reports

Postby flanman » Tue Dec 23, 2008 12:44 am

I have several crosstab reports that I created with a MS Access DB query that work fine and when a field had a zero value it was left blank which was nice. I have since upgraded to sql 2005 express and recreated the queries. I created a new project in ASPRM 2.x with the same queries, and I am getting all good data, but now the crosstab is filled with several zeros instead of just a blank field. Is there a way in report maker I can change this to not display all the zero fields?

Bill
flanman
 

Re: removing zeros on crosstab reports

Postby Webmaster » Tue Dec 23, 2008 10:06 am

MS Access and SQL Server use different sqls to get the crosstab data and hence the difference.

You can modify the formatting function in rptinc/ewrfn2.asp to return a blank value (instead of zero):

Function ewrpt_FormatCurrency(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers, GroupDigits)
'...
If ewrpt_FormatCurrency&"" = "0" Then ewrpt_FormatCurrency = "" ' *** Return blank
End Function

Function ewrpt_FormatNumber(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers, GroupDigits)
'...
If ewrpt_FormatNumber&"" = "0" Then ewrpt_FormatNumber = "" ' *** Return blank
End Function
Webmaster
 
Posts: 10731
Joined: Fri Aug 06, 2004 5:59 pm

Re: removing zeros on crosstab reports

Postby panamanian » Sun Apr 10, 2016 4:17 pm

I have tried to modify the formatting function in ewrfn9.asp as suggested (renaming "ewrpt_FormatNumber" to match "ewr_FormatNumber") with no success. All summed values that are zeroes still show as zeroes. Is there anything else I need to modify?
panamanian
 
Posts: 4
Joined: Sun Apr 10, 2016 4:07 pm

Re: removing zeros on crosstab reports

Postby Webmaster » Mon Apr 11, 2016 7:56 am

Post your code. Show what you have modified.
Webmaster
 
Posts: 10731
Joined: Fri Aug 06, 2004 5:59 pm

Re: removing zeros on crosstab reports

Postby panamanian » Mon Apr 11, 2016 4:13 pm

Only the single line was added as suggested:

Function ewr_FormatNumber(Expression, NumDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers, GroupDigits)
'...
If ewr_FormatNumber&"" = "0" Then ewr_FormatNumber = "" ' *** Return blank
End Function
panamanian
 
Posts: 4
Joined: Sun Apr 10, 2016 4:07 pm

Re: removing zeros on crosstab reports

Postby motfs » Tue Apr 12, 2016 3:29 pm

Check if you have formatted the field (View Tag -> Format -> Number).
motfs
 
Posts: 710
Joined: Tue Sep 08, 2015 4:55 pm

Re: removing zeros on crosstab reports

Postby panamanian » Sat Apr 16, 2016 8:50 am

Changing the format to Number worked. Thought I did this. Thank you!
panamanian
 
Posts: 4
Joined: Sun Apr 10, 2016 4:07 pm


Return to General Discussion (ASP Report Maker)