VB Crystal Report >> Display Passed in parameters into CR Report

by harry » Thu, 14 Apr 2005 08:50:17 GMT

Hi all

I am writing a report that allows a user to enter a date range as
parameters. How can I display the date range on the report Title? (i.e
Profit Report 1-Jan-2005 to 31-Jan-2005).

I am using VisualStudio 2003 and VB.NET
Thanks

Harry




VB Crystal Report >> Display Passed in parameters into CR Report

by dave » Thu, 14 Apr 2005 09:21:03 GMT


If your parameter is set up as a Range, and the Report Title is saved
with the report file, then try this formula:

ReportTitle + " " + ToText(Minimum({?DateRange}), "d-MMM-yyyy") + " to "
+ ToText(Maximum({?DateRange}), "d-MMM-yyyy");

If you don't have the report title necessarily saved with the report,
create the formula like this, then drag it onto the report canvas next
to the Title:

ToText(Minimum({?DateRange}), "d-MMM-yyyy") + " to " +
ToText(Maximum({?DateRange}), "d-MMM-yyyy");

If you're not using a Range parameter, but are using two separate Date
params:

ToText({?BeginDate}, "d-MMM-yyyy") + " to " + ToText({?EndDate},
"d-MMM-yyyy");

-dave



Similar Threads

1. Pass Parameter from Main Report to Sub-Report via VB6 to CR8.5 - VB Crystal Report

2. How do I pass parameters to a report created in VB6.0 report designer

I need a  report based on a query stored in a .MDB Database
the query has an input requirement of Student_ID. which returns only
those rows containing THAT student



if I remove the input parameter, that report just shows ALL Students!

I need to pass the Student_ID parameter from VB6.0 to the report at
runtime..

Thank for any help

Randy





3. Passing parameters to CR (ASP.NET) - VB Crystal Report

4. How to pass more then one parameter to CR.NET

Hi all,

I need some help.  I can pass a parameter to my Crystal Report Viewer; but I
am stumped on how to pass more than one parameter.  Below is what I am using
right now to pass a parameter that feeds a parameter of a Stored Procedure:

'CRV is the CrystalReportViewer Object Name
 'Create the parameter
            Dim ParameterFields As CrystalDecisions.Shared.ParameterFields
            Dim ParameterField As CrystalDecisions.Shared.ParameterField
            Dim ParameterRangeValue As
CrystalDecisions.Shared.ParameterRangeValue
            Dim pvSP As CrystalDecisions.Shared.ParameterDiscreteValue
            ParameterFields = New CrystalDecisions.Shared.ParameterFields()
            ParameterField = New CrystalDecisions.Shared.ParameterField()
            ParameterField.ParameterFieldName = "@fltr"
            pvSP = New CrystalDecisions.Shared.ParameterDiscreteValue()
            pvSP.Value = Fltr$

            ParameterField.CurrentValues.Add(pvSP)

            ParameterFields.Add(ParameterField)
            CRV.ParameterFieldInfo = ParameterFields

'Below is a feeble attempt at an example of trying to pass another parameter
to my report.
'I created the parameter on the report called "@MGRFilter".  I am just
trying to pass a name to a textbox on the report.

            'Dim pvMGR As CrystalDecisions.Shared.ParameterDiscreteValue
            'ParameterField.ParameterFieldName = "@MGRFilter"
            'pvMGR.Value = fltrMGR$
            'ParameterField.CurrentValues.Add(pvMGR)

Any advice would be appreciated.
Thanks,
John.


5. Passing parameter to subreport in CR 7 - VB Crystal Report

6. Passing parameter to subreport in CR 8.5

I have a report with a subreport, both use a timestamp parameter.

I copy the report file to a 2nd directory. I set up the parameters of
the main report. I then use the following to set up the parameters of
the sub-report. It appears to execute ok, but in the output report
file, the subreport does not show up (suppressed because it is blank).
If I refresh the report and enter the parameters it appears ok, so it
is not the data.

Dim crpParameterField As CRPEAuto.ParameterFieldDefinition
Set crpParameterField = crpReport.ParameterFields("@timestamp",
PackingListSubReport.rpt")
crpParameterField.SetCurrentValue timestamp

(timestamp is a string and is valid as it is also used in the main
report which formats correctly)
(@timestamp is the parameter name and PackingListSubReport.rpt is the
subreport name)

Any help or ideas?

7. CR within .NET - Passing parameter at run-time - VB Crystal Report

8. Passing date parameter to CR 9 ?

How can I pass a date paramater to CR 9 through VB ?

I tried using:

crRpt.ParameterFields.GetItemByName("Date1").AddCurrentValue
CDate("12/31/2001 12:00:00 AM")

But its not working.

Any idea please ?

Best Regards,

Luqman