I am using spreadsheetgear
for my project. I have included the spreadsheetgear
by using NuGet
package and it is also showing in my reference list.
Severity Code Description Project File Line Suppression State Error BC30002 Type 'SpreadsheetGear.Drawing.Image' is not defined. devo.net F:\devo.net\DEVO\Dashboard.aspx 56 Active
Dim image As SpreadsheetGear.Drawing.Image = New SpreadsheetGear.Drawing.Image(shape)
Here is my code
<%@ Import Namespace="SpreadSheetGear.Drawing" %>
<a href="Compare.html">Compare.html</a><%@ Page Language="VB" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="no-cache" />
<title>.NET Spreadsheet Component Calculation Sample Using VB.NET and Microsoft Excel Compatible Spreadsheet Component for Microsoft .NET, ASP.NET, C#, VB.NET, XLS and Microsoft Visual Studio .NET</title>
<meta content=".NET spreadsheet component calculation sample using Visual Basic .NET and SpreadsheetGear, a royalty free Microsoft Excel compatible spreadsheet component for the Microsoft .NET Framework featuring the fastest and most complete calculation engine available. Create, read, modify, calculate and write Microsoft Excel workbooks from your Microsoft .NET, ASP.NET, C#, VB.NET and Microsoft Office solutions. Integrates with Microsoft Visual Studio .NET, including IntelliSense and Dynamic Help." name="description" />
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim stopWatch As New System.Diagnostics.Stopwatch()
stopWatch.Start()
' Open workbooks
Dim filenameMaster As String = Server.MapPath("Files/DEVO Engine.xlsx")
Dim filenameInput As String = Server.MapPath("Files/Versions/DEVO Input1.xlsx")
Dim filenameOutput As String = Server.MapPath("Files/Versions/DEVO Dashboard2.xlsx")
Dim workbookMaster As SpreadsheetGear.IWorkbook = SpreadsheetGear.Factory.GetWorkbook(filenameMaster)
Dim workbookInput As SpreadsheetGear.IWorkbook = SpreadsheetGear.Factory.GetWorkbook(filenameInput)
Dim workbookOutput As SpreadsheetGear.IWorkbook = SpreadsheetGear.Factory.GetWorkbook(filenameOutput)
' Copy Inputs to Master
Dim wsInput As SpreadsheetGear.IWorksheet
For Each wsInput In workbookInput.Worksheets
Dim InstInput As SpreadsheetGear.IRange = wsInput.UsedRange
Dim NameInput As String = wsInput.Name
Dim DestMaster As SpreadsheetGear.IRange = workbookMaster.Worksheets(NameInput).UsedRange
Dim type1 As SpreadsheetGear.PasteType = SpreadsheetGear.PasteType.ValuesAndNumberFormats
Dim operation1 As SpreadsheetGear.PasteOperation = SpreadsheetGear.PasteOperation.None
workbookMaster.Worksheets(NameInput).Unprotect("")
InstInput.Copy(DestMaster, type1, operation1, "False", "False")
Next
Dim DataMaster As SpreadsheetGear.IRange = workbookMaster.Worksheets("Data").UsedRange
Dim DataOutput As SpreadsheetGear.IRange = workbookMaster.Worksheets("Data").UsedRange
Dim type2 As SpreadsheetGear.PasteType = SpreadsheetGear.PasteType.ValuesAndNumberFormats
Dim operation2 As SpreadsheetGear.PasteOperation = SpreadsheetGear.PasteOperation.None
DataMaster.Copy(DataOutput, type2, operation2, "False", "False")
Dim shape As SpreadsheetGear.Shapes.IShape
For Each shape In workbookMaster.Worksheets("Data").Shapes
Dim image As SpreadsheetGear.Drawing.Image = New SpreadsheetGear.Drawing.Image(shape)
Dim size As System.Drawing.Size = image.GetSize()
Dim bitmap As System.Drawing.Bitmap = image.GetBitmap()
Dim Imagename As String = Server.MapPath("Files/Images/" & shape.Name & ".png")
bitmap.Save(Imagename, System.Drawing.Imaging.ImageFormat.Png)
'Dim Imageurl As String = "Files/" & shape.Name & ".png"
'SpreadsheetGear.Drawing.Image.ImageUrl = Imageurl
bitmap.Dispose()
Next
stopWatch.Stop()
Dim ts As TimeSpan = stopWatch.Elapsed
Dim elapsedTime As String = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10)
System.Diagnostics.Debug.Print("RunTime " + elapsedTime)
'Send data from Master to Output file
'Dim instance As SpreadsheetGear.IRange = workbookMaster.Worksheets("Data").UsedRange
'Dim destination As SpreadsheetGear.IRange = workbookOutput.Worksheets("Data").UsedRange
'Dim type As SpreadsheetGear.PasteType = SpreadsheetGear.PasteType.ValuesAndNumberFormats
'Dim operation As SpreadsheetGear.PasteOperation = SpreadsheetGear.PasteOperation.None
'workbookOutput.Worksheets("Data").Unprotect("")
'instance.Copy(destination, type, operation, "False", "False")
'workbookOutput.Save()
'Server.Transfer("OutputDashboard.html")
End Sub 'Page_Load
</script>
</head>
<body>
</body>
</html>
You must be using "SpreadsheetGear for .NET Standard" since, to date, this is the only product on NuGet that is offered by SpreadsheetGear.
SpreadsheetGear for .NET Standard does not offer an equivalent to SpreadsheetGear for .NET's
SpreadsheetGear.Drawing.Image
class due to the fact that .NET Standard 1.3 (and the newly-released 2.0) lacks System.Drawing libraries, whichSpreadsheetGear.Drawing.Image
depends on; and there are no alternative graphics libraries in .NET Standard (or built on .NET Standard) that could serve as a suitable substitute for which we could build a similarImage
class on top of.Note: I do work for SpreadsheetGear and we are interested in your thoughts on possible alternatives in this area of our .NET Standard product for future releases. Feel free to contact us at [email protected] to open further dialog on this topic.