Hi, im using crystal report on my project. It working very well but I just want o make it more flexible.
I have textobjects with of course text in it. They are not bound since they are just additional information on my report. How can i make those textobject editable during runtime? Something like on mouse click, i may able to edit it like in what we do in design? do i need to add program in my project? Im using vb.net 2010

I use this code to call my report

Dim sett As New DataSet1
Dim oRpt As New Accountability
Dim obj As CrystalDecisions.CrystalReports.Engine.TextObject
obj = oRpt.ReportDefinition.Sections("Section5").ReportObjects.Item("txtRel")
    'Connection code, sql query here

Rpt.SetDataSource(dta)
frmReport.CrystalReportViewer1.ReportSource = oRpt
frmReport.CrystalReportViewer1.RefreshReport()
frmReport.Show()

I textobject i need to edit is not bound. Its created during design time

Thanks for helping

Try building a custom handler for it.

'Declare the textbox as so:
Dim WithEvents txtBox1 As New TextBox

Private Sub txtBox1_MouseDown(sender As Object, e As Windows.Forms.MouseEventArgs) Handles txtBox1.MouseDown
    If e.Button = Windows.Forms.MouseButtons.Left Then
        MsgBox("Left mouse button was pressed!")
    ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
        MsgBox("Right Mouse Button was pressed!")
    ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then
        MsgBox("Middle mouse button pressed.")
    Else
        MsgBox("The button pressed was: " & e.Button.ToString)
    End If
End Sub

Or you can add the handlers manually:

AddHandler txtBox1.MouseDown, AddressOf txtBox1_MouseDown

Private Sub txtBox1_MouseDown(sender As Object, e As Windows.Forms.MouseEventArgs)
    If e.Button = Windows.Forms.MouseButtons.Left Then
        MsgBox("Left mouse button was pressed!")
    ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
        MsgBox("Right Mouse Button was pressed!")
    ElseIf e.Button = Windows.Forms.MouseButtons.Middle Then
        MsgBox("Middle mouse button pressed.")
    Else
        MsgBox("The button pressed was: " & e.Button.ToString)
    End If
End Sub

Edited 3 Years Ago by Begginnerdev

Hi, Thanks for the reply. But what im trying to do is to eidt a text object in my crystal report. It is embedded and created in my vb.net project.It is not loaded from outside directory.
In creating crystal report (eg, Sales.rpt), design mode, we edit a textobject by double clicking it then type anything we want, Say the title of the report (eg. Monthly Sales), how can we do such editing like in design after the project has been published? Is it possible to do it? Editing the crystal report manually like in design mode?

thanks again

Edited 3 Years Ago by Lethugs

Parameter field can be use but it pops everytime i open the report. Im trying to do something like the normal textobject that can be edited maybe through double click. Its not like parameter that shows everytime the report is loaded. Do i need to make a program that opens crystal report in design mode? How will I do this

Thanks

Can anyone know how to make crystal report (rpt) editor? Please help

Thanks

This article has been dead for over six months. Start a new discussion instead.