Directly Changable Report

I've a form and a Report. The report takes the datas in my db.mdb file. I have'nt got any problem of this situation. but I have to do another thing in my program. The topic of my report must be changeable. User can type a text in a textbox of my form and this text user typed must be written in my report as a topic. how can I do that ? Please help me somebody, and I'm so sorry for my English

[623 byte] By [nadir207] at [2008-1-7]
# 1

dont cry , dont cry . Please, please , please Big Smile.Your english is fine

Taake a parameter in Crystal Reports and set its value in Form.

ReportObject.SetParameterValue("ParameterName",Value);

use this formual, this will set your topic at runtime.Take the value from textbox on your form where user enters the topic.

captJackSparrow at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 2

In fact I managed your comment. but my program wants to enter the text from user when the report loading Actually I dont like that. I want that the user can enter his/her own text in a textbox in my form. and when he/she click a button, my report can appear, and doesn't ask another question. If you know how can I do that, please please please help me

nadir207 at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 3
Do as i told you above.

Also it seems you are getting a parameter window, there is another post around somewhere which tells how to supress parameter window.

captJackSparrow at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 4

thanks your answer. I did that you have told. But my .net2005 shows an error when the program running. my parameter textbox's name is : mytopictxt and my codes like that ;

Dim myreport As New MyCrystalReport1

myreport.SetParameterValue("mytopic", topictxt)

CrystalReportViewer1.ReportSource = myreport

topictxt is a variable that defined in a module as a public. As I told you, I have another form in my program. This form has a textbox that name is mytopicbox.

when a button clicks, my another form that includes a CrystalReportWiever appears.

What should I do? where should myreport.SetPa....bla bla code be written? in my form that includes textbox, or another form includes CrystalReportWiever1 ?

nadir207 at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 5

It should be written on form where you are creating object of your report

this code seems to be OK

Dim myreport As New MyCrystalReport1

myreport.SetParameterValue("mytopic",topictxt)

CrystalReportViewer1.ReportSource = myreport

"mytopic" - This should be parameter in your report ok.

pass value of textbox on first form to this variable "topictxt"

when you call your report , also pass value of TextBox from first form to second form so that value gets assigned to variable "topictxt"

captJackSparrow at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...
# 6

thank you very very much. you are one of the good guys I have ever seen. I managed it owing to you. thank you again thank you............
nadir207 at 2007-10-2 > top of Msdn Tech,Visual Studio,Crystal Reports for Visual Studio...

Visual Studio

Site Classified