Reply
 
LinkBack Thread Tools Display Modes
Old 04-21-2011, 09:45 AM   #1 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default help ,i don't need zeros to appear in my summary

i need to make a summary report by zone and i try to hidden values if it is zero so i wrote that code



but it give me that result it hide values not equal to zero



and without that code it gives me that result



so any one have the right code ??
engcosta is offline   Reply With Quote
Old 04-22-2011, 05:36 PM   #2 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

please any one can help me .. ineed it quickley
engcosta is offline   Reply With Quote
Old 04-22-2011, 06:37 PM   #3 (permalink)
Administrator
 
SenoS's Avatar
 
Join Date: Mar 2006
Posts: 241
SenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond reputeSenoS has a reputation beyond repute
Default

This code may give you some insight. This is the code used to hide the price of Labor Products on standard Proposal report:

' if we are showing labor items, then we need to hide the price field
If showLaborItems Then

Dim categoryType As String = ""
try
categoryType = ReportUtilities.ReturnTextBoxValue(rpt,"grpItemHea der","txtCategoryType").ToString
If categoryType.ToLower = "labor" Then
ReportUtilities.SetControlVisibility(rpt, "txtPrice", false)
Else
ReportUtilities.SetControlVisibility(rpt, "txtPrice", showItemPrice)
End If
catch
End try
SenoS is offline   Reply With Quote
Old 04-22-2011, 11:11 PM   #4 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

it gives me the same result .. i return the price in Decimal variable and put the condition if price = 0 then hide the txtprice control .it hide the price if zero and also hide some other values which not equal to zero as showen in above image . so idon't know why it gives me this result..
so please try to give me solution for that
thank you
engcosta is offline   Reply With Quote
Old 04-23-2011, 04:50 AM   #5 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default Try in BeforePrint procedure

Hi,

Can you try your (same) code in BeforePrint procedure instead of Format procedure.

Also you can look out here

Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Old 04-23-2011, 10:05 AM   #6 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

yes its working now but it give me that look


and i don't need those spaces that is appear between Lighting and furniture and between furniture and security
what can i do??
engcosta is offline   Reply With Quote
Old 04-23-2011, 12:25 PM   #7 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default Try this

Hi,

You can set group section CanShrink property to false.

But it will work only if you are hiding the controls at the Format procedure, then it will automaticlly shrinks the group.

But it will not work if the controls are hidden at BeforePrint procedure.
In the BeforePrint procedure we can hide the controls, but we cannot hide group section respectively.

Also we can get the summarized value at the BeforePrint procedure, Format procedure always return first item value.

Now we are caught up in tricky situation.

But anyway there is a way to accomplish it but its slightly complex.

I try to explain the complex stuff hopefully you will understand -

Designer Side Changes -

Create a new blank report
Include two Group Headers and Group Footers

GroupHeader1 set DataField property to dtr:Zone
GroupHeader2 set DataField property to dtr:Zone

For the GroupHeader2 section set CanShrink property to true and
include a bound field textbox into GroupHeader2 section
Name - txtValue
DataField - dtr:InstallationPrice
SummaryGroup to "GroupHeader2"
SummaryType - SubTotal
Visible - False

In the GroupFooter1 section include two bound textbox controls one to display Zone and one to display price value.
for Name textbox
Set DataField property to dtr:Zone
for Price textbox set the following properties
DataField - dtr:InstallationPrice
OutputFormat - C
SummaryGroup to "GroupHeader1"
SummaryType - SubTotal

Script Side Changes -
In the BeforePrint procedure of GroupHeader2 include the below code

Code:
Sub GroupHeader2_BeforePrint

Dim value As Decimal  = Decimal.Parse(ReportUtilities.ReturnTextBoxValue(rpt,"GroupHeader2","txtValue"))

 rpt.Sections("GroupFooter1").Visible = value > 0

End Sub
This will acheive what you want.

Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Old 04-23-2011, 03:07 PM   #8 (permalink)
Senior Member
 
Join Date: May 2009
Location: Chennai, India
Posts: 157
nkarthick is on a distinguished road
Default Try using Filter options

Hi,

Easy way is to - Filter out the items with zero price values. Then the items with zero values will be filtered out and the zone will not be displayed in Zone Summary automatically. You no need to hide via script.

Assuming - you know how to set report Filter

Hope it helps.
__________________
Narayana Karthik
nkarthick is offline   Reply With Quote
Old 04-23-2011, 05:04 PM   #9 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

thank you veryyyyyyyy much now all goes well
engcosta is offline   Reply With Quote
Old 04-23-2011, 05:06 PM   #10 (permalink)
Member
 
Join Date: Apr 2011
Posts: 32
engcosta is on a distinguished road
Default

please tell me one more thing
i need zone name first latter appear capital and the rest of name appear small what can i do ??
engcosta is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 09:35 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.0
D-Tools, Inc.