Results 1 to 12 of 12

Thread: [RESOLVED] Generating reports without Crystal reports in vb.net

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Resolved [RESOLVED] Generating reports without Crystal reports in vb.net

    How can we create a report in vb.net without using any crystal reports

    Regards
    Sajina

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Generating reports without Crystal reports in vb.net

    you could create your own custom report form

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Generating reports without Crystal reports in vb.net

    I'm not 100% sure what the support is in VB Express but in VS you can install SQL Server Reporting Services, which comes as part of the Advanced Services edition of the free SQL Server Express, and then build reports in VS. It think that previous version only supported report creation in VWD Express and not C# or VB Express but I'm not sure about 2010.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    can i generate the report output in html format

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Generating reports without Crystal reports in vb.net

    you can create an html document in code.
    where is your data coming from + what sort of output are you looking for?

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    data coming from SQL server database
    my report is kind of mark list which is showing first column as subject second column as first term marks third column as second term marks.

  7. #7
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    Re: Generating reports without Crystal reports in vb.net

    here's a simple example using a datatable + outputting an html table in a webbrowser:

    vb Code:
    1. Public Class Form1
    2.  
    3.     Dim dt As New DataTable
    4.  
    5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    6.  
    7.         dt.Columns.Add("c1")
    8.         dt.Columns.Add("c2")
    9.         dt.Columns.Add("c3")
    10.         dt.Columns.Add("c4")
    11.         dt.Columns.Add("c5")
    12.  
    13.         For r As Integer = 1 To 10
    14.             dt.Rows.Add(New Object() {"r" & r.ToString & "c1", "r" & r.ToString & "c2", "r" & r.ToString & "c3", "r" & r.ToString & "c4", "r" & r.ToString & "c5"})
    15.         Next
    16.  
    17.     End Sub
    18.  
    19.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    20.         Dim strBuilder As New System.Text.StringBuilder
    21.         strBuilder.Append("<table border='1' cellpadding='10' cellspacing='0'>")
    22.         For x As Integer = 0 To dt.Rows.Count - 1
    23.             strBuilder.Append("<tr>") 'Start the row
    24.             strBuilder.Append(String.Format("<td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td>", _
    25.                           dt.Rows(x).Item(0).ToString, dt.Rows(x).Item(1).ToString, dt.Rows(x).Item(2).ToString, dt.Rows(x).Item(3).ToString, dt.Rows(x).Item(4).ToString))
    26.             strBuilder.Append("</tr>")  'Finish the row
    27.         Next
    28.         WebBrowser1.DocumentText = strBuilder.ToString
    29.         'alternatively you can save strBuilder.ToString as html + show it in ie
    30.     End Sub
    31.  
    32. End Class

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    i have tried it with crystal reports but its showing first term marks on top of the page and secnd term marks as just below of the first term marks. but i want to display all in same level. i tried select expert but if i put a condition the all exam marks will goes for the same condition. pls help me out

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    ok let me try HTML code first

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    its showing error webbrowser1 is not declared

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Oct 2008
    Location
    India, Kerala, Calicut
    Posts
    242

    Re: Generating reports without Crystal reports in vb.net

    yes i resolve the issue now i want to try it with my db

  12. #12
    Hyperactive Member Max Peck's Avatar
    Join Date
    Oct 2007
    Posts
    384

    Re: Generating reports without Crystal reports in vb.net

    Quote Originally Posted by sanju4kk View Post
    How can we create a report in vb.net without using any crystal reports

    Regards
    Sajina
    Well, dunno if this is the kind of answer you're looking for but to avoid Crystal you might want to consider Active Reports. It's about $600 for a developer version but it is way slick. I bought my copy to go with VS2008 Standard and SQL Server 2008R2 (Express). Between those three things and a good icon and text editor I can make just about anything I want to.

    Otherwise, yeah, you can generate HTML but it will require a lot more work to get the report to look the way you want it to. Still ... HTML would be a competent solution.

    -Max
    The name's "Peck" .... "Max Peck"

    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." - Red Adair

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width