Results 1 to 9 of 9

Thread: creating reports

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    5

    creating reports

    I really need some help please, My vb6 program works great for my boss, but he wants it to print reports, there are not numerical figures involved, most if not all text. How do I make an app as simple as this show a report capable of printing. (I have Crystal Report 8.5) Thanks.- kgambit


    Private Sub cmdPrint_Click()
    'this is supposed to show the report.
    End Sub

    Private Sub cmdSave_Click()

    'add a new entry the table.
    With Data2.Recordset
    .AddNew
    !CompliedBy = txtComplied
    !CaseNumber = DataCombo1.Text
    !Date = txtDate
    !OtherOfficers = txtOther
    !Subject = txtSubject
    !details = txtDetail
    !ReportNumber = txtReportNumber
    .Update
    End With
    Data2.Refresh

    End Sub

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: creating reports

    Welcome to the Forums.

    You can use your ADO rs set as the DataSource for your report if the recordset is what you want/need to display. I have an example in my signature.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    5

    Re: creating reports

    Thanks for the welcome and information, but could you epound some more on how to do it.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: creating reports

    Ok, but where is your data going to come from? Data2, database, textfile, controls on your vb form, etc.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    5

    Re: creating reports

    The data is comming from controls on the form and i want to be able to pull up data and print from the database too, but if i can pull the info from the form then I'll be okm with the rest

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: creating reports

    If you have a database and the info on the form is also from the db then its best to pull it from the db using ADO. Then we can set the DataSourceof the report to the recordset and be done, so to speak.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    5

    Re: creating reports

    Is there anywhere I can find a simple example of this or is it small enough you can explain please, because my program is working great, only waiting for the reports, either data report or crystal report 8.5, anyone will work great for me, because as I said its mostly text, no fomulas.

  8. #8
    Junior Member
    Join Date
    Jul 2005
    Location
    Pakistan
    Posts
    24

    Arrow Re: creating reports

    If you have simple text to report in vb then you can use the word automation and it is very easy to generate text reports in MS Word. I am also working on this path although beginner, but getting much. If you are interested, i can present my little help

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: creating reports

    Use CR's IDE to create a report as you would like to view it as. Then you can use the CR Viewer control in VB to open the report and populate its DataSource. The CR Viewer has buttons that can automatically print or export to a number of formats.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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