Results 1 to 7 of 7

Thread: Dynamic Crystal reports in VB using Crystal Viewer control

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    76

    Unhappy Dynamic Crystal reports in VB using Crystal Viewer control

    hi,
    my problem is i m new to crystal reports. I have prepared a application in vb 6.0 which is used for printing bills. When enter all the particulars and press print the crystal viewer is showing only the first bill which was saved. wat i want wen i give the print command the viewer shud show the present bill, so it can be printed.



    thanks!!

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

    Re: Dynamic Crystal reports in VB using Crystal Viewer control

    Sounds like you have the report option "Save data with report" selected in CR.

    Moved from Classic VB forum.

    I also have a few examples in my signature on CR and VB6.
    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
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918

    Re: Dynamic Crystal reports in VB using Crystal Viewer control

    You need to pass Crystal a 'selection formula' which will display the records according to your criteria, eg
    VB Code:
    1. Dim Report As New CrystalReport1
    2.     Report.RecordSelectionFormula = "{mytable.myfield}='mycondition'"
    3.    
    4.     CRViewer91.ReportSource = Report
    5.     CRViewer91.ViewReport
    EDIT: Yes, good point RobDog. I think 'Save Data with Report' is the default setting. A trap for young players!
    Pete

    No trees were harmed in the making of this post, however a large number of electrons were greatly inconvenienced.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    76

    Re: Dynamic Crystal reports in VB using Crystal Viewer control

    Thanks guys, atleast i have sumthin 2 work on. will b lookin for ur help if there is any problem in crystal reports


    Thanks!!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Aug 2005
    Posts
    76

    Unhappy Re: Dynamic Crystal reports in VB using Crystal Viewer control

    Quote Originally Posted by RobDog888
    Sounds like you have the report option "Save data with report" selected in CR.

    Moved from Classic VB forum.

    I also have a few examples in my signature on CR and VB6.

    hi Rob

    i used ur code but the same problem is persisting, if i want to print a particular record , say for ex i want to invoice no C10002 from rest of all records or i have saved invoice no C10005 and i want to print it then wat shud we do?

    thanks!!

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

    Re: Dynamic Crystal reports in VB using Crystal Viewer control

    How are you setting your DataSource for the report? If by an ADO recordset then just filter the rs and set it to your reports datasource.
    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
    Lively Member
    Join Date
    Aug 2005
    Posts
    76

    Re: Dynamic Crystal reports in VB using Crystal Viewer control

    Quote Originally Posted by RobDog888
    How are you setting your DataSource for the report? If by an ADO recordset then just filter the rs and set it to your reports datasource.
    hi,
    thanx for replyin, but i m very sorry i didnt get u, i m also new to vb if u can explain wat u said earlier a little more it wud of gr8 help.



    thanx!!

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