noobtecno.blogg.se

Gembox spreadsheet insert pie chart
Gembox spreadsheet insert pie chart








Htotal = Htotal + osheet.Cells(RowCount, columnno).value ' sum the values from column 2 to 3 Dim columnno = 2 For columnno = 2 To 3 Dim Htotal As String = 0 Dim RowCount As Integer = 4 Do While RowCount <= R Osheet.Range( " A" & R & " :C" & R).BorderAround( 8) Osheet.Range( " A" & R & " :C" & R).Interior.ColorIndex = 5

gembox spreadsheet insert pie chart gembox spreadsheet insert pie chart

Osheet.Range( " A" & R & " :C" & R).Font.Bold = True XlAxisValue.Item().Ī = " Sale/Income" End With ' set style to show the totals ChartTitle.Text = " Sale/Income Bar Chart" ' set titles for Axis values and categories Dim xlAxisCategory, xlAxisValue As Excel.AxesĮ), Excel.Axes) ' set how you want to draw chart i.e column wise or row wise ' set data range for chart Dim chartRange As Excel.RangeĬhartRange = osheet.Range( " A3", " C" & R) ' xlLocationAsObject, osheet.Name) With oChart ' use the follwoing line if u want ' to draw chart on the default location ' ochart.Location(Excel.XlChartLocation. SQlReader = Nothing ' create chart objects Dim oChart As Excel.Chart ' populate data from DB Dim SQlQuery As String = " select * from Sales" Dim SQLCommand As New OleDbCommand(SQlQuery, conn)ĭim SQlReader As OleDbDataReader = SQLCommand.ExecuteReaderĭim R As Integer = 3 While SQlReader.Read Osheet.Range( " A3:C3").Font.Size = 10 ' columns heading Osheet.Range( " A3:C3").Interior.ColorIndex = 5 Osheet.Range( " A1").EntireColumn.AutoFit() Osheet.Range( " A1").Value = " Excel Automation With Charts" Osheet.Range( " A1:AZ400").Interior.ColorIndex = 2 This function is used to open the database connections:Ĭonsole.WriteLine( " Generating Auto Report") Oexcel.Visible = True ' this procedure populate the sheetĬhkexcel = False ' mail excel file as an attachment Loop End If ' to check the session of excel application

gembox spreadsheet insert pie chart

' leaving first sheet delete all the remaining sheets If S > 1 Then = True ' check total sheets in workboob Dim S As Integer = () ' set the application alerts not ' to be displayed for confirmation Oexcel = CreateObject( " Excel.Application") ' File name and path, here i used abc file ' to be stored in Bin directory in the sloution directoryįilename = & " abc.xls" ' check if file already exists then ' delete it to create a new file If File.Exists(Filename) ThenĬhkexcel = False ' create new excel application










Gembox spreadsheet insert pie chart