Hi everybody,
I like to display start date and end date selected on the crystal report. How would I
do that, declare what type of field, and how would I transfer the value from code to the
crystal report
Related to link:
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=322645&SiteID=1&mode=1
den2005

Display selected data on crystal report
samitha
can u give your working enviorment details i.e.
Crystal Report version, VS version etc.
RedSox75
Hi,
I am a domain account to access local pc, and sql database I am accessing located in other pc within the network.
Dennis
gmone
Thanks, I did used that and still no data displayed on teh crystal report. I put the code here below.
[code]
Dim crReportDocument As New ITPReport1D()
Dim StartDateText As CrystalDecisions.CrystalReports.Engine.TextObject = CType(crReportDocument.ReportDefinition.ReportObjects.Item("StartDate"), CrystalDecisions.CrystalReports.Engine.TextObject)
StartDateText.Text = String.Format("{0}/{1}/{2}", Me.dddFrom.Month, Me.dddFrom.Day, Me.dddFrom.Year)
Dim EndDateText As CrystalDecisions.CrystalReports.Engine.TextObject = CType(crReportDocument.ReportDefinition.ReportObjects.Item("EndDate"), CrystalDecisions.CrystalReports.Engine.TextObject)
EndDateText.Text = String.Format("{0}/{1}/{2}", Me.dddTo.Month, Me.dddTo.Day, Me.dddTo.Year)
crReportDocument.SetDataSource(DataSet)
Dim crConnectionInfo As New ConnectionInfo()
With crConnectionInfo
.ServerName = "<server name>"
.DatabaseName = "<database name>"
.UserID = "sa"
.Password = ""
End With
Dim crDatabase As Database = crReportDocument.Database
Dim crTables As Tables = crDatabase.Tables
Dim crTable As Table
Dim crTableLogOnInfo As TableLogOnInfo
'Apply the logon information to each table in the collection
For Each crTable In crTables
crTableLogOnInfo = crTable.LogOnInfo
crTableLogOnInfo.ConnectionInfo = crConnectionInfo
crTable.ApplyLogOnInfo(crTableLogOnInfo)
Next
Me.crvITPReport.ReportSource = crReportDocument
Me.crvITPReport.RefreshReport()
[\code]
You mentioned:
1st u have to insert textbox in Crystal Report & give name e.g. StartDateTextBox & then in VB Code u assign values by following way
Is there a textbox May be you mean Text object and name them "StartDate" and "EndDate".
And when the crystal report is viewed. There is no data display. I checked the dddFrom control and dddTo control has values in them. What is wrong
dennis
Joe Tarsha
Unfortunately no data is being displayed to either the startdate or end date text object in the crystal report.
dennis
Sabie
1st u have to insert textbox in Crystal Report & give name e.g. StartDateTextBox & then in VB Code u assign values by following way
Dim Rpt As New CrystalReport1
Dim ObjAchieved As CrystalDecisions.CrystalReports.Engine.TextObject = CType(Rpt.ReportDefinition.ReportObjects.Item("StartDateTextBox"), CrystalDecisions.CrystalReports.Engine.TextObject)
ObjAchieved.Text = <Value>
Regards
HarishRavi
u r right not textbox it is text object
have u debug the same
r u getting object for startdate text object
let me know if i can help u for the same
ggpnetwork
This problem has been resolved.
Info on this helps solving the problem but incomplete.
den2005