I just published to our production web server, everything worked fine in dev. When attempting to access aspose I get a critical error that resets aspnet_wp. Any ideas?
What’s the error message? Do you assign enough rights to run Aspose.Excel? Do you create a very large file in your production web server? What’s the memory size in your web server?
And could you please post the sample code which caused the error?
We have a gig of memory. The error is non specific. and everyone has full control of the directory containing the dll and the license file.
Please check http://support.microsoft.com/?kbid=873043 for reference. And please assign enough memory to IIS.
We are running IIS 5 on Server 2000.
Here is a portion of the code:
Dim ds As DataSet
Dim i As Integer
Dim oexcel As New Aspose.Excel.Excel
Dim osheet As Aspose.Excel.Worksheet
Dim rng As Aspose.Excel.Range
Dim localFileName As String = “”
Dim fileName As String = “HPG Change Report.xls”
Dim dr As DataRow
Dim drsel() As DataRow
Dim x As Integer
Dim asposelic As New Aspose.Excel.License
Try
localFileName = Server.MapPath(strDownloadURL) & “” & Guid.NewGuid.ToString & “.xls”
ds = Components.Standardization.GetHPGListingCompare(Request.QueryString(“P1”), Request.QueryString(“P2”), 2)
If ds.Tables(0).Rows.Count > 0 Then
asposelic.SetLicense(Server.MapPath("\MedPack") & “\Aspose.Excel.lic”)
oexcel.ChangePalette(System.Drawing.Color.LightGray, 53)
oexcel.ChangePalette(System.Drawing.Color.Violet, 54)
oexcel.ChangePalette(System.Drawing.Color.Pink, 55)
oexcel.ChangePalette(System.Drawing.Color.SkyBlue, 52)
oexcel.Worksheets.Add(Aspose.Excel.SheetType.Worksheet)
osheet = oexcel.Worksheets(0)
osheet.Zoom = 75
'setup page
osheet.PageSetup.FitToPagesWide = 1
osheet.PageSetup.Orientation = Aspose.Excel.PageOrientationType.Landscape
osheet.PageSetup.PrintGridlines = True
… (a lot of sheet formatting code)
oexcel.Save(localFileName)
Response.Clear()
Response.ClearHeaders()
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Charset = “”
Response.Buffer = True
Response.ContentType = “application/vnd.ms-excel”
Response.AddHeader(“Content-Disposition”, “attachment;filename=” & fileName)
Response.WriteFile(localFileName)
Response.End()
End If
Catch ex As Exception
Throw
Finally
asposelic = Nothing
End Try
End Function
- Could you give me some error message? What happens if the IIS reset?
2. Is it possible your application concurrently save a same file to local disk?
3. What happens if you change your code from
oexcel.Save(localFileName)
Response.Clear()Response.ClearHeaders()
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Charset = “”
Response.Buffer = True
Response.ContentType = “application/vnd.ms-excel”
Response.AddHeader(“Content-Disposition”, “attachment;filename=” & fileName)
Response.WriteFile(localFileName)
Response.End()
to oexcel.Save(“book1.xls”, FileFormatType.Default, SaveType.OpenInExcel, Response)
4. What’s the size of generated file? Could you please post it here? It can only viewed by you and Aspose developers.
5. Could you please post some formatting code here?
And has your web server installed all windows patches?
1. Error
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot be found.
The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer.
The following information is part of the event: .NET Runtime version 1.1.4322.573- aspnet_wp.exe
- Common Language Runtime Debugging Services: Application has generated an exception that could not be handled.
Process id=0xea4 (3748), Thread id=0xf9c (3996).
2. The method I am usingto generate the file name will create a unique filename every time.
3. If I change this method to save to book1.xls I will run into an issue with the same file name.
4. A large file may run 100K
5. Here is the formatting code:
'setup page
osheet.PageSetup.FitToPagesWide = 1
osheet.PageSetup.Orientation = Aspose.Excel.PageOrientationType.Landscape
osheet.PageSetup.PrintGridlines = True
'Set column widths
osheet.Cells.SetColumnWidth(HPGCols.A, 14)
osheet.Cells.SetColumnWidth(HPGCols.B, 13)
osheet.Cells.SetColumnWidth(HPGCols.C, 11)
osheet.Cells.SetColumnWidth(HPGCols.D, 41)
osheet.Cells.SetColumnWidth(HPGCols.E, 41)
osheet.Cells.SetColumnWidth(HPGCols.F, 20)
osheet.Cells.SetColumnWidth(HPGCols.G, 2.5)
osheet.Cells.SetColumnWidth(HPGCols.H, 14)
osheet.Cells.SetColumnWidth(HPGCols.I, 13)
osheet.Cells.SetColumnWidth(HPGCols.J, 11)
osheet.Cells.SetColumnWidth(HPGCols.K, 41)
osheet.Cells.SetColumnWidth(HPGCols.L, 41)
osheet.Cells.SetColumnWidth(HPGCols.M, 20)
osheet.Cells.SetColumnWidth(HPGCols.N, 11)
'Set Header static data
'osheet.Cells.Merge(1, HPGCols.A, 1, HPGCols.N)
osheet.Cells.Columns(6).Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("G1").Style.ForegroundColor = System.Drawing.Color.White
osheet.Cells.SetRowHeight(0, 25)
osheet.Cells("G1").Style.HorizontalAlignment = Aspose.Excel.TextAlignmentType.Center
osheet.Cells("G1").Style.Font.Size = 18
osheet.Cells("G1").Style.Font.IsBold = True
osheet.Cells("G1").PutValue("HPG Sterile Procedure Tray/StandardProcedureTray Worksheet")
osheet.Cells("B4").PutValue("Item/Quote Number:")
osheet.Cells("B4").Style.Font.IsBold = True
osheet.Cells("B4").Style.HorizontalAlignment = Aspose.Excel.TextAlignmentType.Right
osheet.Cells("B4").Style.IsTextWrapped = False
osheet.Cells("H4").PutValue("Option 2:")
osheet.Cells("H4").Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("H4").Style.Font.IsBold = True
osheet.Cells("B5").PutValue("Description:")
osheet.Cells("B5").Style.Font.IsBold = True
osheet.Cells("B6").PutValue("Account:")
osheet.Cells("B6").Style.Font.IsBold = True
osheet.Cells("B7").PutValue("Sales Rep:")
osheet.Cells("B7").Style.Font.IsBold = True
osheet.Cells("B8").PutValue("Group:")
osheet.Cells("B8").Style.Font.IsBold = True
osheet.Cells("B9").PutValue("Date:")
osheet.Cells("B9").Style.Font.IsBold = True
osheet.Cells("F9").PutValue("Pack Price:")
osheet.Cells("F9").Style.Font.IsBold = True
osheet.Cells("F10").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F10").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F10").Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F10").Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("M9").PutValue("Pack Price:")
osheet.Cells("M9").Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("M9").Style.Font.IsBold = True
osheet.Cells("M10").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("M10").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("M10").Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("M10").Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("B10").PutValue("Base on Item:")
osheet.Cells("B10").Style.Font.IsBold = True
osheet.Cells("D10").PutValue("OLD")
osheet.Cells("D10").Style.Font.IsBold = True
osheet.Cells("I10").PutValue("Base on Item:")
osheet.Cells("I10").Style.Font.IsBold = True
osheet.Cells("K10").PutValue("NEW")
osheet.Cells("K10").Style.Font.IsBold = True
'setup row headers
osheet.Cells("A13").PutValue("Qty/Kit")
osheet.Cells("A13").Style.Font.IsBold = True
osheet.Cells("A13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("A13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("A13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("B13").PutValue("UOM")
osheet.Cells("B13").Style.Font.IsBold = True
osheet.Cells("B13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("B13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("B13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("C13").PutValue("Vendor Part #")
osheet.Cells("C13").Style.Font.IsBold = True
osheet.Cells("C13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("C13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("C13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("D13").PutValue("Description")
osheet.Cells("D13").Style.Font.IsBold = True
osheet.Cells("D13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("D13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("D13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("E13").PutValue("Vendor")
osheet.Cells("E13").Style.Font.IsBold = True
osheet.Cells("E13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("E13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("E13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("F13").PutValue("Item #")
osheet.Cells("F13").Style.Font.IsBold = True
osheet.Cells("F13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("F13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("F13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("G13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("G13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("H13").PutValue("Qty/Kit")
osheet.Cells("H13").Style.Font.IsBold = True
osheet.Cells("H13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("H13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("H13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("I13").PutValue("UOM")
osheet.Cells("I13").Style.Font.IsBold = True
osheet.Cells("I13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("I13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("I13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("J13").PutValue("Vendor Part #")
osheet.Cells("J13").Style.Font.IsBold = True
osheet.Cells("J13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("J13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("J13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("K13").PutValue("Description")
osheet.Cells("K13").Style.Font.IsBold = True
osheet.Cells("K13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("K13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("K13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("L13").PutValue("Vendor")
osheet.Cells("L13").Style.Font.IsBold = True
osheet.Cells("L13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("L13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("L13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("M13").PutValue("Item #")
osheet.Cells("M13").Style.Font.IsBold = True
osheet.Cells("M13").Style.ForegroundColor = System.Drawing.Color.LightGray
osheet.Cells("M13").Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
osheet.Cells("M13").Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Thin
If Request.QueryString("P1") <> "" Then
osheet.Cells("C4").PutValue(Request.QueryString("P1"))
End If
'Add pack 1 header info
drsel = ds.Tables(0).Select("pack1PackDesc<>''")
If drsel.Length > 0 Then
osheet.Cells("C5").PutValue(drsel(0).Item("pack1Packdesc"))
osheet.Cells("C6").PutValue(drsel(0).Item("Pack1Cust"))
osheet.Cells("C7").PutValue(drsel(0).Item("Pack1RepName"))
osheet.Cells("C8").PutValue(drsel(0).Item("Pack1GroupName"))
osheet.Cells("C9").PutValue(String.Format("{0:MM\/dd\/yyyy}", Now()))
osheet.Cells("C10").PutValue(drsel(0).Item("Pack1basedon"))
osheet.Cells("F10").PutValue(drsel(0).Item("Pack1Price"))
osheet.Cells("F10").Style.Font.IsBold = True
End If
drsel = ds.Tables(0).Select("pack2basedon<>''")
If drsel.Length > 0 Then
osheet.Cells("J10").PutValue(drsel(0).Item("Pack2BasedOn"))
End If
i = 14
'Add details
For Each dr In ds.Tables(0).Rows
'Add pack 1 details
If dr.Item("pack1qty") = 0 Then
osheet.Cells("A" & i).PutValue("")
Else
osheet.Cells("A" & i).PutValue(dr.Item("pack1qty"))
End If
If dr.Item("pack1qty") <> dr.Item("pack2qty") And (dr.Item("pack1Desc") <> "" And dr.Item("pack2Desc") <> "") Then
osheet.Cells("A" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("B" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("C" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("D" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("E" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("F" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("H" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("I" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("J" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("K" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("L" & i).Style.Font.Color = System.Drawing.Color.Red
osheet.Cells("M" & i).Style.Font.Color = System.Drawing.Color.Red
End If
osheet.Cells("B" & i).PutValue(dr.Item("pack1UM"))
osheet.Cells("C" & i).PutValue(dr.Item("pack1VendorPart"))
osheet.Cells("D" & i).PutValue(dr.Item("pack1Desc"))
osheet.Cells("E" & i).PutValue(dr.Item("pack1Vendor"))
osheet.Cells("F" & i).PutValue(dr.Item("pack1comp"))
'Add pack 2 details
If dr("pack2qty") = 0 Then
osheet.Cells("H" & i).PutValue("")
Else
osheet.Cells("H" & i).PutValue(dr.Item("pack2qty"))
End If
osheet.Cells("I" & i).PutValue(dr.Item("pack2UM"))
osheet.Cells("J" & i).PutValue(dr.Item("pack2VendorPart"))
osheet.Cells("K" & i).PutValue(dr.Item("pack2Desc"))
osheet.Cells("L" & i).PutValue(dr.Item("pack2Vendor"))
osheet.Cells("M" & i).PutValue(dr.Item("pack2comp"))
i += 1
Next
'Add detail section headers
i += 2
osheet.Cells("H" & i).PutValue("Items added to new pack that were previously single sterile(components and pricing are part of the new pack):")
osheet.Cells("H" & i).Style.Font.IsBold = True
osheet.Cells("H" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Violet
i += 1
osheet.Cells("H" & i).PutValue("For Information Only:")
osheet.Cells("H" & i).Style.Font.IsBold = True
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("H" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("A" & i).PutValue("Total Cost Items Pulled Sterile:")
osheet.Cells("A" & i).Style.Font.IsBold = True
osheet.Cells("A" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("F" & i).PutValue("Price:")
osheet.Cells("F" & i).Style.Font.IsBold = True
osheet.Cells("F" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("A" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("B" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("C" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("D" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("E" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("F" & i).Style.ForegroundColor = System.Drawing.Color.Violet
i += 1
'Add first colored section
For x = 0 To 4
osheet.Cells("A" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("B" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("C" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("D" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("E" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("F" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("F" & (i + x)).Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + x)).Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + x)).Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + x)).Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + x)).Style.Font.IsBold = True
osheet.Cells("H" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("I" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("J" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("K" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("L" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("M" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("N" & (i + x)).Style.ForegroundColor = System.Drawing.Color.Violet
Next
Dim strLeftTot As String = "F" & (i + 8)
osheet.Cells("D" & (i + 8)).PutValue("Total Cost:")
osheet.Cells("D" & (i + 8)).Style.Font.IsBold = True
osheet.Cells("D" & (i + 8)).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("F" & (i + 8)).Style.Font.IsBold = True
osheet.Cells("F" & (i + 8)).Formula = "=F10+SUM(F" & (i) & ":F" & (i + 4) & ")"
osheet.Cells("F" & (i + 8)).Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + 8)).Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + 8)).Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("F" & (i + 8)).Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
'Add additional quote components and quantities
drsel = ds.Tables(0).Select("pack1comp='' or ((pack1qty'')", "sort", DataViewRowState.CurrentRows)
Dim istart As Integer = i
If drsel.Length > 0 Then
For Each dr In drsel
osheet.Cells("H" & i).PutValue(dr.Item("pack2qty") - dr.Item("pack1qty"))
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("I" & i).PutValue(dr.Item("pack2UM"))
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("J" & i).PutValue(dr.Item("pack2VendorPart"))
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("K" & i).PutValue(dr.Item("pack2Desc"))
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("L" & i).PutValue(dr.Item("pack2Vendor"))
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("M" & i).PutValue(dr.Item("pack2comp"))
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Violet
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Violet
i += 1
Next
End If
If i - istart < 5 Then
i = i + (5 - (i - istart)) ' + 5))
End If
'Add another Header
i += 2
osheet.Cells("H" & i).PutValue("Items to be pulled separately with revised pack(Items Deleted): IF PREVIOUSLY PULLED:")
osheet.Cells("H" & i).Style.Font.IsBold = True
osheet.Cells("H" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("N" & i).PutValue("Price:")
osheet.Cells("N" & i).Style.Font.IsBold = True
osheet.Cells("N" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Pink
i += 1
'Add additional pack components and quantities
drsel = ds.Tables(0).Select("pack2comp='' or ((pack2qty'')", "sort", DataViewRowState.CurrentRows)
istart = i
If drsel.Length > 0 Then
For Each dr In drsel
osheet.Cells("H" & i).PutValue(dr.Item("pack1qty") - dr.Item("pack2qty"))
osheet.Cells("I" & i).PutValue(dr.Item("pack1UM"))
osheet.Cells("J" & i).PutValue(dr.Item("pack1VendorPart"))
osheet.Cells("K" & i).PutValue(dr.Item("pack1Desc"))
osheet.Cells("L" & i).PutValue(dr.Item("pack1Vendor"))
osheet.Cells("M" & i).PutValue(dr.Item("pack1comp"))
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Pink
i += 1
Next
End If
If i - istart < 3 Then
For x = 1 To 3 - (i - istart)
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Pink
i += 1
Next
End If
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.Pink
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Font.IsBold = True
osheet.Cells("N" & i).Formula = "=SUM(N" & istart & ":N" & (i - 1) & ")"
Dim strRightAdd As String = "N" & i
i += 2
osheet.Cells("H" & i).PutValue("Items Used & No Longer Pulled: For Information Only:")
osheet.Cells("H" & i).Style.Font.IsBold = True
osheet.Cells("H" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
For x = 0 To 2
osheet.Cells("H" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("I" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("J" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("K" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("L" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("M" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
osheet.Cells("N" & i).Style.ForegroundColor = System.Drawing.Color.SkyBlue
i += 1
Next
i += 2
osheet.Cells("K" & i).PutValue("Total Cost:")
osheet.Cells("K" & i).Style.Font.IsBold = True
osheet.Cells("K" & i).Style.Font.Underline = Aspose.Excel.FontUnderlineType.Single
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Formula = "=M10+" & strRightAdd
osheet.Cells("N" & i).Style.Font.IsBold = True
Dim strRightTot As String = "N" & i
i += 3
osheet.Cells("K" & i).PutValue("Cost Increase/Decrease:")
osheet.Cells("K" & i).Style.Font.IsBold = True
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.TopBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.BottomBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.LeftBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Style.Borders(Aspose.Excel.BorderType.RightBorder).LineStyle = Aspose.Excel.CellBorderType.Medium
osheet.Cells("N" & i).Formula = "=" & strRightTot & "-" & strLeftTot
osheet.Cells("N" & i).Style.Font.IsBold = True
How many rows of data are there in your DataTable? I think the way of set formattings consumes too much memory and caused this problem. Please check https://forum.aspose.com/t/118662 for reference.
Please try the following two approaches to solve this problem:
1. Increased the memoryLimits to 90% for aspnet_wp in the machine.config file.
2. Change the style setting code. Please check Data Formatting for reference.
I did the above and still have tthe same issue.
I am deploying this along with the project to a file share. Am I deploying this properly?
Since it works fine in your dev machine, I do think it’s a deployment problem. Does the error occur everytime when you run the program? Could you tell me how you deploy your application?
Sorry, I have my dev machine and we have what we call a dev server that we publish to. I published to the dev server by copying the project (copy to a file share, only the files needed for the project) from within visual studio. I performed the same operation when publishing to our production server.
As far as the error goes I am using the application in 2 spots on the site and the error occurs in both places.
I had our network team look at the 2 servers and found that the OS patches are not the same. That will be corrected by Thursday morning. They will put all of the patches on the Dev server today and then sync up production tomorrow.
A couple questions:
Could this be an authorizations issue? (I gave the correct permissions to the MachineKeys directory I saw in another post)
Our production web server is outside our firewall could that be an issue?
Do I need to install aspose on the production server (I didn't think that was necessary, but I'm running out of ideas)
I have never met such a problem before. Could you please post the error screenshot here?
1. Please check http://www.dotnet247.com/247reference/msgs/54/273045.aspx and http://www.dotnet247.com/247reference/msgs/44/224210.aspx .
They may help you to figure out the error.
2. I don’t know but I don’t think it’s the cause of error.
3. You don’t need to install aspose. Copying all related files is enough.
Is there a document that specifies the files needed for deployment (all I have deployed are the dll, xml file and the license file) and the system requirements.
Could I have the wrong license agreement? We purchased the Developer Enterprise subscription.
Just the dll and license file are enough. XML file is used to facilitate your development.
Does the program fail at setting license? If yes, please assign enough right for your web application to access the license file.
I initially was setting the license after the user logged in and the license was being set, but the same error was occuring.
If the license was being set properly I would have received an error that user could not log in (I have seen this one before in my testing).
I changed it later to only set up the license when we needed it and then setting it to nothing, thinking this might fix the problem, and it did the same thing.
As far as authorizations go everyone has full control on directory containing the license file and the directory containg the dll.
Both of these ways work on the dev server.
What authorization do we need to run Aspose?
You can set license at the start of your application and you just need to set it once.
And you can try to deploy Aspose.Excel.dll in your GAC.
If I am setting the license at login will there be a licensing issue?
Can you give me instructions on adding the dll to my GAC?
By the way, thanks for all of your help so far, you have been very responsive.