Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

Trying to open more than 1 document on button click

$
0
0

Using the below code works for 1 Excel Spreadsheet but I need to populate and open 2 Excel and 2 Word documents based on a single button click.

Any ideas?

    Protected Sub btnDownload_Click(sender As Object, e As EventArgs) Handles btnDownload.Click
        'Get excel sheet
        Dim xlsVote5 As System.IO.FileInfo = New System.IO.FileInfo(Server.MapPath("~/App_Data/Templates/Vote5-CashflowStatement.xlsx"))

        Dim PRF As System.IO.FileInfo = New System.IO.FileInfo(Server.MapPath("~/App_Data/Templates/52936.xlsx"))

        Using pck As New ExcelPackage(xlsVote5)

            'Get access to worksheet
            Dim ws As ExcelWorksheet = pck.Workbook.Worksheets("Cashflow Statement")

            ws.Cells("C23").Value = "asdfasDF"

            ws.InsertRow(24, 1, 23)
            ws.Cells("H24").Formula = "=+F24-G24"

            'Write it back to the client
            Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
            Response.AddHeader("content-disposition", "attachment;  filename=Vote5-CashflowStatement.xlsx")
            Response.BinaryWrite(pck.GetAsByteArray())


        End Using

    End Sub


Viewing all articles
Browse latest Browse all 1288

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>