CrystalViewer Formula Field in VB.net
-
hi,,, I want to pass a value in a formula field in my report(Crystal Report 9) through Front-End. I am using CrystalReportViewer. Like in Vb 6.0 we used to write CrystalReport1.formulafields.item("formulaname").text = FormulaValue How to do this using vb.net and Crystalreportviewer??? thx Tasnim:zzz:
-
hi,,, I want to pass a value in a formula field in my report(Crystal Report 9) through Front-End. I am using CrystalReportViewer. Like in Vb 6.0 we used to write CrystalReport1.formulafields.item("formulaname").text = FormulaValue How to do this using vb.net and Crystalreportviewer??? thx Tasnim:zzz:
Something quite similar:
Dim rd As New ReportDocument
rd.Load("c:\MyReport.rpt")
rd.DataDefinition.FormulaFields.Item("FieldName").Text = "..."
crv.ReportSource = rdWhat a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
Something quite similar:
Dim rd As New ReportDocument
rd.Load("c:\MyReport.rpt")
rd.DataDefinition.FormulaFields.Item("FieldName").Text = "..."
crv.ReportSource = rdWhat a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
Thanks for your reply, But I am not using any Report Document. I have Crystal Report Viwer object on a form, and i am passing the reportsource through another form. My code is as below. Dim frm As New frm_reportviewer() ''' form which contains crviewer frm.CrViewer.ReportSource = Application.StartupPath & "\reports\rep_EFileStatusReport.rpt" frm.Show() What is the property of CrViewer to pass FormulaFields??? I am not getting it? thanks Tasnim
-
Thanks for your reply, But I am not using any Report Document. I have Crystal Report Viwer object on a form, and i am passing the reportsource through another form. My code is as below. Dim frm As New frm_reportviewer() ''' form which contains crviewer frm.CrViewer.ReportSource = Application.StartupPath & "\reports\rep_EFileStatusReport.rpt" frm.Show() What is the property of CrViewer to pass FormulaFields??? I am not getting it? thanks Tasnim
With a little research, it looks like your going to have to use a ReportDocument in order to do what you want. You create a ReportDocument using the code in the previous post, then pass the document to the CrystalReportViewer.ReportSource property so it can be viewed. Read the example given a little closer and you'll find your solution. RageInTheMachine9532
-
Thanks for your reply, But I am not using any Report Document. I have Crystal Report Viwer object on a form, and i am passing the reportsource through another form. My code is as below. Dim frm As New frm_reportviewer() ''' form which contains crviewer frm.CrViewer.ReportSource = Application.StartupPath & "\reports\rep_EFileStatusReport.rpt" frm.Show() What is the property of CrViewer to pass FormulaFields??? I am not getting it? thanks Tasnim
Yeah, what Dave said. You're not using the ReportDocument object, but you need to in order to access the FormulaFields collection. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.