Results 1 to 2 of 2

Thread: Displaying Start Date and End Date in Report Header

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2007
    Posts
    9

    Displaying Start Date and End Date in Report Header

    hi
    i'm using VS2005 and vb; and Access Database;
    i want to display Start Date and End Date from user input(textbox) on Report Header like that "Report Period from 1/2/2007 to 2/2/2007 "
    how can i ?

  2. #2
    New Member
    Join Date
    May 2007
    Posts
    1

    Smile Re: Displaying Start Date and End Date in Report Header

    Use this code in vb 6.0 for displaying Start Date and End Date in Report Header

    cr1.Formulas(0) = "DateFrom = '" & Format(dtpFrom.Value, "dd-MMM-yyyy") & "'"
    cr1.Formulas(1) = "DateTo = '" & Format(dtpTo.Value, "dd-MMM-yyyy") & "'"
    comment- here database 'DateFrom and 'DateTo' are formula fields in crystal report,before using it create these formulas in crystal report using same name as written and don't type anything in them and save these formulas then type this code in vb

    cr1.ReportFileName = App.Path & "\Reports\rptname.rpt"
    cr1.SelectionFormula = "{LedgerEntry.DateofEntry}>=Date(" & dtpFrom.Year & "," & dtpFrom.Month & "," & dtpFrom.Day & ") AND {LedgerEntry.DateofEntry}<=Date(" & dtpTo.Year & "," & dtpTo.Month & "," & dtpTo.Day & ") AND {PartyMaster.PartyCode}='" & Trim(gridParty.TextMatrix(gridParty.RowSel, 0)) & "'"
    cr1.Action = 1
    cr1.PageZoomNext

    I hope this will solve ur problem.
    Jyoti Jain

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