Documente Academic
Documente Profesional
Documente Cultură
Remember Me?
New Posts FAQ Calendar Forum Actions Quick Links Advanced Search
VBForums Visual Basic Visual Basic .NET VS 2008 Send textbox text to crystal report
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to
proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Results 1 to 3 of 3
KRENAR
Send textbox text to crystal report
Thread Starter
Lively Member I created this crystal report.where i pass data from my datagridview to this report.
Featured
* Storing Data in the Cloud
Learn step-by-step how to set
cloud and use it within an applic
* Accessing Cloud Data using
Service
by this code:Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Learn to build a web service a
Handles Button5.Click that consumes your data that is
cloud.
* NEW: Windows Mobile Deve
CodeGuru has launched a new
Development Center with article
Windows Phone Apps, Windows
Dim ds As New DataTable more.
* HTML5 Development Cente
With ds Our portal for articles, videos,
.Columns.Add("Artikulli") HTML5, CSS3, and JavaScript
.Columns.Add("Cmimi")
.Columns.Add("Sasia")
.Columns.Add("DDV%") Click Here to Expand Forum to Fu
.Columns.Add("CmimiTotal")
End Sub
Now i want data frome some Textboxes in my Fimr3 examle to be sendet to this report.
http://www.vbforums.com/showthread.php?742963-Send-textbox-text-to-crystal-report 1/4
12/2/2014 VS 2008 Send textbox text to crystal report-VBForums
example those textboxes:
To be Added in crystal reports section 1 ( repory header) for example without using database only copy
the text from those textboxes to some textboxes created in this crystalreport.
IanRyder
Re: Send textbox text to crystal report
Fanatic Member
Hi,
You can do this by adding Parameters to your Crystal Report. You can then set those parameters at
Join Date: Jan 2013 runtime in your own code rather that letting Crystal Reports prompt you for those parameters when the
Location: Healing, UK report runs.
Posts: 913
So, create a Parameter on your report and let's call it "myReportCriteria" for this example and place it
wherever you want on your report. Then when you run your report you can use this code to set the
parameters using whatever objects types you want in your own project:-
vb.net Code:
1. Dim selectionCriteria as string = "Whatever You Want"
2.
3. 'Create a New instance of the Crystal Report
4. Dim myReport As New rptInvoiceList
5. 'Set the Reports DataSource and Set any Parameters that you want to p
ass to the Report
6. With myReport
7. .SetDataSource(invoiceDT)
8. .SetParameterValue("myReportCriteria", selectionCriteria)
9. End With
10. 'Show the report
Cheers,
Ian
BTW, It's important to set the DataSource before you set any parameters otherwise you will still be
prompted for those Parameters.
Last edited by IanRyder; Nov 15th, 2013 at 12:52 AM. Reason: Checked Version
KRENAR
Re: Send textbox text to crystal report
Thread Starter
Lively Member Thank you buddy.But i have done like this and its workin perfectly.\
http://www.vbforums.com/showthread.php?742963-Send-textbox-text-to-crystal-report 2/4
12/2/2014 VS 2008 Send textbox text to crystal report-VBForums
Dim T11 As CrystalDecisions.CrystalReports.Engine.TextObject
Dim T12 As CrystalDecisions.CrystalReports.Engine.TextObject
Dim T13 As CrystalDecisions.CrystalReports.Engine.TextObject
T = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text3")
T.Text = TextBox11.Text
T1 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text8")
T1.Text = "Adresa : " & TextBox12.Text
T2 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text9")
T2.Text = "Tel/Fax : " & TextBox13.Text
T3 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text10")
T3.Text = "Danocen Broj : " & TextBox14.Text
T4 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text11")
T4.Text = "Z-Smetka : " & TextBox15.Text
T5 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text13")
T5.Text = "DDV 5% : " & TextBox5.Text & " Den"
T6 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text14")
T6.Text = "DDV 18% : " & TextBox6.Text & " Den"
T7 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text15")
T7.Text = "TOTAL : " & TextBox2.Text & " Den"
T8 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text16")
T8.Text = TextBox1.Text & " F"
T9 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text18")
T9.Text = ComboBox1.Text
T10 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text21")
T10.Text = "Adresa : " & TextBox16.Text
T11 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text20")
T11.Text = "Tel/Fax : " & TextBox17.Text
T12 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text19")
T12.Text = "Danocen Broj : " & TextBox18.Text
T13 = rptDoc.ReportDefinition.Sections(1).ReportObjects("Text22")
T13.Text = "Z-Smetka : " & TextBox19.Text
rptDoc.SetDataSource(ds)
Me.CrystalReportViewer1.ReportSource = rptDoc
End Sub
But is there a way to print it directly when i pres a button to show the report in reportviewer button to
print it directly to the alredy selected printer name saved in a textbox.
I have putet a print dialog and when i pres the buton "select printer" then the printdialog1 show and
you select the printer and the name of that selected printer is saved in a textbox and to the database
so when i always when gona open my aplication the printer name will apear in that textbox.
So what i want is directkly to print this report to the selected printer name in that textbox.for example
the name of the printer is showed in the textbox10.text.
VBForums Visual Basic Visual Basic .NET VS 2008 Send textbox text to crystal report
Posting Permissions
You may not post new threads BB code is On
You may not post replies Smilies are On
You may not post attachments [IMG] code is On
You may not edit your posts [VIDEO] code is On
HTML code is Off
Forum Rules
http://www.vbforums.com/showthread.php?742963-Send-textbox-text-to-crystal-report 3/4
12/2/2014 VS 2008 Send textbox text to crystal report-VBForums
http://www.vbforums.com/showthread.php?742963-Send-textbox-text-to-crystal-report 4/4