Passing parameter field variable to report 
Author Message
 Passing parameter field variable to report

New problem !

How do I create a formula in C.R. to display the date that I have used
in the selection criteria to be shown on the page (I want the title to
show XXX report From --/--/-- To --/--/--)



Sun, 11 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report
Chris,

Try this!

Set up a formula field in your report.  Leave it blank.
Then:

test = "terry"
CrystalReport1.Formulas(0) = "myformula= 'test'"

where myformula = formula in report you are trying to change & test =
string you are sending. Note the single quotes around the string.

Hope this helps!
Terry



Quote:
> New problem !

> How do I create a formula in C.R. to display the date that I have used
> in the selection criteria to be shown on the page (I want the title to
> show XXX report From --/--/-- To --/--/--)



Mon, 12 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report

says...

Quote:
> How do I create a formula in C.R. to display the date that I have used
> in the selection criteria to be shown on the page (I want the title to
> show XXX report From --/--/-- To --/--/--)

In 6, you can just drag the parameter fields into your Text object. If
you are using the VB version, I can't check the answer....
--
Garrett Fitzgerald
UNICOM, Providence, RI
#INCLUDE "\Program Files\Microsoft Visual Studio\VFP98\StdDsclm.h"
(ICQ: 7360952)


Mon, 12 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report
It looked like it was going to help, but I get the following problem.

Runtime Error 20510
Invalid Formula name

The code I am using is as follows

Dim Startdate, EndDate as String

StartDate=txtStart.text
EndDate=txtEnd.text

CReport.Formulas(0)="mystart='startdate'"

I also tried to add
CReport.Formulas(1)="myend='EndDate'"

Still the above problem occurs
I also tried
CReport.Formulas(0)="mystart=startdate"
and
CReport.Formulas(0)="myformula='startdate'"

I pressed F1 on Formulas, but it wanted developr.hlp which I don't
seem to be able find.

Any help, gratefully received.
 Chris

Quote:

>Chris,

>Try this!

>Set up a formula field in your report.  Leave it blank.
>Then:

>test = "terry"
>CrystalReport1.Formulas(0) = "myformula= 'test'"

>where myformula = formula in report you are trying to change & test =
>string you are sending. Note the single quotes around the string.

>Hope this helps!
>Terry



>> New problem !

>> How do I create a formula in C.R. to display the date that I have used
>> in the selection criteria to be shown on the page (I want the title to
>> show XXX report From --/--/-- To --/--/--)



Mon, 12 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report
unfortunately I am using VB5


Quote:


>says...
>> How do I create a formula in C.R. to display the date that I have used
>> in the selection criteria to be shown on the page (I want the title to
>> show XXX report From --/--/-- To --/--/--)

>In 6, you can just drag the parameter fields into your Text object. If
>you are using the VB version, I can't check the answer....



Mon, 12 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report

to_date, * from .....

Billy Lau


Quote:
>unfortunately I am using VB5




>>says...
>>> How do I create a formula in C.R. to display the date that I have used
>>> in the selection criteria to be shown on the page (I want the title to
>>> show XXX report From --/--/-- To --/--/--)

>>In 6, you can just drag the parameter fields into your Text object. If
>>you are using the VB version, I can't check the answer....



Thu, 15 Mar 2001 03:00:00 GMT  
 Passing parameter field variable to report
Sorry, I'm being thick here.

What is the .... after the from

I have included the code blow from VB5 for one of my reports. As you
will see I already have some selection criteria in there for the
dates, which works fine.  All I want to do is to pass the date into
the report heading.

Private Sub cmd1_Click()
On Error GoTo cmd1_clickERR

Dim StartDate, EndDate, Low, High As String
Dim RecordDate, RecSelect As String

    StartDate = txtFrom.Text
    EndDate = txtTo.Text

    Low = "Date(19" & Right$(StartDate, 2) & "," & Mid$(StartDate, 4,
2)
    Low = Low & "," & Left$(StartDate, 2) & ")"

    High = "Date(19" & Right$(EndDate, 2) & "," & Mid$(EndDate, 4, 2)
    High = High & "," & Left$(EndDate, 2) & ")"

    RecordDate = "{CONTRACT.start}"
    If gCmd1_date = True Then
            RecSelect = RecordDate & " in " & Low & " to " & High
        Else
            RecSelect = ""
    End If

    If chkDealer.Value = 1 And gCmd1_Dealer = True Then
        cboDealerID.ListIndex = cboDealer.ListIndex
        RecSelect = RecSelect & " AND {CONTRACT.dealer} = " &
cboDealerID.Text
    End If
    CRgeneral.ReportFileName = RepPat & gCmd1_Report
    CRgeneral.DataFiles(0) = DBpath + "\fm.mdb"
    CRgeneral.SelectionFormula = RecSelect$
    CRgeneral.Action = 1
Exit Sub
cmd1_clickERR:
    MsgBox Err.Description, vbInformation
End Sub



Quote:

>to_date, * from .....

>Billy Lau


>>unfortunately I am using VB5




>>>says...
>>>> How do I create a formula in C.R. to display the date that I have used
>>>> in the selection criteria to be shown on the page (I want the title to
>>>> show XXX report From --/--/-- To --/--/--)

>>>In 6, you can just drag the parameter fields into your Text object. If
>>>you are using the VB version, I can't check the answer....



Mon, 19 Mar 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Passing a variable from VB.NET to a Crystal report parameter or formula with no prompt

2. How to pass parameter field from VB to crystal report

3. How can I pass parameter field in VB6 to crystal report?*******

4. Passing Parameters from C# to Crystal Report / Crystal Report Viewer

5. Passing parameters to a report in Crystal Reports 6

6. passing variables from report to a sub report

7. Global Variable passed to Parameter

8. Passing a variable as the parameter for a query

9. Passing a Variable Parameter

10. Passing a variable type parameter to an .asp file

11. Passing variables/parameters between forms - newbie question

12. Passing variable value as parameter

 

 
Powered by phpBB® Forum Software