VB.net print simple table form

WONG Tony 161 Reputation points
2021-05-04T03:55:11+00:00

i am new to VB.net. I have experience on asp.net(VB)

i wish to print a simple table at VB form by clicking a button

i find someone make use of Excel to print but i do not wish to install Office excel.

is it possible to make use of VB.net alone without additional software / plugin?

Thanks.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,668 questions
{count} votes

Accepted answer
  1. Xingyu Zhao-MSFT 5,361 Reputation points
    2021-05-10T05:43:17.527+00:00

    Hi @WONG Tony ,
    To print a html file, you can use WebBrowser control.
    For example:

        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click  
            WebBrowser1.DocumentText = System.IO.File.ReadAllText("your html file path")  
        End Sub     
        Private Sub WebBrowser1_DocumentCompleted(sender As Object, e As WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted  
            WebBrowser1.Print()  
        End Sub  
    

    Hope it could be helpful.

    Best Regards,
    Xingyu Zhao
    *
    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful