Originally posted by BrianBischofYou only need to refresh the scema file if the underlying data structure changes. If you're just loading different data (but using the same fields), then you're okay to just keep passing the new dataset to the report.
Yes, you can assign any value to a text field.
Imports CrystalDecisions.CrystalReports.Engine
Dim MyText as TextObject
MyText = CType(ReportDocument.ReportDefinition.ReportObjects("Text3"), TextObject)
MyText.Text = "'" & ds.Table(0).Row(0).Item(0).ToString() & "'"
Make sure you surround and strings with the single quote, otherwise you get an error because it thinks you are trying to pass it a variable name.
Thanks for reply BrianBischof.
Though XMLSchema might be the solution but I don't have enough time now to prepare the schema.
Anyway, the code that you have given me is the one that i'm looking for though i had to instantiate a DocumentReport and point it to the CrystalReport file in order to access the Text3.
Dim oRpt As ReportDocument = New ReportDocument
oRpt.Load(Server.MapPath("BasicReport.rpt"))
Dim MyText As TextObject
MyText = CType(oRpt.ReportDefinition.ReportObjects("Text3"), TextObject)
MyText.Text = "This is my sample text"
CrystalReportViewer1.ReportSource = oRpt
I think I can already start from here. IMHO, i consider this forum as the best so far. A million thanks BrianBischof
. Keep it up.
Edited by jobejufranz - 04 Mar 2008 at 10:23pm