Solved

How do I solve this?: error text=Timeout expired (Microsoft OLE DB Provider for SQL Server)

Posted on 2008-06-18
30
1,168 Views
Last Modified: 2011-10-19
Hi,

I've got the following problem.I have a ASP report which generate reports based on data collected by a VB.NET program into SQL2000 Database server.I have no problems running the reports on a smaller amount of data but if I'd like to run a report on the last 3 months this will involve millions of entries which will need to be handled by the querry.
If I run the querrie from Querry Analyzer I have no problem getting the recordset (which is my report basically).As soon as I try to run th every same query from the ASP interface through IE then I will have the following error.:error text=Timeout expired (Microsoft OLE DB Provider for SQL Server).
I've changed my asp code so it will display the error and this is what I get plus the whole query as in the picture.I increased the timeout in the SQL Server itself ,I did increase it in IIS and I also increased the objConnectionConnectionTimeout = 0 .I really don't know of any other setting and the location of that setting where I could increase it to infinity.I am happy to wait as much time It takes to run the code.Please help I am totally stuck.
query.JPG
0
Comment
Question by:Latzi_Marian
[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
  • 18
  • 11
30 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21819102
connectiontimeout is the time to connect, not the timeout to run the query.
you are looking for the CommandTimeout property to be set to 0

note: how much time does the query actually use? it might be worth tuning it also...
0
 

Author Comment

by:Latzi_Marian
ID: 21819122
hi angellll

Sorry I did forget to say that I did put in the common.asp file the CommandTimeout = 0  for connection object as well.
In querry analyzer I use between 38-41 seconds to run the querry for a periond of 3 months.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21819195
can you show the relevant code + sql, please?
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:Latzi_Marian
ID: 21819260
yes
this is the very querry I use in Analyzer as I said it runs in 38 -41 seconds without any problems.As you can see from the code the period selected is 1 month.If I increase to 2 or more months the querry will still run happily but the time will increase accordingly.Waiting for the querry to execute is not an issue at all.I just have to increase the timeout the error is reffering to.But I have no ideea how or where.I already increased every possible timeout.

It's a quite complex querry but it does exactly what I need.
Select z.*,b.[TotalKg] As TotalKg,b.[Total_Pcs],b.[Target] As DivTarget,b.[Dev],b.[Article Name]As DivArtName,b.[Start] As DivStart,b.[DivMVT]
From
(
SELECT L.*,M.[DoughGroup]
From
(
Select [Article Name],Sum(TotalKg)As TotalKg_General,Sum(TotalProduced)As TotalProduced_General,Start,Avg(MVT) as MVT_Slicer,
Avg(Dev) As Dev_General,Target As Target,Avg(Throughput) As Throughput_General,Sum(Total_Pcs) As Total_Pcs_General,
Sum(Total_Trade) As Total_Trade_General,SUM((Give_Away)/1000) As Give_Away_General,Sum(Reject) As Reject_General
From
 
(
Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs,
Sum(Total_Trade) As Total_Trade,
sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away,
sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject
From
(
select T.*,S.[Mean value trade]
From
(
Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg ,
MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced,
Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev,
Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput,
MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs,
MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade
From statex2
Where  Start > '2008-4-15'  and Start < '2008-5-16' 
Group By [Article Name],Target,Start
) T
INNER JOIN statex2 S ON T.[Article Name]= S.[Article Name] and 
T.Duration=S.Duration and T.[Start] > '2008-4-15'  and T.[Start] < '2008-5-16'
 
) 
B
Group By B.[Article Name],B.[Target],B.[Start]
Union
Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs,
Sum(Total_Trade) As Total_Trade,
sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away,
sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject
From
(
select T.*,S.[Mean value trade]
From
(
Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg ,
MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced,
Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev,
Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput,
MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs,
MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade
From statex3
Where  Start > '2008-4-15'  and Start < '2008-5-16' 
Group By [Article Name],Target,Start
) T
INNER JOIN statex3 S ON T.[Article Name]= S.[Article Name] and 
T.Duration=S.Duration and T.[Start] > '2008-4-15'  and T.[Start] < '2008-5-16'
 
) 
B
Group By B.[Article Name],B.[Target],B.[Start]
union
Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs,
Sum(Total_Trade) As Total_Trade,
sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away,
sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject
From
(
select T.*,S.[Mean value trade]
From
(
Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT,
MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg ,
MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced,
Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev,
Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput,
MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs,
MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade
From statex4
Where  Start > '2008-4-15'  and Start < '2008-5-16' 
Group By [Article Name],Target,Start
) T
INNER JOIN statex4 S ON T.[Article Name]= S.[Article Name] and 
T.Duration=S.Duration and T.[Start] > '2008-4-15'  and T.[Start] < '2008-5-16'
 
) 
B
Group By B.[Article Name],B.[Target],B.[Start]
) 
G
Group By G.[Article Name],G.[Target],G.[Start]
)L
INNER JOIN Slicer_DG M ON L.[Article Name] = M.[Article Name]
) As Z
Inner Join ( SELECT L.*,M.[DoughGroup]
From
(
Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as DivMVT,
Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs,
Sum(Total_Trade) As Total_Trade,Start,
sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away,
sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject
From
(
select T.*,S.[Mean value trade]
From
(
Select [Article Name],max(Duration)AS Duration,Start,
MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg ,
MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced,
Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev,
Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput,
MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs,
MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade
From statex1
Where  Start > '2008-4-15'  and Start < '2008-5-16' 
Group By [Article Name],Target,Start
) T
INNER JOIN statex1 S ON T.[Article Name]= S.[Article Name] and 
T.Duration=S.Duration and T.[Start] > '2008-4-15'  and T.[Start] < '2008-5-16'
 
) 
B
Group By B.[Article Name],B.[Target],B.[Start]
)L
INNER JOIN Divider_DG M ON L.[Article Name] = M.[Article Name]
) As b
on z.[DoughGroup] = b.[DoughGroup]

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21819302
>Where  Start > '2008-4-15'  and Start < '2008-5-16'
>T.Duration=S.Duration and T.[Start] > '2008-4-15'  and T.[Start] < '2008-5-16'

assuming that your field data types are actually datetimes, you should consider doing:

Where  Start >= CONVERT(datetime,  '2008-4-15' ,120) and Start < convert(datetime,  '2008-5-16' ,120)
resp:
T.Duration=S.Duration and T.[Start] > convert(datetime,  '2008-4-15'  ,120)and T.[Start] < convert(datetime,  '2008-5-16',120)

it would be interesting to see the explain plan of this query ...


anyhow, with "relevant code" I meant also the asp code running the query.

0
 

Author Comment

by:Latzi_Marian
ID: 21819627
yes it is an interesting query.Very interesting but it would take me too much time to find a way to properly explain the whole situation of whats and whys.Anway as I said the query runs perfectly with a smaller amount of data and runs perfectly with any amount of data but only in Query Analyzer.
Sorry for the missunderstanding I will send you here the code for the page.asp and page events.asp.
This code is messy too as the query but I am messy as well I guess :-).


 I still keep trying to find a solution but more I think about it harder it looks to find the problem.
<%@ CodePage=1252 %>
<%
'Include Common Files @1-DF615576
%>
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/Common.asp"-->
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/Cache.asp" -->
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/Template.asp" -->
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/Sorter.asp" -->
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/Navigator.asp" -->
<%
'End Include Common Files
 
'Initialize Page @1-5BB04615
' Variables
Dim PathToRoot, ScriptPath, TemplateFilePath
Dim FileName
Dim Redirect
Dim Tpl, HTMLTemplate
Dim TemplateFileName
Dim ComponentName
Dim PathToCurrentPage
Dim Attributes
 
' Events
Dim CCSEvents
Dim CCSEventResult
 
' Connections
Dim DBConnection1
 
' Page controls
Dim Report1
Dim Report_Print
Dim Link1
Dim Link2
Dim ChildControls
 
Response.ContentType = CCSContentType
Redirect = ""
TemplateFileName = "DoughGroup_Report.html"
Set CCSEvents = CreateObject("Scripting.Dictionary")
PathToCurrentPage = "./"
FileName = "DoughGroup_Report.asp"
PathToRoot = "./"
ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName))
TemplateFilePath = ScriptPath
'End Initialize Page
 
'Initialize Objects @1-4D1667D2
BindEvents "Page"
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeInitialize", Nothing)
 
Set DBConnection1 = New clsDBConnection1
DBConnection1.Open
Set Attributes = New clsAttributes
Attributes("pathToRoot") = PathToRoot
 
' Controls
Set Report1 = New clsReportReport1
Set Report_Print = CCCreateControl(ccsLink, "Report_Print", Empty, ccsText, Empty, CCGetRequestParam("Report_Print", ccsGet))
Set Link1 = CCCreateControl(ccsLink, "Link1", Empty, ccsText, Empty, CCGetRequestParam("Link1", ccsGet))
Set Link2 = CCCreateControl(ccsLink, "Link2", Empty, ccsText, Empty, CCGetRequestParam("Link2", ccsGet))
 
Report_Print.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
Report_Print.Parameters = CCAddParam(Report_Print.Parameters, "ViewMode", "Print")
Report_Print.Page = "DoughGroup_Report.asp"
 
Link1.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
Link1.Page = "Report_Packing_LinesAll.asp"
 
Link2.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
Link2.Page = "Start_Report_Packing_Lines.asp"
Report1.Initialize DBConnection1
 
' Events
%>
<!-- #INCLUDE VIRTUAL="/GF_Data_Reporting/DoughGroup_Report_events.asp" -->
<%
BindEvents Empty
 
CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing)
'End Initialize Objects
 
'Go to destination page @1-6D35F4FD
If NOT ( Redirect = "" ) Then
    UnloadPage
    Response.Redirect Redirect
End If
'End Go to destination page
 
'Initialize HTML Template @1-2E9DB4BC
CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing)
Set HTMLTemplate = new clsTemplate
Set HTMLTemplate.Cache = TemplatesRepository
HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName
HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot
Set Tpl = HTMLTemplate.Block("main")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing)
'End Initialize HTML Template
 
'Show Page @1-D034CBB2
Attributes.Show HTMLTemplate, "page:"
Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _
    Array(Report1, Report_Print, Link1, Link2))
ChildControls.Show
Dim MainHTML
HTMLTemplate.Parse "main", False
MainHTML = HTMLTemplate.GetHTML("main")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing)
If CCSEventResult Then Response.Write MainHTML
'End Show Page
 
'Unload Page @1-CB210C62
UnloadPage
Set Tpl = Nothing
Set HTMLTemplate = Nothing
'End Unload Page
 
'UnloadPage Sub @1-87121735
Sub UnloadPage()
    CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing)
    If DBConnection1.State = adStateOpen Then _
        DBConnection1.Close
    Set DBConnection1 = Nothing
    Set CCSEvents = Nothing
    Set Attributes = Nothing
    Set Report1 = Nothing
End Sub
'End UnloadPage Sub
 
'Report1 clsReportGroup @2-D272D35B
Class clsReportGroupReport1
    Public GroupType
    Private mOpen
    Private mClose
    Public Report_TotalRecords
    Public TotalKg
    Public Total_Pcs
    Public Reject
    Public DivTarget
    Public DevColor
    Public Dev
    Public Link2
    Public DivArtName
    Public DivStart
    Public DivMVT
    Public Report_Row_Number
    Public Throughput_General
    Public Total_Pcs_General
    Public Total_Trade_General
    Public Give_Away_General
    Public Reject_General
    Public DoughGroup
    Public Article_Name
    Public TotalKg_General
    Public TotalProduced_General
    Public Start
    Public MVT_Slicer
    Public Dev_General
    Public Target
    Public ReportLabel4
    Public ReportLabel5
    Public ReportLabel3
    Public ReportLabel8
    Public ReportLabel6
    Public ReportLabel7
    Public ReportLabel9
    Public Link1
    Public Avg_Throughput_General
    Public Sum_Total_Pcs_General
    Public Sum_TotalKg_General
    Public Sum_TotalProduced_General
    Public Avg_MVT_Slicer
    Public Avg_Dev_General
    Public ReportLabel1
    Public ReportLabel2
    Public ReportLabel10
    Public TotalAvg_Throughput_General
    Public TotalSum_Total_Pcs_General
    Public TotalSum_TotalKg_General
    Public TotalSum_TotalProduced_General
    Public TotalAvg_MVT_Slicer
    Public TotalAvg_Dev_General
    Public ReportLabel11
    Public Report_CurrentDateTime
    Public Link2Page
    Public Link2Parameters
    Public Link1Page
    Public Link1Parameters
    Public ReportTotalIndex, PageTotalIndex
    Public PageNumber
    Public RowNumber
    Public IsDSEmpty
    Public TotalKgTotalIndex
    Public Total_PcsTotalIndex
    Public DivTargetTotalIndex
    Public DevTotalIndex
    Public DivArtNameTotalIndex
    Public DivStartTotalIndex
    Public DivMVTTotalIndex
 
    Public Sub SetControls()
        Me.TotalKg = Report1.TotalKg.Value
        Me.Total_Pcs = Report1.Total_Pcs.Value
        Me.Reject = Report1.Reject.Value
        Me.DivTarget = Report1.DivTarget.Value
        Me.DevColor = Report1.DevColor.Value
        Me.Dev = Report1.Dev.Value
        Me.Link2 = Report1.Link2.Value
        Me.Link2Page = Report1.Link2.Page
        Me.Link2Parameters = Report1.Link2.Parameters
        Me.DivArtName = Report1.DivArtName.Value
        Me.DivStart = Report1.DivStart.Value
        Me.DivMVT = Report1.DivMVT.Value
        Me.Throughput_General = Report1.Throughput_General.Value
        Me.Total_Pcs_General = Report1.Total_Pcs_General.Value
        Me.Total_Trade_General = Report1.Total_Trade_General.Value
        Me.Give_Away_General = Report1.Give_Away_General.Value
        Me.Reject_General = Report1.Reject_General.Value
        Me.DoughGroup = Report1.DoughGroup.Value
        Me.Article_Name = Report1.Article_Name.Value
        Me.TotalKg_General = Report1.TotalKg_General.Value
        Me.TotalProduced_General = Report1.TotalProduced_General.Value
        Me.Start = Report1.Start.Value
        Me.MVT_Slicer = Report1.MVT_Slicer.Value
        Me.Dev_General = Report1.Dev_General.Value
        Me.Target = Report1.Target.Value
        Me.ReportLabel4 = Report1.ReportLabel4.Value
        Me.ReportLabel5 = Report1.ReportLabel5.Value
        Me.ReportLabel3 = Report1.ReportLabel3.Value
        Me.ReportLabel8 = Report1.ReportLabel8.Value
        Me.ReportLabel6 = Report1.ReportLabel6.Value
        Me.ReportLabel7 = Report1.ReportLabel7.Value
        Me.ReportLabel9 = Report1.ReportLabel9.Value
        Me.Link1 = Report1.Link1.Value
        Me.Link1Page = Report1.Link1.Page
        Me.Link1Parameters = Report1.Link1.Parameters
        Me.Report_CurrentDateTime = Report1.Report_CurrentDateTime.Value
    End Sub
 
    Public Sub  SyncWithHeader(HeaderGrp)
        HeaderGrp.SetTotalControls False
        Me.TotalKg = HeaderGrp.TotalKg
        Report1.TotalKg.ChangeValue(Me.TotalKg)
        Me.Total_Pcs = HeaderGrp.Total_Pcs
        Report1.Total_Pcs.ChangeValue(Me.Total_Pcs)
        Me.Reject = HeaderGrp.Reject
        Report1.Reject.ChangeValue(Me.Reject)
        Me.DivTarget = HeaderGrp.DivTarget
        Report1.DivTarget.ChangeValue(Me.DivTarget)
        Me.DevColor = HeaderGrp.DevColor
        Report1.DevColor.ChangeValue(Me.DevColor)
        Me.Dev = HeaderGrp.Dev
        Report1.Dev.ChangeValue(Me.Dev)
        Me.Link2 = HeaderGrp.Link2
        Report1.Link2.ChangeValue(Me.Link2)
        Me.Link2Page = HeaderGrp.Link2Page
        Me.Link2Parameters = HeaderGrp.Link2Parameters
        Me.DivArtName = HeaderGrp.DivArtName
        Report1.DivArtName.ChangeValue(Me.DivArtName)
        Me.DivStart = HeaderGrp.DivStart
        Report1.DivStart.ChangeValue(Me.DivStart)
        Me.DivMVT = HeaderGrp.DivMVT
        Report1.DivMVT.ChangeValue(Me.DivMVT)
        Me.Throughput_General = HeaderGrp.Throughput_General
        Report1.Throughput_General.ChangeValue(Me.Throughput_General)
        Me.Total_Pcs_General = HeaderGrp.Total_Pcs_General
        Report1.Total_Pcs_General.ChangeValue(Me.Total_Pcs_General)
        Me.Total_Trade_General = HeaderGrp.Total_Trade_General
        Report1.Total_Trade_General.ChangeValue(Me.Total_Trade_General)
        Me.Give_Away_General = HeaderGrp.Give_Away_General
        Report1.Give_Away_General.ChangeValue(Me.Give_Away_General)
        Me.Reject_General = HeaderGrp.Reject_General
        Report1.Reject_General.ChangeValue(Me.Reject_General)
        Me.DoughGroup = HeaderGrp.DoughGroup
        Report1.DoughGroup.ChangeValue(Me.DoughGroup)
        Me.Article_Name = HeaderGrp.Article_Name
        Report1.Article_Name.ChangeValue(Me.Article_Name)
        Me.TotalKg_General = HeaderGrp.TotalKg_General
        Report1.TotalKg_General.ChangeValue(Me.TotalKg_General)
        Me.TotalProduced_General = HeaderGrp.TotalProduced_General
        Report1.TotalProduced_General.ChangeValue(Me.TotalProduced_General)
        Me.Start = HeaderGrp.Start
        Report1.Start.ChangeValue(Me.Start)
        Me.MVT_Slicer = HeaderGrp.MVT_Slicer
        Report1.MVT_Slicer.ChangeValue(Me.MVT_Slicer)
        Me.Dev_General = HeaderGrp.Dev_General
        Report1.Dev_General.ChangeValue(Me.Dev_General)
        Me.Target = HeaderGrp.Target
        Report1.Target.ChangeValue(Me.Target)
        Me.ReportLabel4 = HeaderGrp.ReportLabel4
        Report1.ReportLabel4.ChangeValue(Me.ReportLabel4)
        Me.ReportLabel5 = HeaderGrp.ReportLabel5
        Report1.ReportLabel5.ChangeValue(Me.ReportLabel5)
        Me.ReportLabel3 = HeaderGrp.ReportLabel3
        Report1.ReportLabel3.ChangeValue(Me.ReportLabel3)
        Me.ReportLabel8 = HeaderGrp.ReportLabel8
        Report1.ReportLabel8.ChangeValue(Me.ReportLabel8)
        Me.ReportLabel6 = HeaderGrp.ReportLabel6
        Report1.ReportLabel6.ChangeValue(Me.ReportLabel6)
        Me.ReportLabel7 = HeaderGrp.ReportLabel7
        Report1.ReportLabel7.ChangeValue(Me.ReportLabel7)
        Me.ReportLabel9 = HeaderGrp.ReportLabel9
        Report1.ReportLabel9.ChangeValue(Me.ReportLabel9)
        Me.Link1 = HeaderGrp.Link1
        Report1.Link1.ChangeValue(Me.Link1)
        Me.Link1Page = HeaderGrp.Link1Page
        Me.Link1Parameters = HeaderGrp.Link1Parameters
        Me.Report_CurrentDateTime = HeaderGrp.Report_CurrentDateTime
        Report1.Report_CurrentDateTime.ChangeValue(Me.Report_CurrentDateTime)
    End Sub
 
    Public Sub SetTotalControls(isCalculate)
        Me.Report_TotalRecords = Report1.Report_TotalRecords.GetTotalValue(isCalculate)
        Me.Report_Row_Number = Report1.Report_Row_Number.GetTotalValue(isCalculate)
        Me.Avg_Throughput_General = Report1.Avg_Throughput_General.GetTotalValue(isCalculate)
        Me.Sum_Total_Pcs_General = Report1.Sum_Total_Pcs_General.GetTotalValue(isCalculate)
        Me.Sum_TotalKg_General = Report1.Sum_TotalKg_General.GetTotalValue(isCalculate)
        Me.Sum_TotalProduced_General = Report1.Sum_TotalProduced_General.GetTotalValue(isCalculate)
        Me.Avg_MVT_Slicer = Report1.Avg_MVT_Slicer.GetTotalValue(isCalculate)
        Me.Avg_Dev_General = Report1.Avg_Dev_General.GetTotalValue(isCalculate)
        Me.ReportLabel1 = Report1.ReportLabel1.GetTotalValue(isCalculate)
        Me.ReportLabel2 = Report1.ReportLabel2.GetTotalValue(isCalculate)
        Me.ReportLabel10 = Report1.ReportLabel10.GetTotalValue(isCalculate)
        Me.TotalAvg_Throughput_General = Report1.TotalAvg_Throughput_General.GetTotalValue(isCalculate)
        Me.TotalSum_Total_Pcs_General = Report1.TotalSum_Total_Pcs_General.GetTotalValue(isCalculate)
        Me.TotalSum_TotalKg_General = Report1.TotalSum_TotalKg_General.GetTotalValue(isCalculate)
        Me.TotalSum_TotalProduced_General = Report1.TotalSum_TotalProduced_General.GetTotalValue(isCalculate)
        Me.TotalAvg_MVT_Slicer = Report1.TotalAvg_MVT_Slicer.GetTotalValue(isCalculate)
        Me.TotalAvg_Dev_General = Report1.TotalAvg_Dev_General.GetTotalValue(isCalculate)
        Me.ReportLabel11 = Report1.ReportLabel11.GetTotalValue(isCalculate)
    End Sub
 
    Public Sub ChangeTotalControls()
        Me.Report_TotalRecords = Report1.Report_TotalRecords.Value
        Me.Report_Row_Number = Report1.Report_Row_Number.Value
        Me.Avg_Throughput_General = Report1.Avg_Throughput_General.Value
        Me.Sum_Total_Pcs_General = Report1.Sum_Total_Pcs_General.Value
        Me.Sum_TotalKg_General = Report1.Sum_TotalKg_General.Value
        Me.Sum_TotalProduced_General = Report1.Sum_TotalProduced_General.Value
        Me.Avg_MVT_Slicer = Report1.Avg_MVT_Slicer.Value
        Me.Avg_Dev_General = Report1.Avg_Dev_General.Value
        Me.ReportLabel1 = Report1.ReportLabel1.Value
        Me.ReportLabel2 = Report1.ReportLabel2.Value
        Me.ReportLabel10 = Report1.ReportLabel10.Value
        Me.TotalAvg_Throughput_General = Report1.TotalAvg_Throughput_General.Value
        Me.TotalSum_Total_Pcs_General = Report1.TotalSum_Total_Pcs_General.Value
        Me.TotalSum_TotalKg_General = Report1.TotalSum_TotalKg_General.Value
        Me.TotalSum_TotalProduced_General = Report1.TotalSum_TotalProduced_General.Value
        Me.TotalAvg_MVT_Slicer = Report1.TotalAvg_MVT_Slicer.Value
        Me.TotalAvg_Dev_General = Report1.TotalAvg_Dev_General.Value
        Me.ReportLabel11 = Report1.ReportLabel11.Value
    End Sub
 
    Public Property Get IsOpen
        IsOpen = mOpen
    End Property
 
    Public Property Get IsClose
        IsClose = mClose
    End Property
 
    Public Property Let IsOpen(Value)
        mOpen = Value
        mClose = Not Value
    End Property
 
    Public Property Let IsClose(Value)
        mClose = Value
        mOpen = Not Value
    End Property
 
End Class
'End Report1 clsReportGroup
 
'clsReport1GroupsCollection @2-365B516C
Class clsReport1GroupsCollection
    Public Groups
    Private mPageCurrentHeaderIndex
    Private mReportCurrentHeaderIndex
    Private mTotalKgCurrentHeaderIndex
    Private mTotal_PcsCurrentHeaderIndex
    Private mDivTargetCurrentHeaderIndex
    Private mDevCurrentHeaderIndex
    Private mDivArtNameCurrentHeaderIndex
    Private mDivStartCurrentHeaderIndex
    Private mDivMVTCurrentHeaderIndex
    Private CurrentPageSize
    Public PageSize
    Public TotalPages
    Public TotalRows
    Public StartIndex
    Public EndIndex
    Public CurrentPage
    Private Sub Class_Initialize()
        TotalRows = 0: TotalPages = 0: StartIndex = -1: EndIndex = 0
        Set Groups = CreateObject("Scripting.Dictionary")
        mTotalKgCurrentHeaderIndex = 2
        mTotal_PcsCurrentHeaderIndex = 3
        mDivTargetCurrentHeaderIndex = 4
        mDevCurrentHeaderIndex = 5
        mDivArtNameCurrentHeaderIndex = 6
        mDivStartCurrentHeaderIndex = 7
        mDivMVTCurrentHeaderIndex = 8
        mReportCurrentHeaderIndex = 0
        mPageCurrentHeaderIndex = 1
        CurrentPageSize = 0
    End Sub
 
    Private Function InitGroup()
        Dim group
        Set group = New clsReportGroupReport1
        group.RowNumber = TotalRows
        group.PageNumber = TotalPages
        group.ReportTotalIndex = mReportCurrentHeaderIndex
        group.PageTotalIndex = mPageCurrentHeaderIndex
        group.TotalKgTotalIndex = mTotalKgCurrentHeaderIndex
        group.Total_PcsTotalIndex = mTotal_PcsCurrentHeaderIndex
        group.DivTargetTotalIndex = mDivTargetCurrentHeaderIndex
        group.DevTotalIndex = mDevCurrentHeaderIndex
        group.DivArtNameTotalIndex = mDivArtNameCurrentHeaderIndex
        group.DivStartTotalIndex = mDivStartCurrentHeaderIndex
        group.DivMVTTotalIndex = mDivMVTCurrentHeaderIndex
        Set InitGroup = group
    End Function
 
    Public Sub OpenPage()
        Dim Group
        Dim OpenFlag
        CurrentPageSize = CurrentPageSize + Report1.Page_Header.Height
        TotalPages = TotalPages + 1
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
            Group.SetTotalControls False
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Page_Header_OnCalculate", Me)
        Group.SetControls
        Group.IsOpen = True
        mPageCurrentHeaderIndex = Groups.Count
        Group.GroupType ="Page"
        Groups.Add Groups.Count,Group
    End Sub
 
    Public Sub OpenGroup(groupName)
        Dim Group
        Dim OpenFlag
        If groupName = "Report" Then
            If TotalPages =  0 And CurrentPage=1 Then StartIndex = 0
            CurrentPageSize = CurrentPageSize + Report1.Report_Header.Height
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Report_Header_OnCalculate", Me)
            Group.SetControls 
            mReportCurrentHeaderIndex = Groups.Count
            Group.IsOpen = True
            Group.GroupType ="Report"
            Groups.Add Groups.Count,Group
            OpenPage
        End If
        If groupName = "TotalKg" Then
            If PageSize > 0 And Report1.TotalKg_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.TotalKg_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.TotalKg_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "TotalKg_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mTotalKgCurrentHeaderIndex = Groups.Count
            Group.GroupType ="TotalKg"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "Total_Pcs" Or OpenFlag Then
            If PageSize > 0 And Report1.Total_Pcs_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Total_Pcs_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.Total_Pcs_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Total_Pcs_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mTotal_PcsCurrentHeaderIndex = Groups.Count
            Group.GroupType ="Total_Pcs"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "DivTarget" Or OpenFlag Then
            If PageSize > 0 And Report1.DivTarget_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivTarget_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.DivTarget_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivTarget_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mDivTargetCurrentHeaderIndex = Groups.Count
            Group.GroupType ="DivTarget"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "Dev" Or OpenFlag Then
            If PageSize > 0 And Report1.Dev_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Dev_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.Dev_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Dev_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mDevCurrentHeaderIndex = Groups.Count
            Group.GroupType ="Dev"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "DivArtName" Or OpenFlag Then
            If PageSize > 0 And Report1.DivArtName_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivArtName_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.DivArtName_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivArtName_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mDivArtNameCurrentHeaderIndex = Groups.Count
            Group.GroupType ="DivArtName"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "DivStart" Or OpenFlag Then
            If PageSize > 0 And Report1.DivStart_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivStart_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.DivStart_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivStart_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            OpenFlag = True
            mDivStartCurrentHeaderIndex = Groups.Count
            Group.GroupType ="DivStart"
            Groups.Add Groups.Count,Group
        End If
        If groupName = "DivMVT" Or OpenFlag Then
            If PageSize > 0 And Report1.DivMVT_Header.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivMVT_Header.Height > PageSize Then
                ClosePage
                OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.DivMVT_Header.Height
            If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
            Set Group = InitGroup()
            Group.SetTotalControls False
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivMVT_Header_OnCalculate", Me)
            Group.SetControls 
            Group.IsOpen = True
            mDivMVTCurrentHeaderIndex = Groups.Count
            Group.GroupType ="DivMVT"
            Groups.Add Groups.Count,Group
        End If
    End Sub
 
    Public Sub ClosePage
        Dim Group
        Set Group = InitGroup()
        CurrentPageSize = 0
        If Groups(Groups.Count -1).IsClose And Groups(Groups.Count -1).GroupType="Report" And StartIndex < 0 Then StartIndex = mPageCurrentHeaderIndex
        If StartIndex > -1 And EndIndex = 0 Then EndIndex = Groups.Count
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mPageCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Page_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="Page"
        Groups.Add Groups.Count,Group
    End Sub
 
    Public Sub CloseGroup(groupName)
        Dim Group
        If groupName = "Report" Then
            If PageSize > 0 And Report1.Report_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Report_Footer.Height > PageSize Then
                ClosePage:OpenPage
            End If
            CurrentPageSize = CurrentPageSize + Report1.Report_Footer.Height
            Set Group = InitGroup()
            Group.SetTotalControls False
            Group.SyncWithHeader Groups(mReportCurrentHeaderIndex)
            CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Report_Footer_OnCalculate", Me)
            RestoreValues
            Group.IsClose = True
            Group.GroupType ="Report"
            Groups.Add Groups.Count,Group
            ClosePage
            Exit Sub
        End If
        If PageSize > 0 And Report1.DivMVT_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivMVT_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.DivMVT_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mDivMVTCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivMVT_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="DivMVT"
        Groups.Add Groups.Count,Group
        If groupName = "DivMVT" Then Exit Sub
        If PageSize > 0 And Report1.DivStart_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivStart_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.DivStart_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mDivStartCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivStart_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="DivStart"
        Groups.Add Groups.Count,Group
        If groupName = "DivStart" Then Exit Sub
        If PageSize > 0 And Report1.DivArtName_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivArtName_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.DivArtName_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mDivArtNameCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivArtName_Footer_OnCalculate", Me)
        Report1.Report_Row_Number.Reset()
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="DivArtName"
        Groups.Add Groups.Count,Group
        If groupName = "DivArtName" Then Exit Sub
        If PageSize > 0 And Report1.Dev_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Dev_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.Dev_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mDevCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Dev_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="Dev"
        Groups.Add Groups.Count,Group
        If groupName = "Dev" Then Exit Sub
        If PageSize > 0 And Report1.DivTarget_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.DivTarget_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.DivTarget_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mDivTargetCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "DivTarget_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="DivTarget"
        Groups.Add Groups.Count,Group
        If groupName = "DivTarget" Then Exit Sub
        If PageSize > 0 And Report1.Total_Pcs_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Total_Pcs_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.Total_Pcs_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mTotal_PcsCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Total_Pcs_Footer_OnCalculate", Me)
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="Total_Pcs"
        Groups.Add Groups.Count,Group
        If groupName = "Total_Pcs" Then Exit Sub
        If PageSize > 0 And Report1.TotalKg_Footer.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.TotalKg_Footer.Height > PageSize Then
            ClosePage:OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.TotalKg_Footer.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Set Group = InitGroup()
        Group.SetTotalControls False
        Group.SyncWithHeader Groups(mTotalKgCurrentHeaderIndex)
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "TotalKg_Footer_OnCalculate", Me)
        Report1.Avg_Throughput_General.Reset()
        Report1.Sum_Total_Pcs_General.Reset()
        Report1.Sum_TotalKg_General.Reset()
        Report1.Sum_TotalProduced_General.Reset()
        Report1.Avg_MVT_Slicer.Reset()
        Report1.Avg_Dev_General.Reset()
        Report1.ReportLabel1.Reset()
        Report1.ReportLabel2.Reset()
        Report1.ReportLabel10.Reset()
        RestoreValues
        Group.IsClose = True
        Group.GroupType ="TotalKg"
        Groups.Add Groups.Count,Group
    End Sub
    Public Sub RestoreValues
        Report1.Report_TotalRecords.Value = Report1.Report_TotalRecords.InitialValue
        Report1.TotalKg.Value = Report1.TotalKg.InitialValue
        Report1.Total_Pcs.Value = Report1.Total_Pcs.InitialValue
        Report1.Reject.Value = Report1.Reject.InitialValue
        Report1.DivTarget.Value = Report1.DivTarget.InitialValue
        Report1.DevColor.Value = Report1.DevColor.InitialValue
        Report1.Dev.Value = Report1.Dev.InitialValue
        Report1.Link2.Value = Report1.Link2.InitialValue
        Report1.DivArtName.Value = Report1.DivArtName.InitialValue
        Report1.DivStart.Value = Report1.DivStart.InitialValue
        Report1.DivMVT.Value = Report1.DivMVT.InitialValue
        Report1.Report_Row_Number.Value = Report1.Report_Row_Number.InitialValue
        Report1.Throughput_General.Value = Report1.Throughput_General.InitialValue
        Report1.Total_Pcs_General.Value = Report1.Total_Pcs_General.InitialValue
        Report1.Total_Trade_General.Value = Report1.Total_Trade_General.InitialValue
        Report1.Give_Away_General.Value = Report1.Give_Away_General.InitialValue
        Report1.Reject_General.Value = Report1.Reject_General.InitialValue
        Report1.DoughGroup.Value = Report1.DoughGroup.InitialValue
        Report1.Article_Name.Value = Report1.Article_Name.InitialValue
        Report1.TotalKg_General.Value = Report1.TotalKg_General.InitialValue
        Report1.TotalProduced_General.Value = Report1.TotalProduced_General.InitialValue
        Report1.Start.Value = Report1.Start.InitialValue
        Report1.MVT_Slicer.Value = Report1.MVT_Slicer.InitialValue
        Report1.Dev_General.Value = Report1.Dev_General.InitialValue
        Report1.Target.Value = Report1.Target.InitialValue
        Report1.ReportLabel4.Value = Report1.ReportLabel4.InitialValue
        Report1.ReportLabel5.Value = Report1.ReportLabel5.InitialValue
        Report1.ReportLabel3.Value = Report1.ReportLabel3.InitialValue
        Report1.ReportLabel8.Value = Report1.ReportLabel8.InitialValue
        Report1.ReportLabel6.Value = Report1.ReportLabel6.InitialValue
        Report1.ReportLabel7.Value = Report1.ReportLabel7.InitialValue
        Report1.ReportLabel9.Value = Report1.ReportLabel9.InitialValue
        Report1.Link1.Value = Report1.Link1.InitialValue
        Report1.Avg_Throughput_General.Value = Report1.Avg_Throughput_General.InitialValue
        Report1.Sum_Total_Pcs_General.Value = Report1.Sum_Total_Pcs_General.InitialValue
        Report1.Sum_TotalKg_General.Value = Report1.Sum_TotalKg_General.InitialValue
        Report1.Sum_TotalProduced_General.Value = Report1.Sum_TotalProduced_General.InitialValue
        Report1.Avg_MVT_Slicer.Value = Report1.Avg_MVT_Slicer.InitialValue
        Report1.Avg_Dev_General.Value = Report1.Avg_Dev_General.InitialValue
        Report1.ReportLabel1.Value = Report1.ReportLabel1.InitialValue
        Report1.ReportLabel2.Value = Report1.ReportLabel2.InitialValue
        Report1.ReportLabel10.Value = Report1.ReportLabel10.InitialValue
        Report1.TotalAvg_Throughput_General.Value = Report1.TotalAvg_Throughput_General.InitialValue
        Report1.TotalSum_Total_Pcs_General.Value = Report1.TotalSum_Total_Pcs_General.InitialValue
        Report1.TotalSum_TotalKg_General.Value = Report1.TotalSum_TotalKg_General.InitialValue
        Report1.TotalSum_TotalProduced_General.Value = Report1.TotalSum_TotalProduced_General.InitialValue
        Report1.TotalAvg_MVT_Slicer.Value = Report1.TotalAvg_MVT_Slicer.InitialValue
        Report1.TotalAvg_Dev_General.Value = Report1.TotalAvg_Dev_General.InitialValue
        Report1.ReportLabel11.Value = Report1.ReportLabel11.InitialValue
        Report1.Report_CurrentDateTime.Value = Report1.Report_CurrentDateTime.InitialValue
    End Sub
 
    Public Sub AddItem()
        If PageSize > 0 And Report1.Detail.Visible And CurrentPageSize + Report1.Page_Footer.Height + Report1.Detail.Height > PageSize Then
            ClosePage
            OpenPage
        End If
        CurrentPageSize = CurrentPageSize + Report1.Detail.Height
        If TotalPages = CurrentPage And StartIndex = -1 Then StartIndex = Groups.Count
        Dim Group
        TotalRows = TotalRows + 1
        Set Group = InitGroup()
        Group.SetTotalControls False
        CCSEventResult = CCRaiseEvent(Report1.CCSEvents, "Detail_OnCalculate", Me)
        Group.SetControls 
        Group.SetTotalControls True
        Groups.Add Groups.Count,Group
    End Sub
End Class
'End clsReport1GroupsCollection
 
Class clsReportReport1 'Report1 Class @2-D191C334
 
'Report1 Variables @2-927B8B92
 
    ' Private variables
    Private VarPageSize
    ' Public variables
    Public ComponentName, CCSEvents
    Public Visible, Errors
    Public ViewMode
    Public DataSource
    Private CurrentPageNumber
    Public Command
    Public TemplateBlock
    Public PageNumber, RowNumber, TotalRows, TotalPages
    Public IsDSEmpty
    Public UseClientPaging
    Public DetailBlock, Detail, Report_FooterBlock, Report_Footer, Report_HeaderBlock, Report_Header, Page_FooterBlock, Page_Footer, Page_HeaderBlock, Page_Header
    Public TotalKg_HeaderBlock, TotalKg_Header
    Public TotalKg_FooterBlock, TotalKg_Footer
    Public Total_Pcs_HeaderBlock, Total_Pcs_Header
    Public Total_Pcs_FooterBlock, Total_Pcs_Footer
    Public DivTarget_HeaderBlock, DivTarget_Header
    Public DivTarget_FooterBlock, DivTarget_Footer
    Public Dev_HeaderBlock, Dev_Header
    Public Dev_FooterBlock, Dev_Footer
    Public DivArtName_HeaderBlock, DivArtName_Header
    Public DivArtName_FooterBlock, DivArtName_Footer
    Public DivStart_HeaderBlock, DivStart_Header
    Public DivStart_FooterBlock, DivStart_Footer
    Public DivMVT_HeaderBlock, DivMVT_Header
    Public DivMVT_FooterBlock, DivMVT_Footer
    Public ActiveSorter, SortingDirection
    Public Recordset
    Public Attributes
 
    Private CCSEventResult
    Private AttributePrefix
 
    ' Report Controls
    Public StaticControls, RowControls, Report_FooterControls, Report_HeaderControls
    Public Page_FooterControls, Page_HeaderControls
    Public TotalKg_HeaderControls, TotalKg_FooterControls
    Public Total_Pcs_HeaderControls, Total_Pcs_FooterControls
    Public DivTarget_HeaderControls, DivTarget_FooterControls
    Public Dev_HeaderControls, Dev_FooterControls
    Public DivArtName_HeaderControls, DivArtName_FooterControls
    Public DivStart_HeaderControls, DivStart_FooterControls
    Public DivMVT_HeaderControls, DivMVT_FooterControls
    Dim Report_TotalRecords
    Dim TotalKg
    Dim Total_Pcs
    Dim Reject
    Dim DivTarget
    Dim DevColor
    Dim Dev
    Dim Link2
    Dim DivArtName
    Dim DivStart
    Dim DivMVT
    Dim Sorter_DoughGroup
    Dim Sorter_Article_Name
    Dim Sorter_Start
    Dim Sorter_Target
    Dim Sorter1
    Dim Sorter2
    Dim Sorter3
    Dim Sorter4
    Dim Sorter5
    Dim Sorter6
    Dim Sorter7
    Dim Sorter8
    Dim Sorter9
    Dim Report_Row_Number
    Dim Throughput_General
    Dim Total_Pcs_General
    Dim Total_Trade_General
    Dim Give_Away_General
    Dim Reject_General
    Dim DoughGroup
    Dim Article_Name
    Dim TotalKg_General
    Dim TotalProduced_General
    Dim Start
    Dim MVT_Slicer
    Dim Dev_General
    Dim Target
    Dim ReportLabel4
    Dim ReportLabel5
    Dim ReportLabel3
    Dim ReportLabel8
    Dim ReportLabel6
    Dim ReportLabel7
    Dim ReportLabel9
    Dim Link1
    Dim Avg_Throughput_General
    Dim Sum_Total_Pcs_General
    Dim Sum_TotalKg_General
    Dim Sum_TotalProduced_General
    Dim Avg_MVT_Slicer
    Dim Avg_Dev_General
    Dim ReportLabel1
    Dim ReportLabel2
    Dim ReportLabel10
    Dim NoRecords
    Dim TotalAvg_Throughput_General
    Dim TotalSum_Total_Pcs_General
    Dim TotalSum_TotalKg_General
    Dim TotalSum_TotalProduced_General
    Dim TotalAvg_MVT_Slicer
    Dim TotalAvg_Dev_General
    Dim ReportLabel11
    Dim PageBreak
    Dim Report_CurrentDateTime
    Dim Navigator
'End Report1 Variables
 
'Report1 Class_Initialize Event @2-07B7C902
    Private Sub Class_Initialize()
        ComponentName = "Report1"
        Dim MaxSectionSize : MaxSectionSize = 0
        Dim MinPageSize : MinPageSize = 0
        Visible = True
        Set Detail = new clsSection
        Detail.Visible = True
        Detail.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Detail.Height)
        Set Report_Footer = new clsSection
        Report_Footer.Visible = True
        Report_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Report_Footer.Height)
        Set Report_Header = new clsSection
        Report_Header.Visible = True
        Report_Header.Height = 0
        MaxSectionSize = Max (MaxSectionSize, Report_Header.Height)
        Set Page_Footer = new clsSection
        Page_Footer.Visible = True
        Page_Footer.Height = 2
        MinPageSize = MinPageSize + Page_Footer.Height
        Set Page_Header = new clsSection
        Page_Header.Visible = True
        Page_Header.Height = 0
        MinPageSize = MinPageSize + Page_Header.Height
        Set TotalKg_Footer = new clsSection
        TotalKg_Footer.Visible = True
        TotalKg_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, TotalKg_Footer.Height)
        Set TotalKg_Header = new clsSection
        TotalKg_Header.Visible = True
        TotalKg_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, TotalKg_Header.Height)
        Set Total_Pcs_Footer = new clsSection
        Total_Pcs_Footer.Visible = True
        Total_Pcs_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Total_Pcs_Footer.Height)
        Set Total_Pcs_Header = new clsSection
        Total_Pcs_Header.Visible = True
        Total_Pcs_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Total_Pcs_Header.Height)
        Set DivTarget_Footer = new clsSection
        DivTarget_Footer.Visible = True
        DivTarget_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivTarget_Footer.Height)
        Set DivTarget_Header = new clsSection
        DivTarget_Header.Visible = True
        DivTarget_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivTarget_Header.Height)
        Set Dev_Footer = new clsSection
        Dev_Footer.Visible = True
        Dev_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Dev_Footer.Height)
        Set Dev_Header = new clsSection
        Dev_Header.Visible = True
        Dev_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, Dev_Header.Height)
        Set DivArtName_Footer = new clsSection
        DivArtName_Footer.Visible = True
        DivArtName_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivArtName_Footer.Height)
        Set DivArtName_Header = new clsSection
        DivArtName_Header.Visible = True
        DivArtName_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivArtName_Header.Height)
        Set DivStart_Footer = new clsSection
        DivStart_Footer.Visible = True
        DivStart_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivStart_Footer.Height)
        Set DivStart_Header = new clsSection
        DivStart_Header.Visible = True
        DivStart_Header.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivStart_Header.Height)
        Set DivMVT_Footer = new clsSection
        DivMVT_Footer.Visible = True
        DivMVT_Footer.Height = 1
        MaxSectionSize = Max(MaxSectionSize, DivMVT_Footer.Height)
        Set DivMVT_Header = new clsSection
        DivMVT_Header.Visible = True
        DivMVT_Header.Height = 2
        MaxSectionSize = Max(MaxSectionSize, DivMVT_Header.Height)
        Set CCSEvents = CreateObject("Scripting.Dictionary")
        Set Attributes = New clsAttributes
        AttributePrefix = ComponentName & ":"
        Set Errors = New clsErrors
        Set DataSource = New clsReport1DataSource
        Set Command = New clsCommand
        Dim defaultPage
        MinPageSize = MinPageSize + MaxSectionSize
        ViewMode = CCGetParam("ViewMode", "Web")
        If ViewMode = "Print" Then
            defaultPage = 50
        Else
            defaultPage = 1000
        End If
        PageSize = CCGetParam(ComponentName & "PageSize", defaultPage)
        If Not IsNumeric(PageSize) Or IsEmpty(PageSize) Then
            PageSize = defaultPage
        Else
            PageSize =  CInt(PageSize)
        End If
        If PageSize = 0 Then
            PageSize = 100
        ElseIf PageSize < 0 Then 
            PageSize = defaultPage
        End If
        If PageSize > 0 And PageSize < MinPageSize Then PageSize = MinPageSize
        CurrentPageNumber = CCGetParam(ComponentName & "Page", 1)
        If Not IsNumeric(CurrentPageNumber) And Len(CurrentPageNumber) > 0 Then
            CurrentPageNumber = 1
        ElseIf Len(CurrentPageNumber) > 0 Then
            If CurrentPageNumber > 0 Then
                CurrentPageNumber = CInt(CurrentPageNumber)
            Else
                CurrentPageNumber = 1
            End If
        Else
            CurrentPageNumber = 1
        End If
        ActiveSorter = CCGetParam("Report1Order", Empty)
        SortingDirection = CCGetParam("Report1Dir", Empty)
        If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _
            SortingDirection = Empty
 
        Set Report_TotalRecords = CCCreateReportLabel( "Report_TotalRecords", Empty, ccsText, Empty, CCGetRequestParam("Report_TotalRecords", ccsGet), "Count",  False, True,"")
        Set TotalKg = CCCreateReportLabel( "TotalKg", Empty, ccsInteger, Empty, CCGetRequestParam("TotalKg", ccsGet), "",  False, False,"")
        Set Total_Pcs = CCCreateReportLabel( "Total_Pcs", Empty, ccsInteger, Empty, CCGetRequestParam("Total_Pcs", ccsGet), "",  False, False,"")
        Set Reject = CCCreateReportLabel( "Reject", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Reject", ccsGet), "",  False, False,"")
        Set DivTarget = CCCreateReportLabel( "DivTarget", Empty, ccsText, Empty, CCGetRequestParam("DivTarget", ccsGet), "",  False, False,"")
        Set DevColor = CCCreateReportLabel( "DevColor", Empty, ccsText, Empty, CCGetRequestParam("DevColor", ccsGet), "",  False, True,"")
        DevColor.HTML = True
        Set Dev = CCCreateReportLabel( "Dev", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Dev", ccsGet), "",  False, False,"")
        Set Link2 = CCCreateControl(ccsLink, "Link2", Empty, ccsText, Empty, CCGetRequestParam("Link2", ccsGet))
        Set DivArtName = CCCreateReportLabel( "DivArtName", Empty, ccsText, Empty, CCGetRequestParam("DivArtName", ccsGet), "",  False, False,"")
        Set DivStart = CCCreateReportLabel( "DivStart", Empty, ccsDate, Array("GeneralDate"), CCGetRequestParam("DivStart", ccsGet), "",  False, False,"")
        Set DivMVT = CCCreateReportLabel( "DivMVT", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("DivMVT", ccsGet), "",  False, False,"")
        Set Sorter_DoughGroup = CCCreateSorter("Sorter_DoughGroup", Me, FileName)
        Set Sorter_Article_Name = CCCreateSorter("Sorter_Article_Name", Me, FileName)
        Set Sorter_Start = CCCreateSorter("Sorter_Start", Me, FileName)
        Set Sorter_Target = CCCreateSorter("Sorter_Target", Me, FileName)
        Set Sorter1 = CCCreateSorter("Sorter1", Me, FileName)
        Set Sorter2 = CCCreateSorter("Sorter2", Me, FileName)
        Set Sorter3 = CCCreateSorter("Sorter3", Me, FileName)
        Set Sorter4 = CCCreateSorter("Sorter4", Me, FileName)
        Set Sorter5 = CCCreateSorter("Sorter5", Me, FileName)
        Set Sorter6 = CCCreateSorter("Sorter6", Me, FileName)
        Set Sorter7 = CCCreateSorter("Sorter7", Me, FileName)
        Set Sorter8 = CCCreateSorter("Sorter8", Me, FileName)
        Set Sorter9 = CCCreateSorter("Sorter9", Me, FileName)
        Set Report_Row_Number = CCCreateReportLabel( "Report_Row_Number", Empty, ccsInteger, Empty, CCGetRequestParam("Report_Row_Number", ccsGet), "Count",  False, True,"")
        Set Throughput_General = CCCreateReportLabel( "Throughput_General", Empty, ccsInteger, Empty, CCGetRequestParam("Throughput_General", ccsGet), "",  False, False,"")
        Set Total_Pcs_General = CCCreateReportLabel( "Total_Pcs_General", Empty, ccsInteger, Empty, CCGetRequestParam("Total_Pcs_General", ccsGet), "",  False, False,"")
        Set Total_Trade_General = CCCreateReportLabel( "Total_Trade_General", Empty, ccsInteger, Empty, CCGetRequestParam("Total_Trade_General", ccsGet), "",  False, False,"")
        Set Give_Away_General = CCCreateReportLabel( "Give_Away_General", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Give_Away_General", ccsGet), "",  False, False,"")
        Set Reject_General = CCCreateReportLabel( "Reject_General", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Reject_General", ccsGet), "",  False, False,"")
        Set DoughGroup = CCCreateReportLabel( "DoughGroup", Empty, ccsText, Empty, CCGetRequestParam("DoughGroup", ccsGet), "",  False, False,"")
        Set Article_Name = CCCreateReportLabel( "Article_Name", Empty, ccsText, Empty, CCGetRequestParam("Article_Name", ccsGet), "",  False, False,"")
        Set TotalKg_General = CCCreateReportLabel( "TotalKg_General", Empty, ccsInteger, Empty, CCGetRequestParam("TotalKg_General", ccsGet), "",  False, False,"")
        Set TotalProduced_General = CCCreateReportLabel( "TotalProduced_General", Empty, ccsInteger, Empty, CCGetRequestParam("TotalProduced_General", ccsGet), "",  False, False,"")
        Set Start = CCCreateReportLabel( "Start", Empty, ccsDate, Array("GeneralDate"), CCGetRequestParam("Start", ccsGet), "",  False, False,"")
        Set MVT_Slicer = CCCreateReportLabel( "MVT_Slicer", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("MVT_Slicer", ccsGet), "",  False, False,"")
        Set Dev_General = CCCreateReportLabel( "Dev_General", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Dev_General", ccsGet), "",  False, False,"")
        Set Target = CCCreateReportLabel( "Target", Empty, ccsText, Empty, CCGetRequestParam("Target", ccsGet), "",  False, False,"")
        Set ReportLabel4 = CCCreateReportLabel( "ReportLabel4", Empty, ccsText, Empty, CCGetRequestParam("ReportLabel4", ccsGet), "",  False, True,"")
        Set ReportLabel5 = CCCreateReportLabel( "ReportLabel5", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel5", ccsGet), "",  False, True,"")
        Set ReportLabel3 = CCCreateReportLabel( "ReportLabel3", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel3", ccsGet), "",  False, True,"")
        Set ReportLabel8 = CCCreateReportLabel( "ReportLabel8", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel8", ccsGet), "",  False, True,"")
        Set ReportLabel6 = CCCreateReportLabel( "ReportLabel6", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel6", ccsGet), "",  False, True,"")
        Set ReportLabel7 = CCCreateReportLabel( "ReportLabel7", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel7", ccsGet), "",  False, True,"")
        Set ReportLabel9 = CCCreateReportLabel( "ReportLabel9", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel9", ccsGet), "",  False, True,"")
        Set Link1 = CCCreateControl(ccsLink, "Link1", Empty, ccsText, Empty, CCGetRequestParam("Link1", ccsGet))
        Set Avg_Throughput_General = CCCreateReportLabel( "Avg_Throughput_General", Empty, ccsInteger, Array(False, 2, False, False, False, "", "", 1, True, ""), CCGetRequestParam("Avg_Throughput_General", ccsGet), "Avg",  False, False,"")
        Set Sum_Total_Pcs_General = CCCreateReportLabel( "Sum_Total_Pcs_General", Empty, ccsInteger, Empty, CCGetRequestParam("Sum_Total_Pcs_General", ccsGet), "Sum",  False, False,"")
        Set Sum_TotalKg_General = CCCreateReportLabel( "Sum_TotalKg_General", Empty, ccsInteger, Empty, CCGetRequestParam("Sum_TotalKg_General", ccsGet), "Sum",  False, False,"")
        Set Sum_TotalProduced_General = CCCreateReportLabel( "Sum_TotalProduced_General", Empty, ccsInteger, Empty, CCGetRequestParam("Sum_TotalProduced_General", ccsGet), "Sum",  False, False,"")
        Set Avg_MVT_Slicer = CCCreateReportLabel( "Avg_MVT_Slicer", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Avg_MVT_Slicer", ccsGet), "Avg",  False, False,"")
        Set Avg_Dev_General = CCCreateReportLabel( "Avg_Dev_General", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("Avg_Dev_General", ccsGet), "Avg",  False, False,"")
        Set ReportLabel1 = CCCreateReportLabel( "ReportLabel1", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel1", ccsGet), "Sum",  False, False,"")
        Set ReportLabel2 = CCCreateReportLabel( "ReportLabel2", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel2", ccsGet), "Sum",  False, False,"")
        Set ReportLabel10 = CCCreateReportLabel( "ReportLabel10", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel10", ccsGet), "Sum",  False, False,"")
        Set NoRecords = CCCreatePanel("NoRecords")
        Set TotalAvg_Throughput_General = CCCreateReportLabel( "TotalAvg_Throughput_General", Empty, ccsInteger, Array(False, 2, False, False, False, "", "", 1, True, ""), CCGetRequestParam("TotalAvg_Throughput_General", ccsGet), "Avg",  False, False,"")
        Set TotalSum_Total_Pcs_General = CCCreateReportLabel( "TotalSum_Total_Pcs_General", Empty, ccsInteger, Empty, CCGetRequestParam("TotalSum_Total_Pcs_General", ccsGet), "Sum",  False, False,"")
        Set TotalSum_TotalKg_General = CCCreateReportLabel( "TotalSum_TotalKg_General", Empty, ccsInteger, Empty, CCGetRequestParam("TotalSum_TotalKg_General", ccsGet), "Sum",  False, False,"")
        Set TotalSum_TotalProduced_General = CCCreateReportLabel( "TotalSum_TotalProduced_General", Empty, ccsInteger, Empty, CCGetRequestParam("TotalSum_TotalProduced_General", ccsGet), "Sum",  False, False,"")
        Set TotalAvg_MVT_Slicer = CCCreateReportLabel( "TotalAvg_MVT_Slicer", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("TotalAvg_MVT_Slicer", ccsGet), "Avg",  False, False,"")
        Set TotalAvg_Dev_General = CCCreateReportLabel( "TotalAvg_Dev_General", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("TotalAvg_Dev_General", ccsGet), "Avg",  False, False,"")
        Set ReportLabel11 = CCCreateReportLabel( "ReportLabel11", Empty, ccsFloat, Array(False, 2, True, False, False, "", "", 1, True, ""), CCGetRequestParam("ReportLabel11", ccsGet), "Sum",  False, False,"")
        Set PageBreak = CCCreatePanel("PageBreak")
        Set Report_CurrentDateTime = CCCreateReportLabel( "Report_CurrentDateTime", Empty, ccsDate, Array("ReportDate"), CCGetRequestParam("Report_CurrentDateTime", ccsGet), "",  False, False,"")
        Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple)
        Navigator.PageSizes = Array("1", "5", "10", "25", "50")
        IsDSEmpty = True
        UseClientPaging = False
    End Sub
'End Report1 Class_Initialize Event
 
'Report1 Initialize Method @2-BD78A2B0
    Sub Initialize(objConnection)
        If NOT Visible Then Exit Sub
 
        Set DataSource.Connection = objConnection
        DataSource.SetOrder ActiveSorter, SortingDirection
    End Sub
'End Report1 Initialize Method
 
'Report1 Class_Terminate Event @2-8595EA66
    Private Sub Class_Terminate()
        Set DataSource = Nothing
        Set Command = Nothing
        Set Attributes = Nothing
        Set Errors = Nothing
    End Sub
'End Report1 Class_Terminate Event
 
'Report1 Show Method @2-D8768B08
    Sub Show(Tpl)
        If NOT Visible Then Exit Sub
 
        Dim RecordCounter
 
        With DataSource
            .Parameters("urls_Start_Start") = CCGetRequestParam("s_Start_Start", ccsGET)
            .Parameters("urls_Start_Stop") = CCGetRequestParam("s_Start_Stop", ccsGET)
        End With
 
        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me)
        Set Recordset = DataSource.Open(Command)
        IsDSEmpty = Recordset.EOF
 
        Set TemplateBlock = Tpl.Block("Report " & ComponentName)
        Set Report_HeaderBlock = TemplateBlock.Block("Section Report_Header")
        Set Report_FooterBlock = TemplateBlock.Block("Section Report_Footer")
        Set Page_HeaderBlock = TemplateBlock.Block("Section Page_Header")
        Set Page_FooterBlock = TemplateBlock.Block("Section Page_Footer")
        Set TotalKg_HeaderBlock = TemplateBlock.Block("Section TotalKg_Header")
        Set TotalKg_FooterBlock = TemplateBlock.Block("Section TotalKg_Footer")
        Set Total_Pcs_HeaderBlock = TemplateBlock.Block("Section Total_Pcs_Header")
        Set Total_Pcs_FooterBlock = TemplateBlock.Block("Section Total_Pcs_Footer")
        Set DivTarget_HeaderBlock = TemplateBlock.Block("Section DivTarget_Header")
        Set DivTarget_FooterBlock = TemplateBlock.Block("Section DivTarget_Footer")
        Set Dev_HeaderBlock = TemplateBlock.Block("Section Dev_Header")
        Set Dev_FooterBlock = TemplateBlock.Block("Section Dev_Footer")
        Set DivArtName_HeaderBlock = TemplateBlock.Block("Section DivArtName_Header")
        Set DivArtName_FooterBlock = TemplateBlock.Block("Section DivArtName_Footer")
        Set DivStart_HeaderBlock = TemplateBlock.Block("Section DivStart_Header")
        Set DivStart_FooterBlock = TemplateBlock.Block("Section DivStart_Footer")
        Set DivMVT_HeaderBlock = TemplateBlock.Block("Section DivMVT_Header")
        Set DivMVT_FooterBlock = TemplateBlock.Block("Section DivMVT_Footer")
        Set DetailBlock = TemplateBlock.Block("Section Detail")
        Set RowControls = CCCreateCollection(DetailBlock, Null, ccsParseAccumulate, _
            Array(Report_Row_Number, Throughput_General, Total_Pcs_General, Total_Trade_General, Give_Away_General, Reject_General, DoughGroup, Article_Name, TotalKg_General, TotalProduced_General, Start, MVT_Slicer, Dev_General, Target, ReportLabel4, ReportLabel5, ReportLabel3, ReportLabel8, ReportLabel6, ReportLabel7, ReportLabel9, Link1))
        Set Report_FooterControls = CCCreateCollection(Report_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array(NoRecords, TotalAvg_Throughput_General, TotalSum_Total_Pcs_General, TotalSum_TotalKg_General, TotalSum_TotalProduced_General, TotalAvg_MVT_Slicer, TotalAvg_Dev_General, ReportLabel11))
        Set Report_HeaderControls = CCCreateCollection(Report_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(Report_TotalRecords))
        Set Page_FooterControls = CCCreateCollection(Page_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array(PageBreak, Report_CurrentDateTime, Navigator))
        Set TotalKg_HeaderControls = CCCreateCollection(TotalKg_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(TotalKg))
        Set TotalKg_FooterControls = CCCreateCollection(TotalKg_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array(Avg_Throughput_General, Sum_Total_Pcs_General, Sum_TotalKg_General, Sum_TotalProduced_General, Avg_MVT_Slicer, Avg_Dev_General, ReportLabel1, ReportLabel2, ReportLabel10))
        Set Total_Pcs_HeaderControls = CCCreateCollection(Total_Pcs_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(Total_Pcs, Reject))
        Set Total_Pcs_FooterControls = CCCreateCollection(Total_Pcs_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Set DivTarget_HeaderControls = CCCreateCollection(DivTarget_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(DivTarget))
        Set DivTarget_FooterControls = CCCreateCollection(DivTarget_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Set Dev_HeaderControls = CCCreateCollection(Dev_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(DevColor, Dev, Link2))
        Set Dev_FooterControls = CCCreateCollection(Dev_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Set DivArtName_HeaderControls = CCCreateCollection(DivArtName_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(DivArtName))
        Set DivArtName_FooterControls = CCCreateCollection(DivArtName_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Set DivStart_HeaderControls = CCCreateCollection(DivStart_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(DivStart))
        Set DivStart_FooterControls = CCCreateCollection(DivStart_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Set DivMVT_HeaderControls = CCCreateCollection(DivMVT_HeaderBlock, DetailBlock, ccsParseAccumulate, _
            Array(DivMVT, Sorter_DoughGroup, Sorter_Article_Name, Sorter_Start, Sorter_Target, Sorter1, Sorter2, Sorter3, Sorter4, Sorter5, Sorter6, Sorter7, Sorter8, Sorter9))
        Set DivMVT_FooterControls = CCCreateCollection(DivMVT_FooterBlock, DetailBlock, ccsParseAccumulate, _
            Array())
        Dim TotalKgKey
        Dim Total_PcsKey
        Dim DivTargetKey
        Dim DevKey
        Dim DivArtNameKey
        Dim DivStartKey
        Dim DivMVTKey
        Dim Groups
        Set Groups = New clsReport1GroupsCollection
        Groups.CurrentPage = CurrentPageNumber
        If PageSize > 0 Then Groups.PageSize = PageSize
        Errors.AddErrors DataSource.Errors
        If Errors.Count > 0 Then
            TemplateBlock.HTML = CCFormatError("Report Report1", Errors)
        Else
            Do While Not Recordset.EOF
                TotalKg.Value = Recordset.Fields("TotalKg")
                Total_Pcs.Value = Recordset.Fields("Total_Pcs")
                Reject.Value = Recordset.Fields("Reject")
                DivTarget.Value = Recordset.Fields("DivTarget")
                Dev.Value = Recordset.Fields("Dev")
                DivArtName.Value = Recordset.Fields("DivArtName")
                DivStart.Value = Recordset.Fields("DivStart")
                DivMVT.Value = Recordset.Fields("DivMVT")
                Throughput_General.Value = Recordset.Fields("Throughput_General")
                Total_Pcs_General.Value = Recordset.Fields("Total_Pcs_General")
                Total_Trade_General.Value = Recordset.Fields("Total_Trade_General")
                Give_Away_General.Value = Recordset.Fields("Give_Away_General")
                Reject_General.Value = Recordset.Fields("Reject_General")
                DoughGroup.Value = Recordset.Fields("DoughGroup")
                Article_Name.Value = Recordset.Fields("Article_Name")
                TotalKg_General.Value = Recordset.Fields("TotalKg_General")
                TotalProduced_General.Value = Recordset.Fields("TotalProduced_General")
                Start.Value = Recordset.Fields("Start")
                MVT_Slicer.Value = Recordset.Fields("MVT_Slicer")
                Dev_General.Value = Recordset.Fields("Dev_General")
                Target.Value = Recordset.Fields("Target")
                Avg_Throughput_General.Value = Recordset.Fields("Avg_Throughput_General")
                Sum_Total_Pcs_General.Value = Recordset.Fields("Sum_Total_Pcs_General")
                Sum_TotalKg_General.Value = Recordset.Fields("Sum_TotalKg_General")
                Sum_TotalProduced_General.Value = Recordset.Fields("Sum_TotalProduced_General")
                Avg_MVT_Slicer.Value = Recordset.Fields("Avg_MVT_Slicer")
                Avg_Dev_General.Value = Recordset.Fields("Avg_Dev_General")
                ReportLabel1.Value = Recordset.Fields("ReportLabel1")
                ReportLabel2.Value = Recordset.Fields("ReportLabel2")
                ReportLabel10.Value = Recordset.Fields("ReportLabel10")
                TotalAvg_Throughput_General.Value = Recordset.Fields("TotalAvg_Throughput_General")
                TotalSum_Total_Pcs_General.Value = Recordset.Fields("TotalSum_Total_Pcs_General")
                TotalSum_TotalKg_General.Value = Recordset.Fields("TotalSum_TotalKg_General")
                TotalSum_TotalProduced_General.Value = Recordset.Fields("TotalSum_TotalProduced_General")
                TotalAvg_MVT_Slicer.Value = Recordset.Fields("TotalAvg_MVT_Slicer")
                TotalAvg_Dev_General.Value = Recordset.Fields("TotalAvg_Dev_General")
                ReportLabel11.Value = Recordset.Fields("ReportLabel11")
                Report_CurrentDateTime.Value = Recordset.Fields("Report_CurrentDateTime")
                DevColor.Value = Empty
                Link2.Value = Empty
                ReportLabel4.Value = Empty
                ReportLabel5.Value = Empty
                ReportLabel3.Value = Empty
                ReportLabel8.Value = Empty
                ReportLabel6.Value = Empty
                ReportLabel7.Value = Empty
                ReportLabel9.Value = Empty
                Link1.Value = Empty
                Report_TotalRecords.Value = 1
                Report_Row_Number.Value = 1
                Link2.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
                Link2.Page = "Reason_Divider.asp"
                Link1.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
                Link1.Page = "Reason_Slicers.asp"
                If Groups.Groups.Count = 0 Then Groups.OpenGroup "Report"
                If Groups.Groups.Count = 2 Or TotalKgKey <> Recordset.Fields("TotalKg") Then
                    Groups.OpenGroup "TotalKg"
                ElseIf Total_PcsKey <> Recordset.Fields("Total_Pcs") Then
                    Groups.OpenGroup "Total_Pcs"
                ElseIf DivTargetKey <> Recordset.Fields("DivTarget") Then
                    Groups.OpenGroup "DivTarget"
                ElseIf DevKey <> Recordset.Fields("Dev") Then
                    Groups.OpenGroup "Dev"
                ElseIf DivArtNameKey <> Recordset.Fields("DivArtName") Then
                    Groups.OpenGroup "DivArtName"
                ElseIf DivStartKey <> Recordset.Fields("DivStart") Then
                    Groups.OpenGroup "DivStart"
                ElseIf DivMVTKey <> Recordset.Fields("DivMVT") Then
                    Groups.OpenGroup "DivMVT"
                End If
                Groups.AddItem 
                TotalKgKey = Recordset.Fields("TotalKg")
                Total_PcsKey = Recordset.Fields("Total_Pcs")
                DivTargetKey = Recordset.Fields("DivTarget")
                DevKey = Recordset.Fields("Dev")
                DivArtNameKey = Recordset.Fields("DivArtName")
                DivStartKey = Recordset.Fields("DivStart")
                DivMVTKey = Recordset.Fields("DivMVT")
                Recordset.MoveNext
                If TotalKgKey <> Recordset.Fields("TotalKg") Or Recordset.EOF Then
                    Groups.CloseGroup "TotalKg"
                ElseIf Total_PcsKey <> Recordset.Fields("Total_Pcs") Then
                    Groups.CloseGroup "Total_Pcs"
                ElseIf DivTargetKey <> Recordset.Fields("DivTarget") Then
                    Groups.CloseGroup "DivTarget"
                ElseIf DevKey <> Recordset.Fields("Dev") Then
                    Groups.CloseGroup "Dev"
                ElseIf DivArtNameKey <> Recordset.Fields("DivArtName") Then
                    Groups.CloseGroup "DivArtName"
                ElseIf DivStartKey <> Recordset.Fields("DivStart") Then
                    Groups.CloseGroup "DivStart"
                ElseIf DivMVTKey <> Recordset.Fields("DivMVT") Then
                    Groups.CloseGroup "DivMVT"
                End If
            Loop
            If Groups.Groups.Count = 0 Then Groups.OpenGroup "Report"
            Groups.CloseGroup "Report"
 
            CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
            If NOT Visible Then Exit Sub
 
            RowControls.PreserveControlsVisible
            TotalPages = Groups.TotalPages
            TotalRows = Groups.TotalRows
            Dim i,k, StartItem, EndItem, LastValueInd
            Dim items
            items = Groups.Groups.Items
            If PageSize <> 0 And ViewMode = "Web" Then
                StartItem = Groups.StartIndex 
                EndItem = Groups.EndIndex
                If EndItem > UBound(items) Then EndItem = UBound(items)
            Else
                StartItem = 0
                EndItem = UBound(items)
            End If
            LastValueInd = 0
            For i=0 To UBound(items)
                RowNumber = items(i).RowNumber
                PageNumber = items(i).PageNumber
                Select Case items(i).GroupType
                    Case ""
                        Report_Row_Number.Value = items(i).Report_Row_Number
                        Throughput_General.Value = items(i).Throughput_General
                        Total_Pcs_General.Value = items(i).Total_Pcs_General
                        Total_Trade_General.Value = items(i).Total_Trade_General
                        Give_Away_General.Value = items(i).Give_Away_General
                        Reject_General.Value = items(i).Reject_General
                        DoughGroup.Value = items(i).DoughGroup
                        Article_Name.Value = items(i).Article_Name
                        TotalKg_General.Value = items(i).TotalKg_General
                        TotalProduced_General.Value = items(i).TotalProduced_General
                        Start.Value = items(i).Start
                        MVT_Slicer.Value = items(i).MVT_Slicer
                        Dev_General.Value = items(i).Dev_General
                        Target.Value = items(i).Target
                        ReportLabel4.Value = items(i).ReportLabel4
                        ReportLabel5.Value = items(i).ReportLabel5
                        ReportLabel3.Value = items(i).ReportLabel3
                        ReportLabel8.Value = items(i).ReportLabel8
                        ReportLabel6.Value = items(i).ReportLabel6
                        ReportLabel7.Value = items(i).ReportLabel7
                        ReportLabel9.Value = items(i).ReportLabel9
                        Link1.Value = items(i).Link1
                        Link1.Page = items(i).Link1Page
                        Link1.Parameters = items(i).Link1Parameters
                        If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Detail_BeforeShow", Me)
                        If Detail.Visible And i >= StartItem And i<= EndItem Then
                            Attributes.Show DetailBlock, AttributePrefix
                            RowControls.Show
                        End If
                        LastValueInd = i
                    Case "Report"
                        Report_TotalRecords.Value = items(i).Report_TotalRecords
                        TotalAvg_Throughput_General.Value = items(i).TotalAvg_Throughput_General
                        TotalSum_Total_Pcs_General.Value = items(i).TotalSum_Total_Pcs_General
                        TotalSum_TotalKg_General.Value = items(i).TotalSum_TotalKg_General
                        TotalSum_TotalProduced_General.Value = items(i).TotalSum_TotalProduced_General
                        TotalAvg_MVT_Slicer.Value = items(i).TotalAvg_MVT_Slicer
                        TotalAvg_Dev_General.Value = items(i).TotalAvg_Dev_General
                        ReportLabel11.Value = items(i).ReportLabel11
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Report_Header_BeforeShow", Me)
                            If Report_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Report_HeaderBlock, AttributePrefix
                                Report_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Report_Footer_BeforeShow", Me)
                            If Report_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Report_FooterBlock, AttributePrefix
                                Report_FooterControls.Show
                            End If
                        End If
                PageBreak.Visible = (i < EndItem-1 And ViewMode <> "Web")
                    Case "Page"
                        Report_CurrentDateTime.Value = Now
                        Navigator.PageSize = PageSize
                        Navigator.PagesCount = Groups.TotalPages
                        Navigator.PageNumber = items(i).PageNumber
                        Navigator.Visible = ("Web" = ViewMode)
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Page_Header_BeforeShow", Me)
                            If Page_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Page_HeaderBlock, AttributePrefix
                                Page_HeaderBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                        If (items(i).IsClose And Not UseClientPaging) Or (items(i).IsOpen And UseClientPaging) Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Page_Footer_BeforeShow", Me)
                            If Page_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Page_FooterBlock, AttributePrefix
                                Page_FooterControls.Show
                            End If
                        End If
                        NoRecords.Visible = Recordset.EOF And Recordset.BOF And items(i).IsOpen
                    Case "TotalKg"
                        TotalKg.Value = items(i).TotalKg
                        Avg_Throughput_General.Value = items(i).Avg_Throughput_General
                        Sum_Total_Pcs_General.Value = items(i).Sum_Total_Pcs_General
                        Sum_TotalKg_General.Value = items(i).Sum_TotalKg_General
                        Sum_TotalProduced_General.Value = items(i).Sum_TotalProduced_General
                        Avg_MVT_Slicer.Value = items(i).Avg_MVT_Slicer
                        Avg_Dev_General.Value = items(i).Avg_Dev_General
                        ReportLabel1.Value = items(i).ReportLabel1
                        ReportLabel2.Value = items(i).ReportLabel2
                        ReportLabel10.Value = items(i).ReportLabel10
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "TotalKg_Header_BeforeShow", Me)
                            If TotalKg_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show TotalKg_HeaderBlock, AttributePrefix
                                TotalKg_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "TotalKg_Footer_BeforeShow", Me)
                            If TotalKg_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show TotalKg_FooterBlock, AttributePrefix
                                TotalKg_FooterControls.Show
                            End If
                        End If
                    Case "Total_Pcs"
                        Total_Pcs.Value = items(i).Total_Pcs
                        Reject.Value = items(i).Reject
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Total_Pcs_Header_BeforeShow", Me)
                            If Total_Pcs_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Total_Pcs_HeaderBlock, AttributePrefix
                                Total_Pcs_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Total_Pcs_Footer_BeforeShow", Me)
                            If Total_Pcs_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Total_Pcs_FooterBlock, AttributePrefix
                                Total_Pcs_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                    Case "DivTarget"
                        DivTarget.Value = items(i).DivTarget
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivTarget_Header_BeforeShow", Me)
                            If DivTarget_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivTarget_HeaderBlock, AttributePrefix
                                DivTarget_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivTarget_Footer_BeforeShow", Me)
                            If DivTarget_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivTarget_FooterBlock, AttributePrefix
                                DivTarget_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                    Case "Dev"
                        DevColor.Value = items(i).DevColor
                        Dev.Value = items(i).Dev
                        Link2.Value = items(i).Link2
                        Link2.Page = items(i).Link2Page
                        Link2.Parameters = items(i).Link2Parameters
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Dev_Header_BeforeShow", Me)
                            If Dev_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Dev_HeaderBlock, AttributePrefix
                                Dev_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "Dev_Footer_BeforeShow", Me)
                            If Dev_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show Dev_FooterBlock, AttributePrefix
                                Dev_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                    Case "DivArtName"
                        DivArtName.Value = items(i).DivArtName
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivArtName_Header_BeforeShow", Me)
                            If DivArtName_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivArtName_HeaderBlock, AttributePrefix
                                DivArtName_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivArtName_Footer_BeforeShow", Me)
                            If DivArtName_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivArtName_FooterBlock, AttributePrefix
                                DivArtName_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                    Case "DivStart"
                        DivStart.Value = items(i).DivStart
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivStart_Header_BeforeShow", Me)
                            If DivStart_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivStart_HeaderBlock, AttributePrefix
                                DivStart_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivStart_Footer_BeforeShow", Me)
                            If DivStart_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivStart_FooterBlock, AttributePrefix
                                DivStart_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                    Case "DivMVT"
                        DivMVT.Value = items(i).DivMVT
                        If items(i).IsOpen Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivMVT_Header_BeforeShow", Me)
                            If DivMVT_Header.Visible  And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivMVT_HeaderBlock, AttributePrefix
                                DivMVT_HeaderControls.Show
                            End If
                        End If
                        If items(i).IsClose Then
                            If i >= StartItem And i<= EndItem Then CCSEventResult = CCRaiseEvent(CCSEvents, "DivMVT_Footer_BeforeShow", Me)
                            If DivMVT_Footer.Visible And i >= StartItem And i<= EndItem Then 
                                Attributes.Show DivMVT_FooterBlock, AttributePrefix
                                DivMVT_FooterBlock.ParseTo ccsParseAccumulate, DetailBlock
                            End If
                        End If
                End Select
            Next
            TemplateBlock.Parse ccsParseOverwrite
        End If
 
    End Sub
'End Report1 Show Method
 
'Report1 PageSize Property Let @2-54E46DD6
    Public Property Let PageSize(NewValue)
        VarPageSize = NewValue
        DataSource.PageSize = NewValue
    End Property
'End Report1 PageSize Property Let
 
'Report1 PageSize Property Get @2-9AA1D1E9
    Public Property Get PageSize()
        PageSize = VarPageSize
    End Property
'End Report1 PageSize Property Get
 
End Class 'End Report1 Class @2-A61BA892
 
Class clsReport1DataSource 'Report1DataSource Class @2-1489A126
 
'DataSource Variables @2-FC50175B
    Public Errors, Connection, Parameters, CCSEvents
 
    Public Recordset
    Public SQL, CountSQL, Order, Where, Orders, StaticOrder
    Public PageSize
    Public PageCount
    Public AbsolutePage
    Public Fields
    Dim WhereParameters
    Public AllParamsSet
    Public CmdExecution
    Public InsertOmitIfEmpty
    Public UpdateOmitIfEmpty
 
    Private CurrentOperation
    Private CCSEventResult
 
    ' Datasource fields
    Public TotalKg
    Public Total_Pcs
    Public Reject
    Public DivTarget
    Public Dev
    Public DivArtName
    Public DivStart
    Public DivMVT
    Public Throughput_General
    Public Total_Pcs_General
    Public Total_Trade_General
    Public Give_Away_General
    Public Reject_General
    Public DoughGroup
    Public Article_Name
    Public TotalKg_General
    Public TotalProduced_General
    Public Start
    Public MVT_Slicer
    Public Dev_General
    Public Target
    Public Avg_Throughput_General
    Public Sum_Total_Pcs_General
    Public Sum_TotalKg_General
    Public Sum_TotalProduced_General
    Public Avg_MVT_Slicer
    Public Avg_Dev_General
    Public ReportLabel1
    Public ReportLabel2
    Public ReportLabel10
    Public TotalAvg_Throughput_General
    Public TotalSum_Total_Pcs_General
    Public TotalSum_TotalKg_General
    Public TotalSum_TotalProduced_General
    Public TotalAvg_MVT_Slicer
    Public TotalAvg_Dev_General
    Public ReportLabel11
'End DataSource Variables
 
'DataSource Class_Initialize Event @2-2A451814
    Private Sub Class_Initialize()
 
        Set CCSEvents = CreateObject("Scripting.Dictionary")
        Set Fields = New clsFields
        Set Recordset = New clsDataSource
        Set Recordset.DataSource = Me
        Set Errors = New clsErrors
        Set Connection = Nothing
        AllParamsSet = True
        Set TotalKg = CCCreateField("TotalKg", "TotalKg", ccsInteger, Empty, Recordset)
        Set Total_Pcs = CCCreateField("Total_Pcs", "Total_Pcs", ccsInteger, Empty, Recordset)
        Set Reject = CCCreateField("Reject", "DivReject", ccsFloat, Empty, Recordset)
        Set DivTarget = CCCreateField("DivTarget", "DivTarget", ccsText, Empty, Recordset)
        Set Dev = CCCreateField("Dev", "Dev", ccsFloat, Empty, Recordset)
        Set DivArtName = CCCreateField("DivArtName", "DivArtName", ccsText, Empty, Recordset)
        Set DivStart = CCCreateField("DivStart", "DivStart", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset)
        Set DivMVT = CCCreateField("DivMVT", "DivMVT", ccsFloat, Empty, Recordset)
        Set Throughput_General = CCCreateField("Throughput_General", "Throughput_General", ccsInteger, Empty, Recordset)
        Set Total_Pcs_General = CCCreateField("Total_Pcs_General", "Total_Pcs_General", ccsInteger, Empty, Recordset)
        Set Total_Trade_General = CCCreateField("Total_Trade_General", "Total_Trade_General", ccsInteger, Empty, Recordset)
        Set Give_Away_General = CCCreateField("Give_Away_General", "Give_Away_General", ccsFloat, Empty, Recordset)
        Set Reject_General = CCCreateField("Reject_General", "Reject_General", ccsFloat, Empty, Recordset)
        Set DoughGroup = CCCreateField("DoughGroup", "DoughGroup", ccsText, Empty, Recordset)
        Set Article_Name = CCCreateField("Article_Name", "Article Name", ccsText, Empty, Recordset)
        Set TotalKg_General = CCCreateField("TotalKg_General", "TotalKg_General", ccsInteger, Empty, Recordset)
        Set TotalProduced_General = CCCreateField("TotalProduced_General", "TotalProduced_General", ccsInteger, Empty, Recordset)
        Set Start = CCCreateField("Start", "Start", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset)
        Set MVT_Slicer = CCCreateField("MVT_Slicer", "MVT_Slicer", ccsFloat, Empty, Recordset)
        Set Dev_General = CCCreateField("Dev_General", "Dev_General", ccsFloat, Empty, Recordset)
        Set Target = CCCreateField("Target", "Target", ccsText, Empty, Recordset)
        Set Avg_Throughput_General = CCCreateField("Avg_Throughput_General", "Throughput_General", ccsInteger, Empty, Recordset)
        Set Sum_Total_Pcs_General = CCCreateField("Sum_Total_Pcs_General", "Total_Pcs_General", ccsInteger, Empty, Recordset)
        Set Sum_TotalKg_General = CCCreateField("Sum_TotalKg_General", "TotalKg_General", ccsInteger, Empty, Recordset)
        Set Sum_TotalProduced_General = CCCreateField("Sum_TotalProduced_General", "TotalProduced_General", ccsInteger, Empty, Recordset)
        Set Avg_MVT_Slicer = CCCreateField("Avg_MVT_Slicer", "MVT_Slicer", ccsFloat, Empty, Recordset)
        Set Avg_Dev_General = CCCreateField("Avg_Dev_General", "Dev_General", ccsFloat, Empty, Recordset)
        Set ReportLabel1 = CCCreateField("ReportLabel1", "Give_Away_General", ccsFloat, Empty, Recordset)
        Set ReportLabel2 = CCCreateField("ReportLabel2", "Reject_General", ccsFloat, Empty, Recordset)
        Set ReportLabel10 = CCCreateField("ReportLabel10", "Give_Away_General", ccsFloat, Empty, Recordset)
        Set TotalAvg_Throughput_General = CCCreateField("TotalAvg_Throughput_General", "Throughput_General", ccsInteger, Empty, Recordset)
        Set TotalSum_Total_Pcs_General = CCCreateField("TotalSum_Total_Pcs_General", "Total_Pcs_General", ccsInteger, Empty, Recordset)
        Set TotalSum_TotalKg_General = CCCreateField("TotalSum_TotalKg_General", "TotalKg_General", ccsInteger, Empty, Recordset)
        Set TotalSum_TotalProduced_General = CCCreateField("TotalSum_TotalProduced_General", "TotalProduced_General", ccsInteger, Empty, Recordset)
        Set TotalAvg_MVT_Slicer = CCCreateField("TotalAvg_MVT_Slicer", "MVT_Slicer", ccsFloat, Empty, Recordset)
        Set TotalAvg_Dev_General = CCCreateField("TotalAvg_Dev_General", "Dev_General", ccsFloat, Empty, Recordset)
        Set ReportLabel11 = CCCreateField("ReportLabel11", "Total_Trade_General", ccsFloat, Empty, Recordset)
        Fields.AddFields Array(TotalKg,  Total_Pcs,  Reject,  DivTarget,  Dev,  DivArtName,  DivStart, _
             DivMVT,  Throughput_General,  Total_Pcs_General,  Total_Trade_General,  Give_Away_General,  Reject_General,  DoughGroup,  Article_Name, _
             TotalKg_General,  TotalProduced_General,  Start,  MVT_Slicer,  Dev_General,  Target,  Avg_Throughput_General,  Sum_Total_Pcs_General, _
             Sum_TotalKg_General,  Sum_TotalProduced_General,  Avg_MVT_Slicer,  Avg_Dev_General,  ReportLabel1,  ReportLabel2,  ReportLabel10,  TotalAvg_Throughput_General, _
             TotalSum_Total_Pcs_General,  TotalSum_TotalKg_General,  TotalSum_TotalProduced_General,  TotalAvg_MVT_Slicer,  TotalAvg_Dev_General,  ReportLabel11)
        Set Parameters = Server.CreateObject("Scripting.Dictionary")
        Set WhereParameters = Nothing
        Orders = Array( _ 
            Array("Sorter_DoughGroup", "DoughGroup", ""), _
            Array("Sorter_Article_Name", "[Article Name]", ""), _
            Array("Sorter_Start", "Start", ""), _
            Array("Sorter_Target", "Target", ""), _
            Array("Sorter1", "Throughput_General", ""), _
            Array("Sorter2", "MVT_Slicer", ""), _
            Array("Sorter3", "Total_Pcs_General", ""), _
            Array("Sorter4", "Total_Trade_General", ""), _
            Array("Sorter5", "Give_Away_General", ""), _
            Array("Sorter6", "Reject_General", ""), _
            Array("Sorter7", "TotalKg_General", ""), _
            Array("Sorter8", "TotalProduced_General", ""), _
            Array("Sorter9", "Dev_General", ""))
 
        SQL = "Select z.*,b.[TotalKg] As TotalKg,b.[Total_Pcs],b.[Target] As DivTarget,b.[Dev],b.[Article Name]As DivArtName,b.[Start] As DivStart,b.[DivMVT],b.[Reject] As DivReject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "SELECT L.*,M.[DoughGroup] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg_General,Sum(TotalProduced)As TotalProduced_General,Start,Avg(MVT) as MVT_Slicer, " & vbLf & _
        "Avg(Dev) As Dev_General,Target As Target,Avg(Throughput) As Throughput_General,Sum(Total_Pcs) As Total_Pcs_General, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade_General,SUM((Give_Away)/1000) As Give_Away_General,Sum(Reject) As Reject_General " & vbLf & _
        "From " & vbLf & _
        " " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex2 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex2 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        "Union " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex3 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex3 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        "union " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex4 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex4 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        ")  " & vbLf & _
        "G " & vbLf & _
        "Group By G.[Article Name],G.[Target],G.[Start] " & vbLf & _
        ")L " & vbLf & _
        "INNER JOIN Slicer_DG M ON L.[Article Name] = M.[Article Name] " & vbLf & _
        ") As Z " & vbLf & _
        "Inner Join ( SELECT L.*,M.[DoughGroup] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as DivMVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade,Start, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex1 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex1 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' and  CAST(T.[Start]AS Float)  = Cast( S.[Start] As Float) " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        ")L " & vbLf & _
        "INNER JOIN Divider_DG M ON L.[Article Name] = M.[Article Name] " & vbLf & _
        ") As b " & vbLf & _
        "on z.[DoughGroup] = b.[DoughGroup] " & vbLf & _
        "Where z.[Start] > b.[Start] and  datediff(hh,b.[Start],z.[Start]) < = 4.5 AND datediff(hh,b.[Start],z.[Start]) > 2.5 " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        ""
        CountSQL = "SELECT COUNT(*) FROM (Select z.*,b.[TotalKg] As TotalKg,b.[Total_Pcs],b.[Target] As DivTarget,b.[Dev],b.[Article Name]As DivArtName,b.[Start] As DivStart,b.[DivMVT],b.[Reject] As DivReject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "SELECT L.*,M.[DoughGroup] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg_General,Sum(TotalProduced)As TotalProduced_General,Start,Avg(MVT) as MVT_Slicer, " & vbLf & _
        "Avg(Dev) As Dev_General,Target As Target,Avg(Throughput) As Throughput_General,Sum(Total_Pcs) As Total_Pcs_General, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade_General,SUM((Give_Away)/1000) As Give_Away_General,Sum(Reject) As Reject_General " & vbLf & _
        "From " & vbLf & _
        " " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex2 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex2 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        "Union " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex3 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex3 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        "union " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as MVT, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex4 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex4 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        ")  " & vbLf & _
        "G " & vbLf & _
        "Group By G.[Article Name],G.[Target],G.[Start] " & vbLf & _
        ")L " & vbLf & _
        "INNER JOIN Slicer_DG M ON L.[Article Name] = M.[Article Name] " & vbLf & _
        ") As Z " & vbLf & _
        "Inner Join ( SELECT L.*,M.[DoughGroup] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],Sum(TotalKg)As TotalKg,Sum(TotalProduced)As TotalProduced,Avg(Cast(Substring([Mean value trade],1,charindex(' ',[Mean value trade]))As Float)) as DivMVT, " & vbLf & _
        "Avg(Dev) As Dev,Target As Target,Avg(Throughput) As Throughput,Sum(Total_Pcs) As Total_Pcs, " & vbLf & _
        "Sum(Total_Trade) As Total_Trade,Start, " & vbLf & _
        "sum(((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))-Cast(substring([Target],1,Charindex(' ',[Target]))as Float))* [Total_Trade]) As Give_Away, " & vbLf & _
        "sum((((Cast(substring([Mean value trade],1,charindex(' ',[Mean value trade])) as Float))*([Total_Pcs]-[Total_Trade])))/1000) As Reject " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "select T.*,S.[Mean value trade] " & vbLf & _
        "From " & vbLf & _
        "( " & vbLf & _
        "Select [Article Name],max(Duration)AS Duration,Start, " & vbLf & _
        "MAX(CAST(substring(substring([Trade], 1, charindex('kg', [Trade])-1),charindex(' ', [Trade]),12)As Integer)) As TotalKg , " & vbLf & _
        "MAX(CAST(substring(substring([Total], 1, charindex('kg', [Total])-1),charindex(' ', [Total]),12)As Integer)) As TotalProduced, " & vbLf & _
        "Avg(Cast(Substring([S total],1,charindex(' ',[S total]))As Float)) As Dev, " & vbLf & _
        "Target,avg(cast(substring([Throughput], 1, charindex(' ',[Throughput])) as Integer)) as Throughput, " & vbLf & _
        "MAX(CAST(substring([Total],1,charindex(' ',[Total])) as Integer)) As Total_Pcs, " & vbLf & _
        "MAX(CAST(substring([Trade],1,charindex(' ',[Trade])) as Integer)) As Total_Trade " & vbLf & _
        "From statex1 " & vbLf & _
        "Where  Start > '{s_Start_Start}'  and Start < '{s_Start_Stop}'  " & vbLf & _
        "Group By [Article Name],Target,Start " & vbLf & _
        ") T " & vbLf & _
        "INNER JOIN statex1 S ON T.[Article Name]= S.[Article Name] and  " & vbLf & _
        "T.Duration=S.Duration and T.[Start] > '{s_Start_Start}'  and T.[Start] < '{s_Start_Stop}' and  CAST(T.[Start]AS Float)  = Cast( S.[Start] As Float) " & vbLf & _
        " " & vbLf & _
        ")  " & vbLf & _
        "B " & vbLf & _
        "Group By B.[Article Name],B.[Target],B.[Start] " & vbLf & _
        ")L " & vbLf & _
        "INNER JOIN Divider_DG M ON L.[Article Name] = M.[Article Name] " & vbLf & _
        ") As b " & vbLf & _
        "on z.[DoughGroup] = b.[DoughGroup] " & vbLf & _
        "Where z.[Start] > b.[Start] and  datediff(hh,b.[Start],z.[Start]) < = 4.5 AND datediff(hh,b.[Start],z.[Start]) > 2.5 " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        " " & vbLf & _
        ") cnt"
        Where = ""
        Order = ""
        StaticOrder = "TotalKg asc,Total_Pcs asc,DivTarget asc,Dev asc,DivArtName asc,DivStart asc,DivMVT asc"
    End Sub
'End DataSource Class_Initialize Event
 
'SetOrder Method @2-68FC9576
    Sub SetOrder(Column, Direction)
        Order = Recordset.GetOrder(Order, Column, Direction, Orders)
    End Sub
'End SetOrder Method
 
'BuildTableWhere Method @2-E74D5FE4
    Public Sub BuildTableWhere()
        If Not WhereParameters Is Nothing Then _
            Exit Sub
        Set WhereParameters = new clsSQLParameters
        With WhereParameters
            Set .Connection = Connection
            Set .ParameterSources = Parameters
            Set .DataSource = Me
            .AddParameter "s_Start_Start", "urls_Start_Start", ccsText, Empty, Empty, Empty, False
            .AddParameter "s_Start_Stop", "urls_Start_Stop", ccsText, Empty, Empty, Empty, False
        End With
    End Sub
'End BuildTableWhere Method
 
'Open Method @2-486FAD2E
    Function Open(Cmd)
        Errors.Clear
        If Connection Is Nothing Then
            Set Open = New clsEmptyDataSource
            Exit Function
        End If
        Set Cmd.Connection = Connection
        Cmd.CommandOperation = cmdOpen
        Cmd.PageSize = PageSize
        Cmd.ActivePage = AbsolutePage
        Cmd.CommandType = dsSQL
        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me)
        Cmd.SQL = SQL
        Cmd.CountSQL =IIF(CountSQL <> "",  CountSQL, Empty)
        BuildTableWhere
        Set Cmd.WhereParameters = WhereParameters
        Cmd.Where = Where
        Cmd.OrderBy = Order
        If(Len(StaticOrder)>0) Then
            If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy
            Cmd.OrderBy = StaticOrder + Cmd.OrderBy
        End If
        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me)
        If Errors.Count = 0 And CCSEventResult Then _
            Set Recordset = Cmd.Exec(Errors)
        CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me)
        Set Recordset.FieldsCollection = Fields
        Set Open = Recordset
    End Function
'End Open Method
 
'DataSource Class_Terminate Event @2-41B4B08D
    Private Sub Class_Terminate()
        If Recordset.State = adStateOpen Then _
            Recordset.Close
        Set Recordset = Nothing
        Set Parameters = Nothing
        Set Errors = Nothing
    End Sub
'End DataSource Class_Terminate Event
 
End Class 'End Report1DataSource Class @2-A61BA892
 
 
%>
 
 
 
and the events page is this:
 
 
<%
'BindEvents Method @1-DA32375F
Sub BindEvents(Level)
    If Level="Page" Then
    Else
        Set Report1.DevColor.CCSEvents("BeforeShow") = GetRef("Report1_Dev_Header_DevColor_BeforeShow")
        Set Report1.Dev.CCSEvents("BeforeShow") = GetRef("Report1_Dev_Header_Dev_BeforeShow")
        Set Report1.Link2.CCSEvents("BeforeShow") = GetRef("Report1_Dev_Header_Link2_BeforeShow")
        Set Report1.Target.CCSEvents("BeforeShow") = GetRef("Report1_Detail_Target_BeforeShow")
        Set Report1.ReportLabel4.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel4_BeforeShow")
        Set Report1.ReportLabel5.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel5_BeforeShow")
        Set Report1.ReportLabel3.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel3_BeforeShow")
        Set Report1.ReportLabel8.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel8_BeforeShow")
        Set Report1.ReportLabel6.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel6_BeforeShow")
        Set Report1.ReportLabel7.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel7_BeforeShow")
        Set Report1.ReportLabel9.CCSEvents("BeforeShow") = GetRef("Report1_Detail_ReportLabel9_BeforeShow")
        Set Report1.Link1.CCSEvents("BeforeShow") = GetRef("Report1_Detail_Link1_BeforeShow")
        Set Report1.Navigator.CCSEvents("BeforeShow") = GetRef("Report1_Page_Footer_Navigator_BeforeShow")
        Set Report1.CCSEvents("BeforeShow") = GetRef("Report1_BeforeShow")
        Set Report1.DataSource.CCSEvents("AfterExecuteSelect") = GetRef("Report1_DataSource_AfterExecuteSelect")
        Set Report_Print.CCSEvents("BeforeShow") = GetRef("Report_Print_BeforeShow")
    End If
End Sub
'End BindEvents Method
Dim iFirstgap
Function Report1_Dev_Header_DevColor_BeforeShow(Sender) 'Report1_Dev_Header_DevColor_BeforeShow @160-863A7C71
 
'Custom Code @161-73254650
' -------------------------
Report1.DevColor.Value = Report1.Dev.Value
iFirstgap = InStr(Report1.DevColor.Text, ".")
Report1.DevColor.Text = Left(Report1.DevColor.Text,iFirstgap + 2 )
 
   If Report1.Dev.Value < 10 Then 
      Report1.DevColor.Value = "<font color=GREEN>"&Report1.DevColor.Value&"</font>"
	  
   Elseif Report1.Dev.Value > 10 AND Report1.Dev.Value < 14 Then 
      Report1.DevColor.Value = "<font color=YELLOW>"&Report1.DevColor.Value&"</font>"
	  
   Elseif Report1.Dev.Value > 14 Then
      Report1.DevColor.Value = "<font color=RED>"&Report1.DevColor.Value&"</font>"
	  
   End if 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Dev_Header_DevColor_BeforeShow @160-54C34B28
 
Function Report1_Dev_Header_Dev_BeforeShow(Sender) 'Report1_Dev_Header_Dev_BeforeShow @37-1D8EA7BB
 
'Custom Code @162-73254650
' -------------------------
Report1.Dev.Visible = False
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Dev_Header_Dev_BeforeShow @37-54C34B28
 
Function Report1_Dev_Header_Link2_BeforeShow(Sender) 'Report1_Dev_Header_Link2_BeforeShow @163-B8E10E75
 
'Custom Code @165-73254650
' -------------------------
 
 
If Report1.Dev.Value < 10 Then
Report1.Link2.Visible = False
Elseif Report1.Dev.Value > 10 Then
Report1.Link2.Visible = True
End If
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Dev_Header_Link2_BeforeShow @163-54C34B28
 
Function Report1_Detail_Target_BeforeShow(Sender) 'Report1_Detail_Target_BeforeShow @119-5866B12E
 
'Custom Code @140-73254650
' -------------------------
' Write your own code here.
' -------------------------
'End Custom Code
 
 
 
End Function 'Close Report1_Detail_Target_BeforeShow @119-54C34B28
 
Dim igap
Function Report1_Detail_ReportLabel4_BeforeShow(Sender) 'Report1_Detail_ReportLabel4_BeforeShow @133-A238426F
 
'Custom Code @134-73254650
' -------------------------
 
igap = InStr(Report1.Target.Text," ")
Report1.ReportLabel4.Value = Left(Report1.Target.Text,igap-1)
Report1.ReportLabel4.Visible = False
 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel4_BeforeShow @133-54C34B28
 
Function Report1_Detail_ReportLabel5_BeforeShow(Sender) 'Report1_Detail_ReportLabel5_BeforeShow @136-C75F7929
 
'Custom Code @137-73254650
' -------------------------
 If Report1.ReportLabel4.Value <> 0 Then 
  If  Report1.Dev_General.Value/Report1.ReportLabel4.Value < 0.0227  Then
  Report1.ReportLabel5.Value = Report1.ReportLabel4.Value + 0.89*Report1.Dev_General.Value + Report1.ReportLabel3.Value 
 ElseIf  Report1.Dev_General.Value/Report1.ReportLabel4.Value > 0.0227 Then
   Report1.ReportLabel5.Value  =Report1.ReportLabel4.Value*0.95 +3.09*Report1.Dev_General.Value + Report1.ReportLabel3.Value
  End If
   End If
Report1.ReportLabel5.Visible = fALSE
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel5_BeforeShow @136-54C34B28
 
Function Report1_Detail_ReportLabel3_BeforeShow(Sender) 'Report1_Detail_ReportLabel3_BeforeShow @138-437CE4FC
 
'Custom Code @139-73254650
' -------------------------
Report1.ReportLabel3.Value = Report1.DivMVT.Value - Report1.MVT_Slicer.Value
Report1.ReportLabel3.Visible  = False
 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel3_BeforeShow @138-54C34B28
 
Function Report1_Detail_ReportLabel8_BeforeShow(Sender) 'Report1_Detail_ReportLabel8_BeforeShow @144-710E7F84
 
'Custom Code @145-73254650
' -------------------------
Report1.ReportLabel8.Value = Report1.ReportLabel5.Value + Report1.ReportLabel3.Value
Report1.ReportLabel8.Visible =False
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel8_BeforeShow @144-54C34B28
 
Function Report1_Detail_ReportLabel6_BeforeShow(Sender) 'Report1_Detail_ReportLabel6_BeforeShow @146-68F634E3
 
'Custom Code @147-73254650
' -------------------------
Report1.ReportLabel6.Value = Report1.ReportLabel8.Value
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel6_BeforeShow @146-54C34B28
 
Function Report1_Detail_ReportLabel7_BeforeShow(Sender) 'Report1_Detail_ReportLabel7_BeforeShow @150-0D910FA5
 
'Custom Code @151-73254650
' -------------------------
If Report1.DivMVT.Value <> 0 Then 
Report1.ReportLabel7.Value = (Report1.ReportLabel3.Value/Report1.DivMVT.Value)* 100
End If 
Report1.ReportLabel7.Visible = False 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel7_BeforeShow @150-54C34B28
 
Function Report1_Detail_ReportLabel9_BeforeShow(Sender) 'Report1_Detail_ReportLabel9_BeforeShow @152-146944C2
 
'Custom Code @153-73254650
' -------------------------
Report1.ReportLabel9.Value  = Report1.ReportLabel7.Value 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_Detail_ReportLabel9_BeforeShow @152-54C34B28
 
Function Report1_Detail_Link1_BeforeShow(Sender) 'Report1_Detail_Link1_BeforeShow @158-010DB02C
 
'Custom Code @166-73254650
' -------------------------
If Report1.Dev_General.Value < 10 Then
Report1.Link1.Visible = False
Elseif Report1.Dev_General.Value > 10 Then
Report1.Link1.Visible = True
End If
 
'-----------------
'End Custom Code
 
End Function 'Close Report1_Detail_Link1_BeforeShow @158-54C34B28
Dim sum
 
 
Function Report1_Page_Footer_Navigator_BeforeShow(Sender) 'Report1_Page_Footer_Navigator_BeforeShow @85-0AA8A152
 
'Hide-Show Component @86-BD91C107
    Dim TotalPages_86_1 : TotalPages_86_1 = CCSConverter.VBSConvert(ccsInteger, Report1.DataSource.Recordset.PageCount)
    Dim Param2_86_2 : Param2_86_2 = CCSConverter.VBSConvert(ccsInteger, 2)
    If  (Not IsEmpty(TotalPages_86_1) And Not IsEmpty(Param2_86_2) And TotalPages_86_1 < Param2_86_2) Then _
        Report1.Navigator.Visible = False
'End Hide-Show Component
 
End Function 'Close Report1_Page_Footer_Navigator_BeforeShow @85-54C34B28
 
Function Report1_BeforeShow(Sender) 'Report1_BeforeShow @2-77350BDA
 
'Custom Code @159-73254650
' -------------------------
 
' -------------------------
'End Custom Code
 
End Function 'Close Report1_BeforeShow @2-54C34B28
 
Function Report1_DataSource_AfterExecuteSelect(Sender) 'Report1_DataSource_AfterExecuteSelect @2-1B6BAA7E
 
'Custom Code @164-73254650
' -------------------------
If Report1.Dev_General.Value < 10 Then
Report1.Link1.Visible = False
Elseif Report1.Dev_General.Value > 10 Then
Report1.Link1.Visible = True
End If
 
If Report1.Dev.Value < 10 Then
Report1.Link2.Visible = False
Elseif Report1.Dev.Value > 10 Then
Report1.Link2.Visible = True
End If
' -------------------------
'End Custom Code
 
End Function 'Close Report1_DataSource_AfterExecuteSelect @2-54C34B28
 
Function Report_Print_BeforeShow(Sender) 'Report_Print_BeforeShow @3-D2FE8D6A
 
'Hide-Show Component @5-568D7866
    Dim ViewMode_5_1 : ViewMode_5_1 = CCSConverter.VBSConvert(ccsText, CCGetFromGet("ViewMode", Empty))
    Dim Param2_5_2 : Param2_5_2 = CCSConverter.VBSConvert(ccsText, "Print")
    If (IsEmpty(ViewMode_5_1) And IsEmpty(Param2_5_2)) Or  (Not IsEmpty(ViewMode_5_1) And Not IsEmpty(Param2_5_2) And ViewMode_5_1 = Param2_5_2) Then _
        Report_Print.Visible = False
'End Hide-Show Component
 
End Function 'Close Report_Print_BeforeShow @3-54C34B28
 
 
%>

Open in new window

0
 

Author Comment

by:Latzi_Marian
ID: 21819829
The whole project is fairly complex however the problem is very simple.
I can't run a certain query (which otherwise runs fine on Query Analyzer ) with a large amount of data.Very large amount.Obviously to produce the recordset there is need for more time but where on the earth I can increase this time I don't know.As I said no matter how big the amount of data is the query runs just fine on Query Analyzer but from a ASP page it times out.Therefore probably the SQL server is ok the code is ok so it has to be either on IIS or ASP itself as there is nothing else involved in this whole business.
Just give me any ideeas please.It seems for the moment I just run out of all ideeas.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21820146
please add this line:
Cmd.CommandTimeout = 0

after this one:
Cmd.CommandType = dsSQL
0
 
LVL 2

Expert Comment

by:schalcraft
ID: 21821969
Have you considered a scheduled task to generate the sql output and then serve up the output as raw html?  I had a similar issue with a web site, and as the infrastructure was being pushed to the limit, the results where very intermittent.
Eventually I worked out that quite afew users where looking at the same report, but none of it actually required "up to the last minute" data. I wrote a script that ran the sql query overnight (using osql) and formatted the output into html.  
If youre report parameters are fairly static, then this is a possible solution. The other benefit is that overall load is significantly reduced.
0
 

Author Comment

by:Latzi_Marian
ID: 21827130
Hi angell

I've tried to do what you saifd and I have this error this time.
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the maintsrv home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Cmd.CommandTimeOut'
/GF_Data_Reporting/DoughGroup_Report.asp, line 2061


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)

Page:
GET /GF_Data_Reporting/DoughGroup_Report.asp

Time:
Friday, June 20, 2008, 8:20:45 AM


More information:
Microsoft Support
 
So I cannot use CommandTimeout as Object doesn't support this property or method: 'Cmd.CommandTimeOut'.
Any other ideeas?
0
 

Author Comment

by:Latzi_Marian
ID: 21827812
Hi schalcraft,

In my case the users normally need the up to date data.Probably 99% of the time they do that to see how the production is going in realtime.However the same code is used to produce report for any period of time .And in my case if they use a large amount of data (like 2-3 months worth) than I have the problem.However if I run the very same query in SQL everything is fine.All it happens is the time increases for the query to execute as the data volume increases.Which is normal.I think the problem is in either IIS or in my ASP.But not the query part of asp as that works fine (proved by Query Analyzer).I've tried to do what angellll said but the method is not supported.So I am stuck.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21829015
could you send me a backup of the database?
so I could test the query and see what could be done to make the query quicker?
0
 

Author Comment

by:Latzi_Marian
ID: 21829489
Sorry angellll The query runs actually under 3 seconds.I explain.I did connect with Query Analyzer to the database located on another computer through the network.Also the laptop I am doing development with is due to a format windows has got a few problems.When I run the querry from Query Analyzer on the actual server it served the data under 3 seconds which I think Is terrific if you see the amount of data being handled.
So I am absolutely sure is nothing wrong with the query.Second I don't undesrtand why I get this??
Technical Information (for support personnel)

Error Type:
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Cmd.CommandTimeOut'
/GF_Data_Reporting/DoughGroup_Report.asp, line 2061
 If you still need the backup after this info I am extremely happy to send it to you just let me know.Thanx
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21829536
>Object doesn't support this property or method: 'Cmd.CommandTimeOut'
that "simply" means that the object does not have that property. as I said, I assumed you where working with .net (ie ado), where this property does exist...
0
 

Author Comment

by:Latzi_Marian
ID: 21829645
No no.This is just asp. So what I am going to do now? I still can't think of anything.Any other Ideeas?
0
 

Author Comment

by:Latzi_Marian
ID: 21829659
I am doing the backup right now and I'l send it to you if it is not too big.We'll see the size in a few minutes
0
 

Author Comment

by:Latzi_Marian
ID: 21829662
221 MB.Impossible to send.However the query runs in 2.8 seconds.
0
 

Author Comment

by:Latzi_Marian
ID: 21829766
For me to convert theb whole project (which is massive) to asp.net would take at least 1 month.I am afraid that not is an option right now.I've made a mistake when I started as I thought I am more familiar with ASP than with ASP.NET but it was a mistake maybe.However the whole project runs perfectly and everybody is happy about it.Except this problem with the timeout.Please just give me some ideeas I will follow every avenue through.
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 21830497
if it's ASP, what is the cmd object's type?
0
 

Author Comment

by:Latzi_Marian
ID: 21830788
 Set Command = CreateObject("ADODB.Command")
   
    Command.CommandType = adCmdText
    Command.CommandText = sSQL
    Set Command.ActiveConnection = Connection.Connection
    Set Recordset = Connection.Execute(Command)

This is what I have in the Classes.asp within one function.So I suppose is a ADODB
0
 

Author Comment

by:Latzi_Marian
ID: 21830858
And I added :"Command.CommandTimeOut = 180" and IT FINALLY WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Set Command = CreateObject("ADODB.Command")
   Command.CommandTimeOut = 180
   
    Command.CommandType = adCmdText
    Command.CommandText = sSQL
    Set Command.ActiveConnection = Connection.Connection
    Set Recordset = Connection.Execute(Comman
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21830871
and you wanted to give up hope, already :)
0
 

Author Comment

by:Latzi_Marian
ID: 21830882
Why it takes a very log time in Explorer is probably due to the Command object which is used for executing process against Data store.Something is wrong within  that Command object.I wouldn't mind to understand the "subatomic" structure of that Object.However for the purpose of my exercise problem solved.Thank you.You pointed me to the right direction with your last question.Everything became clear.
0
 

Author Closing Comment

by:Latzi_Marian
ID: 31468660
Thank you again for your time.By the way I never give up ! I just have short ups and downs.Luck I have extremely valuable help from people like you.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21830980
what is the connection string for the adodb.connection object?
0
 

Author Comment

by:Latzi_Marian
ID: 21831136
  That's the one :

ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CheckWeighers;Data Source=(local)"
        User = ""
        Password = ""
        Set Converter = New clsConverter
        Converter.DateFormat = Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss")
        Converter.BooleanFormat = Array(1, 0, Empty)
        Set objConnection = Server.CreateObject("ADODB.Connection")

It's working perfectly I am very happy with it.Things are starting to get a bit fuzzy for me as it is midnight around here.But I can definitely see that it's working.
Maybe tomorrow I will try to "discover" what's the story behind the delay.It takes 2-3 seconds in SQL and 4 minutes through asp .
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21831164
can you check which network protocols are enabled?

please try to add this to the connection string:
Network Library=DBMSSOCN;

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 21831170
and to remove the .1 from sqloledb...
ConnectionString = "Provider=SQLOLEDB;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CheckWeighers;Network Library=DBMSSOCN;Data Source=(local)"

Open in new window

0
 

Author Comment

by:Latzi_Marian
ID: 21831253
TCP/IP and Named pipes.I don't know which one of these is the default.I also tried to add up to the connection string what you've sent me Network Library=DBMSSOCN; and it lowered the execution time from 4 min 22 sec to 3 min 50.I won't be able to understand why is this right now as I am pertty much half asleep.But I'm sure I'll dream about named pipes and stuff.I'll check first time in the morning.Thanx again and look forward to continue the very interesting topic tomorrow if you will have time of course.Thanx.
0
 

Author Comment

by:Latzi_Marian
ID: 21831266
I will try the other one when I'm back Network Library=dbnmpntw".Just to test.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

695 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