Public Class Report_그래프

#Region "data Base 변경여부및 적용방법"

    '''변경된내용을적용한다.
    Public Overrides Function AcceptChanged() As Boolean

        Return True
    End Function

    '''변경된내용이있다면 취소한다.
    Public Overrides Function RejectChanged() As Boolean

        Return True
    End Function

    '''데이터에변형이있었는가?
    Public Overrides Function HasChanged() As Boolean
        Return False
    End Function

#End Region

    Dim 단위면적당신재생1차에너지합 As Decimal = 0
    Dim 단위면적당신재생1차에너지합offsite As Decimal = 0

    Dim 단위면적당1차에너소비량합 As Decimal = 0
    Dim 에너지자립률 As Double = 0
    Dim 에너지자립률offsite As Double = 0

    Private Sub Frm_v20091231_Result_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.DSR.TReqUse.Merge(DSETR1.TReqUse)
        MakeGraphTable()

        Dim 건물용도 As Integer = CInt(DSET1.tbl_Desc.Rows(0)("isjugo"))
        Dim 주거형태 As String = ""
        If 건물용도 < 10 Then
            주거형태 = "주거"
        Else
            주거형태 = "비주거"
        End If

        Dim params As New Microsoft.Reporting.WinForms.ReportParameterCollection()
        Dim param As New Microsoft.Reporting.WinForms.ReportParameter("ISJUGO", 주거형태)
        params.Add(param)

        Dim bcustomstr As String = "0"
        If Prj.UserAuthType_Real.StartsWith("BOTH_C") Then bcustomstr = "1"
        Dim param0 As New Microsoft.Reporting.WinForms.ReportParameter("bcustomprofile", bcustomstr)
        params.Add(param0)

        Dim param1 As New Microsoft.Reporting.WinForms.ReportParameter("자립률", 에너지자립률.ToString("N2"))
        params.Add(param1)



        Dim param2 As New Microsoft.Reporting.WinForms.ReportParameter("생산량", 단위면적당신재생1차에너지합.ToString("N1"))
        params.Add(param2)

        Dim param3 As New Microsoft.Reporting.WinForms.ReportParameter("소비량", 단위면적당1차에너소비량합.ToString("N1"))
        params.Add(param3)

        '//210702
        Dim param4 As New Microsoft.Reporting.WinForms.ReportParameter("자립률offsite", 에너지자립률offsite.ToString("N2"))
        params.Add(param4)
        Dim param5 As New Microsoft.Reporting.WinForms.ReportParameter("생산량offsite", 단위면적당신재생1차에너지합offsite.ToString("N1"))
        params.Add(param5)


        Me.ReportViewer1.LocalReport.SetParameters(params)

        Me.ReportViewer1.ZoomMode = Microsoft.Reporting.WinForms.ZoomMode.Percent
        Me.ReportViewer1.PageCountMode = Microsoft.Reporting.WinForms.PageCountMode.Actual
        Me.ReportViewer1.ZoomPercent = 100
        Me.ReportViewer1.RefreshReport()
    End Sub
    Private Sub MakeGraphTable()
        If DSR.TReqUse.Rows.Count < 1 Then Return



        Dim Dr As DSR.Graph_ReqRow
        For Gubun As Short = 0 To 1
            For mon As Short = 1 To 12
                If Gubun = 0 Then   '//6번
                    Dr = Me.DSR.Graph_Req.NewGraph_ReqRow
                    Dr.Gubun = "난방에너지요구량"
                    Dr.Mon = Format(mon, "0") & "월"
                    Dr.Req = Math.Round(Result1.E요구량(mon).난방면적, 1)
                    Me.DSR.Graph_Req.Rows.Add(Dr)
                Else    '//11번
                    Dr = Me.DSR.Graph_Req.NewGraph_ReqRow
                    Dr.Gubun = "냉방에너지요구량"
                    Dr.Mon = Format(mon, "0") & "월"
                    Dr.Req = Math.Round(Result1.E요구량(mon).냉방면적, 1)
                    Me.DSR.Graph_Req.Rows.Add(Dr)
                End If
            Next
        Next

        '//연간에너지요구량및소요량
        '//Graph_requse gubun,type,
        '1차에너지소요량	에너지소요량	에너지요구량	
        '신재생에너지(-57)
        '난방에너지	106	91.87445415	56.14013248	
        '냉방에너지	155.3678094	119.8832527	40.83005443	
        '급탕에너지	42.6421498	14.21404993	14.6	
        '조명에너지	144.2220948	48.07403159	73.08380082	
        '환기에너지	61.68818331	20.56272777		

        Dim 신재생에너지 As Decimal
        Dim 난방에너지 As Decimal
        Dim 냉방에너지 As Decimal
        Dim 급탕에너지 As Decimal
        Dim 조명에너지 As Decimal
        Dim 환기에너지 As Decimal
        'Dim 합계 As Decimal





        Dim Dr2 As DSR.Graph_ReqUseRow
        For Gubun As Short = 0 To 4
            Select Case Gubun
                Case 0  '//1차에너지소요량


                    Dim Sum As Decimal = (Result1.생산E(0).태양광전력생산량 + Result1.생산E(0).풍력전력생산량 + Result1.생산E(0).신재생열병합전력생산량) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력)

                    Dim Sum_offsite As Decimal = (Result1.생산E(0).태양광전력생산량_offsite + Result1.생산E(0).풍력전력생산량_offsite + Result1.생산E(0).연료전지전력생산량_offsite) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력)

                    Dim 난방 As Decimal = Sum * Result1.일차E소요량(0).난방전력  '//아마게산이안도잇으니 여기값들이 0이잇을거에요.
                    Dim 냉방 As Decimal = Sum * Result1.일차E소요량(0).냉방전력
                    Dim 조명 As Decimal = Sum * Result1.일차E소요량(0).조명전력
                    Dim 급탕 As Decimal = Sum * Result1.일차E소요량(0).급탕전력
                    Dim 환기 As Decimal = Sum * Result1.일차E소요량(0).환기전력

                    Dim 난방_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).난방전력  '//아마게산이안도잇으니 여기값들이 0이잇을거에요.
                    Dim 냉방_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).냉방전력
                    Dim 조명_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).조명전력
                    Dim 급탕_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).급탕전력
                    Dim 환기_offsite As Decimal = Sum_offsite * Result1.일차E소요량(0).환기전력


                    Dim 난방면적 As Decimal = 0
                    Dim 냉방면적 As Decimal = 0
                    Dim 조명면적 As Decimal = 0
                    Dim 급탕면적 As Decimal = 0
                    Dim 환기면적 As Decimal = 0

                    Dim 난방면적_offsite As Decimal = 0
                    Dim 냉방면적_offsite As Decimal = 0
                    Dim 조명면적_offsite As Decimal = 0
                    Dim 급탕면적_offsite As Decimal = 0
                    Dim 환기면적_offsite As Decimal = 0

                    If Result1.사용면적.H <> 0 Then
                        난방면적 = TOSG(IIf(난방 = 0, 0, 난방 / Result1.사용면적.H))
                    End If
                    If Result1.사용면적.C <> 0 Then
                        냉방면적 = TOSG(IIf(냉방 = 0, 0, 냉방 / Result1.사용면적.C))
                    End If
                    If Result1.사용면적.L <> 0 Then
                        조명면적 = TOSG(IIf(조명 = 0, 0, 조명 / Result1.사용면적.L))
                    End If
                    If Result1.사용면적.W <> 0 Then
                        급탕면적 = TOSG(IIf(급탕 = 0, 0, 급탕 / Result1.사용면적.W))
                    End If
                    If Result1.사용면적.V <> 0 Then
                        환기면적 = TOSG(IIf(환기 = 0, 0, 환기 / Result1.사용면적.V))
                    End If

                    If Result1.사용면적.H <> 0 Then
                        난방면적_offsite = TOSG(IIf(난방_offsite = 0, 0, 난방_offsite / Result1.사용면적.H))
                    End If
                    If Result1.사용면적.C <> 0 Then
                        냉방면적_offsite = TOSG(IIf(냉방_offsite = 0, 0, 냉방_offsite / Result1.사용면적.C))
                    End If
                    If Result1.사용면적.L <> 0 Then
                        조명면적_offsite = TOSG(IIf(조명_offsite = 0, 0, 조명_offsite / Result1.사용면적.L))
                    End If
                    If Result1.사용면적.W <> 0 Then
                        급탕면적_offsite = TOSG(IIf(급탕_offsite = 0, 0, 급탕_offsite / Result1.사용면적.W))
                    End If
                    If Result1.사용면적.V <> 0 Then
                        환기면적_offsite = TOSG(IIf(환기_offsite = 0, 0, 환기_offsite / Result1.사용면적.V))
                    End If



                    Dim 전기 As Decimal = 난방면적 + 냉방면적 + 조명면적 + 급탕면적 + 환기면적 '+ Result1.생산E(0).태양광전력생산량_offsite + Result1.생산E(0).연료전지전력생산량_offsite
                    Dim 전기_offsite As Decimal = 난방면적_offsite + 냉방면적_offsite + 조명면적_offsite + 급탕면적_offsite + 환기면적_offsite ' + Result1.생산E(0).태양광전력생산량_offsite + Result1.생산E(0).연료전지전력생산량_offsite


                    '//열병합신재생에너지추가 130831 arin
                    신재생에너지 = Math.Round(-1 * (Result1.생산E(0).면적당생산량태양열 + Result1.생산E(0).신재생면적당열생산량 + Result1.생산E(0).면적당생산량지열 + Result1.생산E(0).면적당생산량수열 + 전기 * 2.75), 1)
                    Dim 신재생에너지_offsite As Decimal = Math.Round(-1 * (전기_offsite * 2.75), 1)

                    단위면적당신재생1차에너지합 = -1 * 신재생에너지
                    단위면적당신재생1차에너지합offsite = -1 * 신재생에너지_offsite


                    ' 신재생에너지 = -1 * (합_열 + 합_전기 * 2.75) ' ' Result1.생산E(0).태양광전력생산량 * 2.75)

                    ' Dim Sum As Decimal = (Result1.생산E(0).태양광전력생산량 * 2.75 + Result1.생산E(0).신재생열병합전력생산량 * 2.75) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력)


                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "신재생에너지"
                    Dr2.Req = 신재생에너지 + 신재생에너지_offsite
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    난방에너지 = Math.Round(Result1.일차E소요량(0).난방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "난방에너지"
                    Dr2.Req = 난방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    냉방에너지 = Math.Round(Result1.일차E소요량(0).냉방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "냉방에너지"
                    Dr2.Req = 냉방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    급탕에너지 = Math.Round(Result1.일차E소요량(0).급탕면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "급탕에너지"
                    Dr2.Req = 급탕에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    조명에너지 = Math.Round(Result1.일차E소요량(0).조명면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "조명에너지"
                    Dr2.Req = 조명에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H92*3/계산결과!H27
                    환기에너지 = Math.Round(Result1.일차E소요량(0).환기면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "환기에너지"
                    Dr2.Req = 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "1차소요량"
                    Dr2.type = "합계"
                    Dr2.Req = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    단위면적당1차에너소비량합 = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지 + Math.Round(단위면적당신재생1차에너지합, 1)

                    단위면적당1차에너소비량합 += -신재생에너지_offsite


                    If 단위면적당1차에너소비량합 <> 0 Then

                        에너지자립률 = (Math.Round(단위면적당신재생1차에너지합, 1) / 단위면적당1차에너소비량합) * 100

                        Dim scale As Decimal = 0
                        If Pub.Importsameaddress Then
                            scale = 1.0
                        Else
                            If 에너지자립률 >= 20 Then
                                scale = 1.0
                            ElseIf 에너지자립률 >= 15 Then
                                scale = 0.9
                            ElseIf 에너지자립률 >= 10 Then
                                scale = 0.8
                            Else
                                scale = 0.7
                            End If
                        End If


                        에너지자립률offsite = (Math.Round(단위면적당신재생1차에너지합offsite * scale, 1) / 단위면적당1차에너소비량합) * 100
                        에너지자립률 += 에너지자립률offsite

                    Else
                        에너지자립률 = 0
                        에너지자립률offsite = 0
                    End If

                Case 1  '//에너지소요량



                    Dim Sum As Decimal = (Result1.생산E(0).태양광전력생산량 + Result1.생산E(0).풍력전력생산량 + Result1.생산E(0).신재생열병합전력생산량 + Result1.생산E(0).연료전지전력생산량_offsite + +Result1.생산E(0).태양광전력생산량_offsite + Result1.생산E(0).풍력전력생산량_offsite) / (Result1.일차E소요량(0).난방전력 + Result1.일차E소요량(0).냉방전력 + Result1.일차E소요량(0).급탕전력 + Result1.일차E소요량(0).조명전력 + Result1.일차E소요량(0).환기전력)

                    Dim 난방 As Decimal = Sum * Result1.일차E소요량(0).난방전력  '//아마게산이안도잇으니 여기값들이 0이잇을거에요.
                    Dim 냉방 As Decimal = Sum * Result1.일차E소요량(0).냉방전력
                    Dim 조명 As Decimal = Sum * Result1.일차E소요량(0).조명전력
                    Dim 급탕 As Decimal = Sum * Result1.일차E소요량(0).급탕전력
                    Dim 환기 As Decimal = Sum * Result1.일차E소요량(0).환기전력



                    Dim 난방면적 As Decimal = 0
                    Dim 냉방면적 As Decimal = 0
                    Dim 조명면적 As Decimal = 0
                    Dim 급탕면적 As Decimal = 0
                    Dim 환기면적 As Decimal = 0
                    If Result1.사용면적.H <> 0 Then
                        난방면적 = TOSG(IIf(난방 = 0, 0, 난방 / Result1.사용면적.H))
                    End If
                    If Result1.사용면적.C <> 0 Then
                        냉방면적 = TOSG(IIf(냉방 = 0, 0, 냉방 / Result1.사용면적.C))
                    End If
                    If Result1.사용면적.L <> 0 Then
                        조명면적 = TOSG(IIf(조명 = 0, 0, 조명 / Result1.사용면적.L))
                    End If
                    If Result1.사용면적.W <> 0 Then
                        급탕면적 = TOSG(IIf(급탕 = 0, 0, 급탕 / Result1.사용면적.W))
                    End If
                    If Result1.사용면적.V <> 0 Then
                        환기면적 = TOSG(IIf(환기 = 0, 0, 환기 / Result1.사용면적.V))
                    End If

                    Dim 면적 As Decimal = 난방면적 + 냉방면적 + 조명면적 + 급탕면적 + 환기면적

                    '=-SUM(계산결과!G108:G109)-계산결과!F42-계산결과!F48-계산결과!F51-계산결과!F56-계산결과!F59

                    'F42=IF($G$15=0,0,F38/$G$15)
                    'f38=(G104)/(SUM(H76:S76)+SUM(H85:S85)+SUM(H93:S93)+SUM(H97:S97)+SUM(H101:S101))*SUM(H76:S76)
                    'g15=난방면적

                    'f48=IF($G$20=0,0,F44/$G$20)
                    'f44=(G104)/(SUM(H76:S76)+SUM(H85:S85)+SUM(H93:S93)+SUM(H97:S97)+SUM(H101:S101))*SUM(H85:S85)
                    'g20=냉방면적





                    '//열병합신재생에너지추가 130831 arin
                    신재생에너지 = Math.Round((-1 * (Result1.생산E(0).면적당생산량태양열 + Result1.생산E(0).신재생면적당열생산량 + Result1.생산E(0).면적당생산량지열 + Result1.생산E(0).면적당생산량수열) - 면적), 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "신재생에너지"
                    Dr2.Req = 신재생에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    난방에너지 = Math.Round(Result1.E소요량(0).난방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "난방에너지"
                    Dr2.Req = 난방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)


                    냉방에너지 = Math.Round(Result1.E소요량(0).냉방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "냉방에너지"
                    Dr2.Req = 냉방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)


                    급탕에너지 = Math.Round(Result1.E소요량(0).급탕면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "급탕에너지"
                    Dr2.Req = 급탕에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    조명에너지 = Math.Round(Result1.E소요량(0).조명면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "조명에너지"
                    Dr2.Req = 조명에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    환기에너지 = Math.Round(Result1.E소요량(0).환기면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "환기에너지"
                    Dr2.Req = 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "소요량"
                    Dr2.type = "합계"
                    Dr2.Req = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)


                Case 2  '//에너지요구량


                    신재생에너지 = 0
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "신재생에너지"
                    Dr2.Req = 신재생에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H14
                    난방에너지 = Math.Round(Result1.E요구량(0).난방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "난방에너지"
                    Dr2.Req = 난방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    냉방에너지 = Math.Round(Result1.E요구량(0).냉방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "냉방에너지"
                    Dr2.Req = 냉방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H25
                    급탕에너지 = Math.Round(Result1.E요구량(0).급탕면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "급탕에너지"
                    Dr2.Req = 급탕에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H22
                    조명에너지 = Math.Round(Result1.E요구량(0).조명면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "조명에너지"
                    Dr2.Req = 조명에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    환기에너지 = 0
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "환기에너지"
                    Dr2.Req = 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "요구량"
                    Dr2.type = "합계"
                    Dr2.Req = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                Case 3  '//co2발생량

                    신재생에너지 = 0
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "신재생에너지"
                    Dr2.Req = 신재생에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    난방에너지 = Math.Round(Result1.Co2발생량(0).난방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "난방에너지"
                    Dr2.Req = 난방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    냉방에너지 = Math.Round(Result1.Co2발생량(0).냉방면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "냉방에너지"
                    Dr2.Req = 냉방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    급탕에너지 = Math.Round(Result1.Co2발생량(0).급탕면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "급탕에너지"
                    Dr2.Req = 급탕에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    조명에너지 = Math.Round(Result1.Co2발생량(0).조명면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "조명에너지"
                    Dr2.Req = 조명에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H92*3/계산결과!H27
                    환기에너지 = Math.Round(Result1.Co2발생량(0).환기면적, 1)
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "환기에너지"
                    Dr2.Req = 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "CO2발생량"
                    Dr2.type = "합계"
                    Dr2.Req = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                Case 4  '//1차에너지소요량(+계수) + 131020 

                    신재생에너지 = 0
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "신재생에너지"
                    Dr2.Req = 신재생에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)


                    If (Result1.사용면적.H_WF = 0) Then
                        난방에너지 = 0
                    Else
                        난방에너지 = Math.Round(Result1.일차E소요량(0).난방면적2 * Result1.사용면적.H / Result1.사용면적.H_WF, 1)
                    End If
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "난방에너지"
                    Dr2.Req = 난방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    If (Result1.사용면적.C_WF = 0) Then
                        냉방에너지 = 0
                    Else
                        냉방에너지 = Math.Round(TOSG(Result1.일차E소요량(0).냉방면적 * Result1.사용면적.C / Result1.사용면적.C_WF), 1)
                    End If
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "냉방에너지"
                    Dr2.Req = 냉방에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    If (Result1.사용면적.W_WF = 0) Then
                        급탕에너지 = 0
                    Else
                        급탕에너지 = Math.Round(Result1.일차E소요량(0).급탕면적2 * Result1.사용면적.W / Result1.사용면적.W_WF, 1)
                    End If
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "급탕에너지"
                    Dr2.Req = 급탕에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    If (Result1.사용면적.L_WF = 0) Then
                        조명에너지 = 0
                    Else
                        조명에너지 = Math.Round(Result1.일차E소요량(0).조명면적 * Result1.사용면적.L / Result1.사용면적.L_WF, 1)
                    End If
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "조명에너지"
                    Dr2.Req = 조명에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    '계산결과!H92*3/계산결과!H27
                    If (Result1.사용면적.V_WF = 0) Then
                        환기에너지 = 0
                    Else
                        환기에너지 = Math.Round(Result1.일차E소요량(0).환기면적 * Result1.사용면적.V / Result1.사용면적.V_WF, 1)
                    End If
                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "환기에너지"
                    Dr2.Req = 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

                    Dr2 = Me.DSR.Graph_ReqUse.NewGraph_ReqUseRow
                    Dr2.Gubun = "등급용1차소요량"
                    Dr2.type = "합계"
                    Dr2.Req = 난방에너지 + 냉방에너지 + 급탕에너지 + 조명에너지 + 환기에너지
                    Me.DSR.Graph_ReqUse.Rows.Add(Dr2)

            End Select
        Next

    End Sub


    Private Sub Report_그래프_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
        '  Me.Text = Me.Size.ToString

    End Sub
End Class