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 ?
Printable View
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 ?
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