CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2014
    Posts
    3

    Smile Filter data in subreport based on a value passed from main report

    Hi All,
    In the crystal report that I have designed, has a main report and a subreport.
    A date value from main report has to be passed to the subreport and based on that date, the records should be filtered.
    What I have done is created a shared variable for this date value in the main report,like below. The value is pulled to report and is showing the correct value in main report.

    WhilePrintingRecords;
    shared datevar shdtvlu;
    shdtvlu:={@dtvlu1};


    Same has been created in subreport and is showing the date value, correctly,in the subreport.

    shared datevar shdtvlu;
    shdtvlu;


    Now the result in the subreport ,should be filtered ,based on this value.
    Records should be selected , which are less than this date value.

    Can anyone please guide me on this regard?

    Thanks to all the helping hands out there..
    Last edited by DV1983; December 24th, 2014 at 03:32 AM.

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Shared Variable in crystal report and filter data in subreport based on this valu

    Try using that shared variable in the "RecordSelectionFormula" of the subreport
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  3. #3
    Join Date
    Nov 2014
    Posts
    3

    Re: Shared Variable in crystal report and filter data in subreport based on this valu

    Quote Originally Posted by jggtz View Post
    Try using that shared variable in the "RecordSelectionFormula" of the subreport
    Hi JG,
    Thanks for the help.
    In Subreport the shared variable is not shown in the record selection formula.

  4. #4
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Shared Variable in crystal report and filter data in subreport based on this valu

    Well, then it's time to use Linked variables
    --- Linked Variables are easier than shared variables to select records
    --- because shared variables only work to select records in a subreport in WhilePrintingRecords

    see next link
    http://scn.sap.com/people/ashish.bam...l-reports-2008
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Tags for this Thread

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

Featured