VB.net print simple table form

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

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.
1,825 questions
{count} votes

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

    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.

    No comments

0 additional answers

Sort by: Most helpful