Protected Sub btn_print_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_print.Click Dim a As String = "" Dim dsExport As New DataSet() Dim tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) Dim dgGrid As New DataGrid() Dim xlWorkBook As Excel.Workbook Dim xlApp As Excel.Application = New Excel.Application 'Dim xls As Excel.Worksheet xlWorkBook = New Excel.Application().Workbooks.Add(True) xlWorkBook.Application.Visible = False Dim xls As Excel.Worksheet = CType(xlWorkBook.Worksheets(1), Excel.Worksheet) xls = xlWorkBook.ActiveSheet xls.Cells(3, 1) = ("Materials Received Note") xls.Range("A3").Resize(1, 9).Cells.HorizontalAlignment = 3 xls.Range("A3").Resize(1, 9).Cells.MergeCells = True xls.Cells(3, 1).font.size = 18 xls.Cells(3, 1).font.Bold = False : : : xls.Range("G17", "G39").Columns.AutoFit() xls.Range("A17", "A39").Columns.AutoFit() xls.Range("D11", "D15").Columns.AutoFit() xls.Range("A11", "B15").Columns.AutoFit() xls.Range("I11", "I15").Columns.AutoFit()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)