ÀÌ ¹®¼¿¡¼´Â Office ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¸¦ »ç¿ëÇÏ¿© XMLSS(XML ½ºÇÁ·¹µå½ÃÆ®) Çü½ÄÀ¸·Î ½ºÇÁ·¹µå½ÃÆ®¸¦ ¸¸µå´Â Microsoft Active Server Pages(ASP) ½ºÅ©¸³Æ®¸¦ ¼³¸íÇÕ´Ï´Ù. XMLSS´Â ´ÙÀ½°ú °°Àº ¿©·¯ °¡Áö ¹æ¹ý Áß Çϳª·Î Ŭ¶óÀ̾ðÆ®ÂÊ¿¡ Ç¥½ÃµÉ ¼ö ÀÖ½À´Ï´Ù.
- À¥ ÆäÀÌÁöÀÇ ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡ Ç¥½Ã
- ºê¶ó¿ìÀúÀÇ ÇöÀç À§Ä¡¿¡ Ç¥½ÃµÈ Microsoft Excel¿¡ Ç¥½Ã
- Microsoft Excel¿¡¼ Á÷Á¢ ¿±â
¼¹öÂÊ ÄÚµå·Î ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¸¦ »ç¿ëÇÏ¿© ½ºÇÁ·¹µå½ÃÆ®¸¦ ¸¸µé¸é Microsoft ExcelÀÇ ¼¹öÂÊ ÀÚµ¿È¸¦ »ç¿ëÇÏ´Â °Íº¸´Ù °³¼±µÈ È®À强 ¹× Çâ»óµÈ ¼º´ÉÀ» ¾òÀ» ¼ö ÀÖ½À´Ï´Ù. ¼¹ö¿¡¼ Excel°ú °°Àº Office ÀÀ¿ë ÇÁ·Î±×·¥Àº ÀÚµ¿ÈÇÏÁö ¾Ê´Â °ÍÀÌ ÁÁ½À´Ï´Ù. µ¿ÀÏÇÑ °á°ú¸¦ ¾òÀ» ¼ö ÀÖ´Â ´Ù¸¥ ¹æ¹ýÀÌ ÀÖ´Â °æ¿ì¿¡´Â ÀÌ ¹æ¹ýÀ» »ç¿ëÇÏÁö ¸¶½Ê½Ã¿À. XMLSS¿¡¼´Â ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò ¹× Microsoft Excel¿¡ °øÅëµÇ´Â ¿©·¯ ±â´ÉÀ» °è¼Ó »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ´ÙÁß ½ÃÆ® ÅëÇÕ ¹®¼, ¼¿ ¼½Ä, ÀÚµ¿ ÇÊÅÍ, ¼¿ ¼ö½Ä ¹× ´Ù½Ã °è»êÀº ÀÌ·¯ÇÑ ±â´É Áß ÀϺÎÀÔ´Ï´Ù. ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡´Â Microsoft ExcelÀÇ °³Ã¼ ¸ðµ¨°ú °¡Àå ºñ½ÁÇÑ °³Ã¼ ¸ðµ¨ÀÌ ÀÖ½À´Ï´Ù. µû¶ó¼ Excel °³Ã¼ ¸ðµ¨À» Àß ¾Ë¸é ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ±âÁ¸ Excel Äڵ带 ½±°Ô ¼öÁ¤ÇÏ¿© Àû¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
´ÙÀ½ ¿¹Á¦¿¡¼´Â ASP¿¡¼ ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¸¦ »ç¿ëÇÏ¿© ´ÙÁß ½ÃÆ® ÅëÇÕ ¹®¼¸¦ XMLSS·Î »ý¼ºÇÏ´Â ¹æ¹ýÀ» º¸¿© ÁÝ´Ï´Ù. ¶ÇÇÑ ÀÌ ¿¹Á¦¿¡¼´Â Ŭ¶óÀ̾ðÆ®ÂÊ À¥ ÆäÀÌÁö ¶Ç´Â Microsoft Excel¿¡ °á°ú XMLSS¸¦ Ç¥½ÃÇÏ´Â ¹æ¹ý¿¡ ´ëÇØ¼µµ ¼³¸íÇÕ´Ï´Ù.
½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¸¦ »ç¿ëÇÏ¿© XMLSS¸¦ ¸¸µå´Â ASP ½ºÅ©¸³Æ®
´ÙÀ½ ASP¸¦ À¥ ¼¹öÀÇ °¡»ó ·çÆ® µð·ºÅ͸®¿¡ XMLSS.asp·Î ÀúÀåÇÕ´Ï´Ù. ±âº»ÀûÀ¸·Î ·çÆ® µð·ºÅ͸®´Â C:\inetpub\wwwrootÀÔ´Ï´Ù.
<% Language=VBScript %>
<%
Response.Buffer = True
Response.ContentType = "text/xml"
Dim NumOrders, NumProds, r
NumOrders = 300
NumProds = 10
Dim oSS
Dim oOrdersSheet
Dim oTotalsSheet
Dim oRange
Dim c
Set oSS = CreateObject("OWC10.Spreadsheet")
Set c = oSS.Constants
'Rename Sheet1 to "Orders", rename Sheet2 to "Totals" and remove Sheet3
Set oOrdersSheet = oSS.Worksheets(1)
oOrdersSheet.Name = "Orders"
Set oTotalsSheet = oSS.Worksheets(2)
oTotalsSheet.Name = "Totals"
oSS.Worksheets(3).Delete
'=== Build the First Worksheet (Orders) ==============================================
'Add headings to A1:F1 of the Orders worksheet and apply formatting
Set oRange = oOrdersSheet.Range("A1:F1")
oRange.Value = Array("Order Number", "Product ID", "Quantity", "Price", "Discount", "Total")
oRange.Font.Bold = True
oRange.Interior.Color = "Silver"
oRange.Borders(c.xlEdgeBottom).Weight = c.xlThick
oRange.HorizontalAlignment = c.xlHAlignCenter
'Apply formatting to the columns
oOrdersSheet.Range("A:A").ColumnWidth = 20
oOrdersSheet.Range("B:E").ColumnWidth = 15
oOrdersSheet.Range("F:F").ColumnWidth = 20
oOrdersSheet.Range("A2:E" & NumOrders + 1 _
).HorizontalAlignment = c.xlHAlignCenter
oOrdersSheet.Range("D2:D" & NumOrders + 1).NumberFormat = "0.00"
oOrdersSheet.Range("E2:E" & NumOrders + 1).NumberFormat = "0 % "
oOrdersSheet.Range("F2:F" & NumOrders + 1).NumberFormat = "$ 0.00" '"_($* #,##0.00_)"
'Obtain the order information for the first five columns in the Orders worksheet
'and populate the worksheet with that data starting at row 2
Dim aOrderData
aOrderData = GetOrderInfo
oOrdersSheet.Range("A2:E" & NumOrders + 1).Value = aOrderData
'Add a formula to calculate the order total for each row and format the column
oOrdersSheet.Range("F2:F" & NumOrders + 1).Formula = "=C2*D2*(1-E2)"
oOrdersSheet.Range("F2:F" & NumOrders + 1).NumberFormat = "_( $* #,##0.00 _)"
'Apply a border to the used rows
oOrdersSheet.UsedRange.Borders(c.xlInsideHorizontal).Weight = c.xlThin
oOrdersSheet.UsedRange.BorderAround , c.xlThin, 15
'Turn on AutoFilter and display an initial criteria where
'the Product ID (column 2) is equal to 5
oOrdersSheet.UsedRange.AutoFilter
oOrdersSheet.AutoFilter.Filters(2).Criteria.FilterFunction = c.ssFilterFunctionInclude
oOrdersSheet.AutoFilter.Filters(2).Criteria.Add "5"
oOrdersSheet.AutoFilter.Apply
'Add a Subtotal at the end of the usedrange
oOrdersSheet.Range("F" & NumOrders + 3).Formula = "=SUBTOTAL(9, F2:F" & NumOrders + 1 & ")"
'Apply window settings for the Orders worksheet
oOrdersSheet.Activate 'Makes the Orders sheet active
oSS.Windows(1).ViewableRange = oOrdersSheet.UsedRange.Address
oSS.Windows(1).DisplayRowHeadings = False
oSS.Windows(1).DisplayColumnHeadings = False
oSS.Windows(1).FreezePanes = True
oSS.Windows(1).DisplayGridlines = False
'=== Build the Second Worksheet (Totals) ===========================================
'Change the Column headings and hide row headings
oTotalsSheet.Activate
oSS.Windows(1).ColumnHeadings(1).Caption = "Product ID"
oSS.Windows(1).ColumnHeadings(2).Caption = "Total"
oSS.Windows(1).DisplayRowHeadings = False
'Add the product IDs to column 1
Dim aProductIDs
aProductIDs = GetProductIDs
oTotalsSheet.Range("A1:A" & NumProds).Value = aProductIDs
oTotalsSheet.Range("A1:A" & NumProds).HorizontalAlignment = c.xlHAlignCenter
'Add a formula to column 2 that computes totals per product from the Orders Sheet
oTotalsSheet.Range("B1:B" & NumProds).Formula = _
"=SUMIF(Orders!B$2:B$" & NumOrders + 1 & ",A1,Orders!F$2:F$" & NumOrders + 1 & ")"
oTotalsSheet.Range("B1:B" & NumProds).NumberFormat = "_( $* #,##0.00 _)"
'Apply window settings for the Totals worksheet
oSS.Windows(1).ViewableRange = oTotalsSheet.UsedRange.Address
'=== Setup for final presentation ==================================================
oSS.DisplayToolbar = False
oSS.AutoFit = True
oOrdersSheet.Activate
Response.Write oSS.XMLData
Response.End
Function GetOrderInfo()
ReDim aOrderInfo(NumOrders,5)
Dim aPrice, aDisc
aPrice = Array(10.25, 9.5, 2.34, 6.57, 9.87, 4.55, 6, 13.05, 3.3, 5.5)
aDisc = Array(0, 0.1, 0.15, 0.2)
For r = 0 To NumOrders-1
aOrderInfo(r, 0) = "'" & String(7-Len(CStr(r+1)), "0") & r+1 'Col 1 is Order Number
aOrderInfo(r, 1) = Int(Rnd() * NumProds) + 1 'Col 2 is Product ID
aOrderInfo(r, 2) = Int(Rnd() * 20) + 1 'Col 3 is Quantity
aOrderInfo(r, 3) = aPrice(aOrderInfo(r, 1)-1) 'Col 4 is Price
aOrderInfo(r, 4) = aDisc(Int(Rnd() * 4)) 'Col 5 is Discount
Next
GetOrderInfo = aOrderInfo
End Function
Function GetProductIDs()
ReDim aPIDs(NumProds, 1)
For r = 0 To NumProds-1
aPIDs(r, 0) = r+1
Next
GetProductIDs = aPIDs
End Function
%>
À¥ ÆäÀÌÁö¿¡ XMLSS Ç¥½Ã
À¥ ÆäÀÌÁö¿¡ ¿¹Á¦ XMLSS¸¦ Ç¥½ÃÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò°¡ ASP¿¡ ´ëÇÑ URL·Î ¿¬°áµÇµµ·Ï
XMLURL ¼Ó¼ºÀ» ¼³Á¤Çϱ⸸ ÇÏ¸é µË´Ï´Ù.
<html>
<body>
<object classid="clsid:0002E551-0000-0000-C000-000000000046" id="Spreadsheet1">
<param name="XMLURL" value="http://YourWebServer/xmlss.asp">
</object>
</body>
</html>
Âü°í Microsoft Office 2003À» »ç¿ëÇÏ´Â °æ¿ì À§ ÄÚµåÀÇ
classid¸¦ ÀûÀýÇÏ°Ô º¯°æÇØ¾ß ÇÒ ¼ö ÀÖ½À´Ï´Ù.
¾ÕÀÇ HTML¿¡¼
XMLURL ¼Ó¼ºÀº
<param> ű׸¦ »ç¿ëÇÏ¿© ¼³Á¤µË´Ï´Ù. ¶ÇÇÑ ÇÊ¿äÇÑ °æ¿ì ·±Å¸ÀÓ¿¡ ´ÙÀ½ Äڵ带 »ç¿ëÇÏ¿©
XMLURL ¼Ó¼ºÀ» ¼³Á¤ÇÒ ¼öµµ ÀÖ½À´Ï´Ù.
Spreadsheet1.XMLURL = "http://YourWebServer/xmlss.asp"
Microsoft Excel¿¡ XMLSS Ç¥½Ã
½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡¼ ¸¸µç XMLSS¸¦ Microsoft Excel¿¡¼ ¿ ¼ö ÀÖ½À´Ï´Ù. ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò·Î ±¸ÇöÇÑ ¼½Ä ¹× ±â´ÉÀº Microsoft Excel°ú °øÀ¯µÉ ¼ö ÀÖ½À´Ï´Ù. ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡¼´Â Excel¿¡¼ Áö¿øÇÏÁö ¾Ê´Â ÀϺΠ±â´ÉÀ» Áö¿øÇϸç Excel¿¡¼´Â ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡¼ Áö¿øÇÏÁö ¾Ê´Â ÀϺΠ±â´ÉÀ» Áö¿øÇÕ´Ï´Ù. Excel¿¡¼ ±¸ÇöÇÏÁö ¾Ê´Â XML ÅÂ±× ¶Ç´Â Ư¼ºÀº XMLSS¸¦ ¿ ¶§ ¹«½ÃµË´Ï´Ù.
Microsoft Excel¿¡¼ ASP ¿¹Á¦ ½ºÅ©¸³Æ®ÀÇ °á°ú¸¦ º¸·Á¸é ´ÙÀ½ ´Ü°è¸¦ ¼öÇàÇϽʽÿÀ.
- Microsoft ExcelÀ» ½ÃÀÛÇÕ´Ï´Ù.
- ÆÄÀÏ ¸Þ´º¿¡¼ ¿±â¸¦ ´©¸¨´Ï´Ù.
- ÆÄÀÏ À̸§ »óÀÚ¿¡ http://YourWebServer/xmlss.asp¸¦ ÀÔ·ÂÇÑ ´ÙÀ½ ¿±â¸¦ ´©¸¨´Ï´Ù.
ÅëÇÕ ¹®¼¸¦ °Ë»çÇÕ´Ï´Ù. Áï, Excel¿¡¼ ¿¾úÀ» ¶§ ·±Å¸ÀÓ¿¡ Àû¿ëµÈ µ¥ÀÌÅÍ ¹× Çü½ÄÀÌ ÅëÇÕ ¹®¼¿¡ ¸ðµÎ Ç¥½ÃµÇ´ÂÁö È®ÀÎÇÕ´Ï´Ù. ÇÑ °¡Áö ¿¹¿Ü°¡ ÀÖ½À´Ï´Ù. ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¿¡¼ ¸¸µç ¸Ó¸®±Û ĸ¼ÇÀº Microsoft Excel¿¡¼ °øÀ¯ÇÏÁö ¾Ê´Â ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼ÒÀÇ ±â´ÉÀ̹ǷΠExcel¿¡¼´Â Ç¥½ÃµÇÁö ¾Ê½À´Ï´Ù. Excel¿¡ Ç¥½ÃÇÒ ¿ëµµ·Î ½ºÇÁ·¹µå½ÃÆ® ±¸¼º ¿ä¼Ò¸¦ »ç¿ëÇÏ¿© XMLSS¸¦ ¸¸µç °æ¿ì °¢°¢ÀÌ Áö¿øÇÏ´Â ±â´ÉÀ» ¾Ë°í ÀÖ¾î¾ß ÇÕ´Ï´Ù.
ASP¿¡¼ ¸¸µç XMLSS¸¦ Microsoft Excel¿¡¼ ¿©´Â ´Ù¸¥ ¹æ¹ýÀº ASP¿¡¼ Excel MIME(Multipurpose Internet Mail Extensions) Çü½ÄÀ»
ContentTypeÀ¸·Î ÁöÁ¤ÇÏ´Â °ÍÀÔ´Ï´Ù. Excel MIME Çü½ÄÀ» »ç¿ëÇÏ¿© ASP¸¦ Ž»öÇϸé XMLSS°¡ ºê¶ó¿ìÀúÀÇ ÇöÀç À§Ä¡¿¡¼ È£½ºÆ®µÇ´Â Microsoft Excel¿¡ ·»´õ¸µµË´Ï´Ù. ÀÌ·¸°Ô ÇÏ·Á¸é ´ÙÀ½°ú °°ÀÌ ÇϽʽÿÀ.
- ÅØ½ºÆ® ÆíÁý±â¿¡¼ XMLSS.asp¸¦ ¿±´Ï´Ù.
- ´ÙÀ½ ½ºÅ©¸³Æ® ÁÙÀ» º¯°æÇÕ´Ï´Ù.
Response.ContentType = "text/xml"
ÄÚµå ÁÙÀ» ´ÙÀ½°ú °°ÀÌ º¯°æÇÕ´Ï´Ù.
Response.ContentType = "application/vnd.ms-excel"
- XMLSS.asp¿¡ º¯°æ ³»¿ëÀ» ÀúÀåÇÑ ´ÙÀ½ Windows Internet Explorer¸¦ ½ÃÀÛÇÕ´Ï´Ù.
- http://YourWebServer/XMLSS.asp¸¦ Ž»öÇÕ´Ï´Ù. XML ½ºÇÁ·¹µå½ÃÆ®°¡ ºê¶ó¿ìÀúÀÇ ÇöÀç À§Ä¡¿¡¼ È£½ºÆ®µÇ´Â Microsoft Excel¿¡ ·»´õ¸µµË´Ï´Ù.
ÀÚ¼¼ÇÑ ³»¿ëÀ» º¸·Á¸é ´ÙÀ½ Microsoft À¥ »çÀÌÆ®ÀÇ Office À¥ ±¸¼º ¿ä¼Ò Ç׸ñÀ» ÂüÁ¶ÇϽʽÿÀ.
ÀÚ¼¼ÇÑ ³»¿ëÀº Microsoft ±â¼ú ÀÚ·áÀÇ ´ÙÀ½ ¹®¼¸¦ ÂüÁ¶ÇϽʽÿÀ.
285891
(http://support.microsoft.com/kb/285891/
)
Visual Basic ¶Ç´Â ASP¸¦ »ç¿ëÇÏ¿© Excel 2002 ¹× Excel 2003¿ë XML ½ºÇÁ·¹µå½ÃÆ®¸¦ ¸¸µå´Â ¹æ¹ý
278976
(http://support.microsoft.com/kb/278976/
)
XSLÀ» »ç¿ëÇÏ¿© ¼¹öÂÊ »ç¿ë Excel XML ½ºÇÁ·¹µå½ÃÆ®¸¦ º¯È¯ÇÏ´Â ¹æ¹ý
257757
(http://support.microsoft.com/kb/257757/
)
OfficeÀÇ ¼¹öÂÊ ÀÚµ¿È¿¡ ´ëÇÑ °í·Á »çÇ×
Microsoft Á¦Ç° °ü·Ã ±â¼ú Àü¹®°¡µé°ú ¿Â¶óÀÎÀ¸·Î Á¤º¸¸¦ ±³È¯ÇϽ÷Á¸é Microsoft ´º½º ±×·ì
(http://support.microsoft.com/newsgroups/default.aspx)
¿¡ Âü¿©ÇϽñ⠹ٶø´Ï´Ù.±â¼ú ÀÚ·á: 288130 - ¸¶Áö¸· °ËÅä: 2008³â 1¿ù 22ÀÏ È¿äÀÏ - ¼öÁ¤: 5.1
º» ¹®¼ÀÇ Á¤º¸´Â ´ÙÀ½ÀÇ Á¦Ç°¿¡ Àû¿ëµË´Ï´Ù.
- Microsoft Office Web Components
- Microsoft Office Web Components
- Microsoft Office Excel 2007
- Microsoft Office Excel 2003
- Microsoft Excel 2002 Standard Edition
- Microsoft Active Server Pages 4.0
| kbhowto kbofficewebspread KB288130 |