Hi
How can i send data from vb text box to crystal report text object directly

Recommended Answers

All 7 Replies

try this

With CrystalReport1
        .ReportFileName = App.Path & "\YourRPT.rpt"
        .Connect = "DSN=test;UID=sapest;PWD=sapest;DSQ=Sage;"
        .DiscardSavedData = True
        .RetrieveDataFiles
        .ReportSource = 0
        .SQLQuery = "Select * from yourtable"
        .ReportTitle = "Report Title"
        .Destination = crptToWindow
        .PrintFileType = crptCrystal
        .WindowState = crptMaximized
        .WindowMaxButton = False
        .WindowMinButton = False
 'if you want to filter report based on some parameter fields, you can use SelectionFormula property
        .SelectionFormula = "{table.field} =" & Trim(Txt.Text) & ""      
        .Action = 1
    End With

Hi,

What is your version of CR...?

Regards
Veena

My CR version is 8.5

Hi,

Open the Report in CR Designer and Inseret a New FormulaField and Place it on the report..
And from VB6 just before Viewing the report, write this code:

Report.FormulaFields(0).Text = "'" & Text1.Text & "'"

Regards
Veena

Hi,

You can also try this :

Report.FormulaFields.GetItemByName("MyFormulaname" ).Text = "'" & text1.text & "'"

Regards
Veena

Thanks For Help

plz mark it solve

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.