private void ExportToExcel(Table tbToExcel) { try { // string strMapPath = Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf("/") + 1) + "UploadedFiles/OpenIssue/"; //string strMapPath = Request.Url.ToString().Substring(0, Request.Url.ToString().LastIndexOf("/") - 13) + "UploadedFiles/OpenIssue/"; string strNo = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString(); StringWriter strWrite = new StringWriter(); HtmlTextWriter htmlWrite = new HtmlTextWriter(strWrite); string strHtml = ""; strHtml = strWrite.ToString(); //strHtml = "<html xmlns:v=/"urn:schemas-microsoft-com:vml/"xmlns:o=/"urn:schemas-microsoft-com:office:office/"xmlns:x=/"urn:schemas-microsoft-com:office:excel/"xmlns=/"http://www.w3.org/TR/REC-html40/"><head><meta http-equiv=Content-Type content=/"text/html; charset=windows-1252/"><meta name=ProgId content=Excel.Sheet><meta name=Generator content=/"Microsoft Excel 11/"><link rel=File-List href="/" mce_href="/""复件%20PR06.files/filelist.xml/"><link rel=Edit-Time-Data href="/" mce_href="/""复件%20PR06.files/editdata.mso/"><link rel=OLE-Object-Data href="/" mce_href="/""复件%20PR06.files/oledata.mso/"><!--[if !mso]><mce:style><!-- v//:* {behavior:url(#default#VML);}o//:* {behavior:url(#default#VML);}x//:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);} --></mce:style><style mce_bogus="1">v//:* {behavior:url(#default#VML);}o//:* {behavior:url(#default#VML);}x//:* {behavior:url(#default#VML);}.shape {behavior:url(#default#VML);}</style><![endif]--><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:LastAuthor>FtpDown</o:LastAuthor> <o:LastPrinted>2010-01-07T02:23:54Z</o:LastPrinted> <o:LastSaved>2010-01-07T02:23:56Z</o:LastSaved> <o:Version>11.5606</o:Version> </o:DocumentProperties></xml><![endif]--><mce:style><!-- table {mso-displayed-decimal-separator:/"//./"; mso-displayed-thousand-separator:/"//,/";}@page {margin:.5in .5in .5in .5in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-page-orientation:landscape;}tr {mso-height-source:auto; mso-ruby-visibility:none;}col {mso-width-source:auto; mso-ruby-visibility:none;}br {mso-data-placement:same-cell;}.style0 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4; mso-style-id:0;}.style69 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4_detail;}td {mso-style-parent:style0; padding:0px; mso-ignore:padding; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-number-format:General; text-align:general; vertical-align:middle; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl25 {mso-style-parent:style69; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl26 {mso-style-parent:style69; color:black; font-size:20.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl27 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl28 {mso-style-parent:style69; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl29 {mso-style-parent:style69; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl30 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl31 {mso-style-parent:style69; color:black; font-size:11.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl32 {mso-style-parent:style69; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl33 {mso-style-parent:style69; color:black; font-size:11.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl34 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:.5pt solid windowtext;}.xl35 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none;}.xl36 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;}.xl37 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none;}ruby {ruby-align:left;}rt {color:windowtext; font-size:9.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-char-type:none; display:none;} --></mce:style><style mce_bogus="1">table {mso-displayed-decimal-separator:/"//./"; mso-displayed-thousand-separator:/"//,/";}@page {margin:.5in .5in .5in .5in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-page-orientation:landscape;}tr {mso-height-source:auto; mso-ruby-visibility:none;}col {mso-width-source:auto; mso-ruby-visibility:none;}br {mso-data-placement:same-cell;}.style0 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4; mso-style-id:0;}.style69 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4_detail;}td {mso-style-parent:style0; padding:0px; mso-ignore:padding; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-number-format:General; text-align:general; vertical-align:middle; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl25 {mso-style-parent:style69; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl26 {mso-style-parent:style69; color:black; font-size:20.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl27 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl28 {mso-style-parent:style69; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl29 {mso-style-parent:style69; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl30 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl31 {mso-style-parent:style69; color:black; font-size:11.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134;}.xl32 {mso-style-parent:style69; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl33 {mso-style-parent:style69; color:black; font-size:11.0pt; font-weight:700; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:none; border-bottom:1.0pt solid windowtext; border-left:none;}.xl34 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:.5pt solid windowtext;}.xl35 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:.5pt solid windowtext; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none;}.xl36 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext;}.xl37 {mso-style-parent:style69; color:black; font-size:11.0pt; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border-top:none; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:none;}ruby {ruby-align:left;}rt {color:windowtext; font-size:9.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-char-type:none; display:none;}</style><!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>detail</x:Name> <x:WorksheetOptions> <x:DefaultRowHeight>285</x:DefaultRowHeight> <x:FitToPage/> <x:FitToPage/> <x:Print> <x:FitHeight>5</x:FitHeight> <x:ValidPrinterInfo/> <x:HorizontalResolution>600</x:HorizontalResolution> <x:VerticalResolution>600</x:VerticalResolution> </x:Print> <x:Selected/> <x:DoNotDisplayGridlines/> <x:Panes> <x:Pane> <x:Number>3</x:Number> <x:ActiveRow>13</x:ActiveRow> <x:ActiveCol>6</x:ActiveCol> </x:Pane> </x:Panes> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> </x:ExcelWorksheet> </x:ExcelWorksheets> <x:WindowHeight>12525</x:WindowHeight> <x:WindowWidth>19035</x:WindowWidth> <x:WindowTopX>0</x:WindowTopX> <x:WindowTopY>120</x:WindowTopY> <x:ProtectStructure>False</x:ProtectStructure> <x:ProtectWindows>False</x:ProtectWindows> </x:ExcelWorkbook></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=/"edit/" spidmax=/"3077/"/></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=/"edit/"> <o:idmap v:ext=/"edit/" data=/"2,3/"/> </o:shapelayout></xml><![endif]--></head><body link=blue vlink=purple><table x:str border=0 cellpadding=0 cellspacing=0 width=586 style='border-collapse: collapse;table-layout:fixed;width:440pt'> <col width=72 span=2 style='width:54pt'> <col width=150 style='mso-width-source:userset;mso-width-alt:4800;width:113pt'> <col width=196 style='mso-width-source:userset;mso-width-alt:6272;width:147pt'> <col width=96 style='mso-width-source:userset;mso-width-alt:3072;width:72pt'> "; strHtml = "<html xmlns:v=/"urn:schemas-microsoft-com:vml/"xmlns:o=/"urn:schemas-microsoft-com:office:office/"xmlns:x=/"urn:schemas-microsoft-com:office:excel/"xmlns=/"http://www.w3.org/TR/REC-html40/"><head><meta http-equiv=Content-Type content=/"text/html; charset=windows-1252/"><meta name=ProgId content=Excel.Sheet><meta name=Generator content=/"Microsoft Excel 11/"><link rel=File-List href="/" mce_href="/""Open%20Ission%20I000000009%201%20.files/filelist.xml/"><link rel=Edit-Time-Datahref=/"Open%20Ission%20I000000009%201%20.files/editdata.mso/"><link rel=OLE-Object-Datahref=/"Open%20Ission%20I000000009%201%20.files/oledata.mso/"><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:LastAuthor>FtpDown</o:LastAuthor> <o:LastPrinted>2010-01-07T02:23:54Z</o:LastPrinted> <o:Created>2010-01-15T07:25:38Z</o:Created> <o:LastSaved>2010-03-16T06:37:32Z</o:LastSaved> <o:Version>11.5606</o:Version> </o:DocumentProperties></xml><![endif]--><linkrel=/"Edit-Time-Datahref="Open%20Ission%20I000000021%201%20.files/editdata.mso/"><linkrel=/"OLE-Object-Datahref="Open%20Ission%20I000000021%201%20.files/oledata.mso/"><mce:style><!-- table {mso-displayed-decimal-separator:/"//./"; mso-displayed-thousand-separator:/"//,/";}@page {margin:.5in .5in .5in .5in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-page-orientation:landscape;}tr {mso-height-source:auto; mso-ruby-visibility:none;}col {mso-width-source:auto; mso-ruby-visibility:none;}br {mso-data-placement:same-cell;}.style0 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4; mso-style-id:0;}.style21 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4_detail;}td {mso-style-parent:style0; padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-number-format:General; text-align:general; vertical-align:middle; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl25 {mso-style-parent:style21; color:black; font-size:11.0pt;}.xl26 {mso-style-parent:style21; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl27 {mso-style-parent:style21; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl28 {mso-style-parent:style21; color:black; font-size:11.0pt; font-weight:700;}.xl29 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border:.5pt solid windowtext;}.xl30 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border:.5pt solid windowtext; white-space:normal;}.xl31 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:2.0pt double windowtext; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}.xl32 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:2.0pt double windowtext; border-right:2.0pt double windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}.xl33 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:.5pt solid windowtext; border-right:2.0pt double windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}ruby {ruby-align:left;}rt {color:windowtext; font-size:9.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-char-type:none; display:none;} --></mce:style><style mce_bogus="1">table {mso-displayed-decimal-separator:/"//./"; mso-displayed-thousand-separator:/"//,/";}@page {margin:.5in .5in .5in .5in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-page-orientation:landscape;}tr {mso-height-source:auto; mso-ruby-visibility:none;}col {mso-width-source:auto; mso-ruby-visibility:none;}br {mso-data-placement:same-cell;}.style0 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4; mso-style-id:0;}.style21 {mso-number-format:General; text-align:general; vertical-align:middle; white-space:nowrap; mso-rotate:0; mso-background-source:auto; mso-pattern:auto; color:black; font-size:11.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; border:none; mso-protection:locked visible; mso-style-name://5E38//89C4_detail;}td {mso-style-parent:style0; padding-top:1px; padding-right:1px; padding-left:1px; mso-ignore:padding; color:windowtext; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-number-format:General; text-align:general; vertical-align:middle; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl25 {mso-style-parent:style21; color:black; font-size:11.0pt;}.xl26 {mso-style-parent:style21; font-size:10.0pt; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl27 {mso-style-parent:style21; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; vertical-align:bottom;}.xl28 {mso-style-parent:style21; color:black; font-size:11.0pt; font-weight:700;}.xl29 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border:.5pt solid windowtext;}.xl30 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border:.5pt solid windowtext; white-space:normal;}.xl31 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:2.0pt double windowtext; border-right:.5pt solid windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}.xl32 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:2.0pt double windowtext; border-right:2.0pt double windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}.xl33 {mso-style-parent:style0; font-size:10.0pt; font-weight:700; font-family:Arial, sans-serif; mso-font-charset:0; text-align:center; border-top:.5pt solid windowtext; border-right:2.0pt double windowtext; border-bottom:.5pt solid windowtext; border-left:.5pt solid windowtext; white-space:normal;}ruby {ruby-align:left;}rt {color:windowtext; font-size:9.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:SimSun; mso-generic-font-family:auto; mso-font-charset:134; mso-char-type:none; display:none;}</style><!--[if gte mso 9]><xml> <x:ExcelWorkbook> <x:ExcelWorksheets> <x:ExcelWorksheet> <x:Name>detail</x:Name> <x:WorksheetOptions> <x:DefaultRowHeight>285</x:DefaultRowHeight> <x:FitToPage/> <x:FitToPage/> <x:Print> <x:FitHeight>5</x:FitHeight> <x:ValidPrinterInfo/> <x:HorizontalResolution>600</x:HorizontalResolution> <x:VerticalResolution>600</x:VerticalResolution> </x:Print> <x:Selected/> <x:DoNotDisplayGridlines/> <x:LeftColumnVisible>3</x:LeftColumnVisible> <x:Panes> <x:Pane> <x:Number>3</x:Number> <x:ActiveRow>6</x:ActiveRow> <x:ActiveCol>12</x:ActiveCol> </x:Pane> </x:Panes> <x:ProtectContents>False</x:ProtectContents> <x:ProtectObjects>False</x:ProtectObjects> <x:ProtectScenarios>False</x:ProtectScenarios> </x:WorksheetOptions> </x:ExcelWorksheet> </x:ExcelWorksheets> <x:WindowHeight>12525</x:WindowHeight> <x:WindowWidth>17400</x:WindowWidth> <x:WindowTopX>0</x:WindowTopX> <x:WindowTopY>120</x:WindowTopY> <x:ProtectStructure>False</x:ProtectStructure> <x:ProtectWindows>False</x:ProtectWindows> </x:ExcelWorkbook></xml><![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=/"edit/" spidmax=/"3074/"/></xml><![endif]--></head><body link=blue vlink=purple><table x:str border=0 cellpadding=0 cellspacing=0 width=1392 style='border-collapse: collapse;table-layout:fixed;width:1045pt'> <col width=113 style='mso-width-source:userset;mso-width-alt:3616;width:85pt'> <col width=165 style='mso-width-source:userset;mso-width-alt:5280;width:124pt'> <col width=150 style='mso-width-source:userset;mso-width-alt:4800;width:113pt'> <col width=196 style='mso-width-source:userset;mso-width-alt:6272;width:147pt'> <col width=96 style='mso-width-source:userset;mso-width-alt:3072;width:72pt'> <col width=72 style='width:54pt'> <col width=109 style='mso-width-source:userset;mso-width-alt:3488;width:82pt'> <col width=72 span=2 style='width:54pt'> <col width=131 style='mso-width-source:userset;mso-width-alt:4192;width:98pt'> <col width=72 span=3 style='width:54pt'>"; strHtml = strHtml + "<tr height=20 style='height:15.0pt'>"; strHtml = strHtml + "<td rowspan=2 height=51 class=xl29 width=113 style='height:38.25pt; width:85pt'>PRODUCT NO.</td>"; strHtml = strHtml + "<td rowspan=2 class=xl30 width=165 style='width:124pt'>PRODUCT CLASS</td>"; strHtml = strHtml + "<td rowspan=2 class=xl30 width=150 style='width:113pt'>PRODUCT GROUP</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=196 style='width:147pt'>IMAGE</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=96 style='width:72pt'>DESCRIPTION</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=72 style='width:54pt'>SUPPLIER</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=109 style='width:82pt'>UNIT COST (BULK - FOB HK)</td>"; strHtml = strHtml + "<td colspan=3 class=xl31 width=275 style='border-left:none;width:206pt'>ESTIMATED FREIGHT & DUTY COST</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=72 style='width:54pt'>MOQ</td>"; strHtml = strHtml + "<td rowspan=2 class=xl31 width=72 style='width:54pt'>L/T</td>"; strHtml = strHtml + "<td rowspan=2 class=xl32 width=72 style='width:54pt'>REMARKS</td>"; strHtml = strHtml + "</tr>"; strHtml = strHtml + "<tr height=31 style='mso-height-source:userset;height:23.25pt'>"; strHtml = strHtml + "<td height=31 class=xl30 width=72 style='height:23.25pt;border-top:none; border-left:none;width:54pt'>AIR</td>"; strHtml = strHtml + "<td class=xl30 width=72 style='border-top:none;border-left:none;width:54pt'>OCEAN</td>"; strHtml = strHtml + "<td class=xl30 width=131 style='border-top:none;border-left:none;width:98pt'>DUTY</td>"; strHtml = strHtml + "</tr>"; GS_PRODUCT_LIBRARY objDG_PRODUCT_LIBRARY = new GS_PRODUCT_LIBRARY(); GS_PRODUCT_QUOTE objGS_PRODUCT_QUOTE = new GS_PRODUCT_QUOTE(); for (int i=0; i < tbToExcel.Rows.Count;i++ ) { CheckBox lkFileName = new CheckBox(); lkFileName = (CheckBox)gvrow.FindControl("chkSelected"); if (lkFileName.Checked == true) { string strProductNo = ""; string strProductClass = ""; string strProductGroup = ""; string strImage = ""; string strDes = ""; string strSupplier = ""; string strUnitCost = ""; string strAir = ""; string strOcean = ""; string strDuty = ""; string strMoQ = ""; string strLT = ""; string strRemarks = ""; strProductNo = gvrow.Cells[1].Text.Trim(); objDG_PRODUCT_LIBRARY.PRODUCT_NO = strProductNo; DataSet dsProductOne = BLL_GS_PRODUCT_LIBRARY.getProductLibraryList(objDG_PRODUCT_LIBRARY); if (dsProductOne != null && dsProductOne.Tables.Count > 0) { if (dsProductOne.Tables[0] != null && dsProductOne.Tables[0].Rows.Count > 0) { objGS_PRODUCT_QUOTE.PRODUCT_ID = System.Convert.ToInt32(dsProductOne.Tables[0].Rows[0]["PRODUCT_ID"].ToString()); strDes = dsProductOne.Tables[0].Rows[0]["DESCRIPTION"].ToString(); strSupplier = dsProductOne.Tables[0].Rows[0]["VENDOR"].ToString(); strProductClass = dsProductOne.Tables[0].Rows[0]["PRODUCT_CLASS"].ToString(); strProductGroup = dsProductOne.Tables[0].Rows[0]["PRODUCT_GROUP_DESC"].ToString(); DataSet dsProductQuote = new DataSet(); dsProductQuote = BLL_GS_PRODUCT_QUOTE.getQuoteDataList(objGS_PRODUCT_QUOTE); if (dsProductQuote != null && dsProductQuote.Tables.Count > 0) { if (dsProductQuote.Tables[0] != null && dsProductQuote.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsProductQuote.Tables[0].Rows.Count; i++) { strUnitCost = dsProductQuote.Tables[0].Rows[i]["COST"].ToString(); strAir = dsProductQuote.Tables[0].Rows[i]["AIR_FREIGHT"].ToString(); strOcean = dsProductQuote.Tables[0].Rows[i]["OCEAN_FREIGHT"].ToString(); strDuty = dsProductQuote.Tables[0].Rows[i]["DUTY"].ToString(); strMoQ = dsProductQuote.Tables[0].Rows[i]["MOQ"].ToString(); strLT = dsProductQuote.Tables[0].Rows[i]["LEAD_TIME"].ToString(); strHtml = strHtml + "<tr height=19 style='height:14.25pt'>"; strHtml = strHtml + "<td height=19 class=xl27 style='height:14.25pt'>" + strProductNo + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductClass + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductGroup + "</td>"; strHtml = strHtml + "<td class=xl26>" + strImage + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDes + "</td>"; strHtml = strHtml + "<td class=xl26>" + strSupplier + "</td>"; strHtml = strHtml + "<td class=xl26>" + strUnitCost + "</td>"; strHtml = strHtml + "<td class=xl26>" + strAir + "</td>"; strHtml = strHtml + "<td class=xl26>" + strOcean + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDuty + "</td>"; strHtml = strHtml + "<td class=xl26>" + strMoQ + "</td>"; strHtml = strHtml + "<td class=xl26>" + strLT + "</td>"; strHtml = strHtml + "<td class=xl26>" + strRemarks + "</td>"; strHtml = strHtml + "</tr>"; } } else { strHtml = strHtml + "<tr height=19 style='height:14.25pt'>"; strHtml = strHtml + "<td height=19 class=xl27 style='height:14.25pt'>" + strProductNo + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductClass + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductGroup + "</td>"; strHtml = strHtml + "<td class=xl26>" + strImage + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDes + "</td>"; strHtml = strHtml + "<td class=xl26>" + strSupplier + "</td>"; strHtml = strHtml + "<td class=xl26>" + strUnitCost + "</td>"; strHtml = strHtml + "<td class=xl26>" + strAir + "</td>"; strHtml = strHtml + "<td class=xl26>" + strOcean + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDuty + "</td>"; strHtml = strHtml + "<td class=xl26>" + strMoQ + "</td>"; strHtml = strHtml + "<td class=xl26>" + strLT + "</td>"; strHtml = strHtml + "<td class=xl26>" + strRemarks + "</td>"; strHtml = strHtml + "</tr>"; } } else { strHtml = strHtml + "<tr height=19 style='height:14.25pt'>"; strHtml = strHtml + "<td height=19 class=xl27 style='height:14.25pt'>" + strProductNo + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductClass + "</td>"; strHtml = strHtml + "<td class=xl26>" + strProductGroup + "</td>"; strHtml = strHtml + "<td class=xl26>" + strImage + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDes + "</td>"; strHtml = strHtml + "<td class=xl26>" + strSupplier + "</td>"; strHtml = strHtml + "<td class=xl26>" + strUnitCost + "</td>"; strHtml = strHtml + "<td class=xl26>" + strAir + "</td>"; strHtml = strHtml + "<td class=xl26>" + strOcean + "</td>"; strHtml = strHtml + "<td class=xl26>" + strDuty + "</td>"; strHtml = strHtml + "<td class=xl26>" + strMoQ + "</td>"; strHtml = strHtml + "<td class=xl26>" + strLT + "</td>"; strHtml = strHtml + "<td class=xl26>" + strRemarks + "</td>"; strHtml = strHtml + "</tr>"; } } } //strHtml = strHtml + "<tr height=19 style='height:14.25pt'>"; //strHtml = strHtml + "<td height=19 class=xl27 style='height:14.25pt'>" + strProductNo + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strProductClass + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strProductGroup + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strImage + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strDes + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strSupplier + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strUnitCost + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strAir + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strOcean + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strDuty + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strMoQ + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strLT + "</td>"; //strHtml = strHtml + "<td class=xl26>" + strRemarks + "</td>"; //strHtml = strHtml + "</tr>"; } } strHtml = strHtml + "<tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td colspan=2 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td class=xl28></td> <td class=xl26></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td colspan=2 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td class=xl28></td> <td class=xl26></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td colspan=2 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td class=xl28></td> <td class=xl26></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td colspan=2 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td class=xl28></td> <td class=xl26></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td colspan=2 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td class=xl28></td> <td class=xl26></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl27 style='height:14.25pt'></td> <td class=xl26></td> <td class=xl25></td> <td class=xl28></td> <td class=xl25></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=3 class=xl27 style='height:14.25pt;mso-ignore:colspan'></td> <td colspan=10 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=13 style='height:14.25pt;mso-ignore:colspan'></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td class=xl28></td> <td colspan=3 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td colspan=4 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=13 style='height:14.25pt;mso-ignore:colspan'></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td colspan=4 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=3 class=xl27 style='height:14.25pt;mso-ignore:colspan'></td> <td colspan=10 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=13 style='height:14.25pt;mso-ignore:colspan'></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td class=xl28></td> <td colspan=3 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td colspan=4 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 style='height:14.25pt'></td> <td colspan=4 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=3 class=xl27 style='height:14.25pt;mso-ignore:colspan'></td> <td colspan=10 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=13 style='height:14.25pt;mso-ignore:colspan'></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td class=xl28></td> <td colspan=3 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 class=xl25 style='height:14.25pt'></td> <td colspan=4 class=xl26 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> <td colspan=8 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <tr height=19 style='height:14.25pt'> <td height=19 colspan=13 style='height:14.25pt;mso-ignore:colspan'></td> </tr> <tr height=0 style="display:none" mce_style="display:none"> <td height=0 colspan=13 style="mso-ignore:colspan" mce_style="mso-ignore:colspan"></td> </tr> <![if supportMisalignedColumns]> <tr height=0 style="display:none" mce_style="display:none"> <td width=113 style='width:85pt'></td> <td width=165 style='width:124pt'></td> <td width=150 style='width:113pt'></td> <td width=196 style='width:147pt'></td> <td width=96 style='width:72pt'></td> <td width=72 style='width:54pt'></td> <td width=109 style='width:82pt'></td> <td width=72 style='width:54pt'></td> <td width=72 style='width:54pt'></td> <td width=131 style='width:98pt'></td> <td width=72 style='width:54pt'></td> <td width=72 style='width:54pt'></td> <td width=72 style='width:54pt'></td> </tr> <![endif]></table></body></html>"; string newPath = MapPath("../GS/UploadedFiles//OpenIssue/"); string newFileName = "PRODUCTINFORMATION " + strNo + ".xls"; DirectoryInfo foldPath = new DirectoryInfo(newPath); if (foldPath.Exists) { if (File.Exists(newFileName)) { File.Delete(newFileName); } } else { foldPath.Create(); } string newFilePath = System.IO.Path.Combine(newPath, newFileName); using (System.IO.FileStream fs = System.IO.File.Create(newFilePath)) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); fs.Write(encoding.GetBytes(strHtml), 0, encoding.GetByteCount(strHtml)); fs.Close(); } string filepath = "../GS/UploadedFiles//OpenIssue/" + "PRODUCTINFORMATION " + strNo + ".xls"; System.IO.FileInfo file = new System.IO.FileInfo(MapPath(filepath)); if (file.Exists) { Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/vnd.ms-excel"; Response.WriteFile(file.FullName); Response.End(); } } catch (Exception exc) { string strErrorMessage = exc.Message; strErrorMessage = ""; } }