Results 1 to 6 of 6

Thread: Crystal Reports - Dynamically add parameter link between subreport and main report

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    Kansas City
    Posts
    119

    Question Crystal Reports - Dynamically add parameter link between subreport and main report

    Hi everyone, here's my issue:

    I have a Crystal Report with a sub report in the page footer that has a parameter field. I know that to pass a parameter to a sub report you have to have a parameter on the main report and link the two parameters.

    My problem is that there are a number of different sub reports so they are added to the report at runtime based on the user's selection along with the parameter passed to the main report.

    How can I perform a link between the dynamically added subreport's parameter and them main report's parameter. I see that there is a .Links method under the properties of the subreport but I don't know how to use it and what format it's looking for. Here's my code of the addition of the subreport:

    VB Code:
    1. If Not IsNull(rsReports("Footer")) Then
    2.        'Page footer
    3.        Set crSection = CReport.Sections.Item("PFa")
    4.        crSection.Suppress = False
    5.        Set crSubReport = crSection.ImportSubreport(strRoot & "\" & rsReports("Footer"), 250, 100)
    6.        With crSubReport
    7.         .OpenSubreport
    8.         .LeftLineStyle = crLSSingleLine
    9.         .RightLineStyle = crLSSingleLine
    10.         .TopLineStyle = crLSSingleLine
    11.         .BottomLineStyle = crLSSingleLine
    12.         .KeepTogether = True
    13.        [COLOR=red].Links.Add.MainReportField ("?FootData")[/COLOR]        
    14.        End With
    15.       End If

    Any help or tips would be appreciated. Thanks a lot in advance.
    Scott

  2. #2
    Frenzied Member
    Join Date
    Apr 2003
    Location
    The Future - Skynet
    Posts
    1,157
    Did you ever find the answer to this? How did you do it with codes?
    I'll Be Back!

    T-1000

    Microsoft .Net 2005
    Microsoft Visual Basic 6
    Prefer using API

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Location
    Kansas City
    Posts
    119
    Sorry for the late reply. I never did find a solution to this or a workaround. I abandoned the subreports and moved on. Sorry.
    Scott

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    So what was the equilivalent solution in your other direction?
    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
    Lively Member
    Join Date
    Apr 2002
    Location
    Kansas City
    Posts
    119
    The parameters in my sub reports would have been nice but they weren’t required so I didn't persue in any further. I still have a sub report, I just don't send any parameters to it.
    Scott

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    Thanks, was just wondering.
    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