| | |
Passing a value to Crystal Reports fields
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Aug 2009
Posts: 44
Reputation:
Solved Threads: 0
I've asked few similar questions 'til now but here's one more.
Well, I have example of Crystal Report document, in that document I have 3 fields from 2 tables (loaded from my database). What I'm trying to do is to access one of those fields (year field) programmaticly and pass only one value...let's say I only want to show year "2006."
I've tried different things but nothing works 'til now. Last thing I've tried is this code:
So, with this, I can access to the field i want...but I don't know how to set or get any of his value...this code above only gets name of that field, I just put that for an example.
I just want to do next: give user a chance to print different reports for different years, and I want to have some combobox menu...hope someone could help me. thanks
Well, I have example of Crystal Report document, in that document I have 3 fields from 2 tables (loaded from my database). What I'm trying to do is to access one of those fields (year field) programmaticly and pass only one value...let's say I only want to show year "2006."
I've tried different things but nothing works 'til now. Last thing I've tried is this code:
VB.NET Syntax (Toggle Plain Text)
Dim report As New Report123 rep03.Section3.ReportObjects.Item("Field1").Name.ToString
So, with this, I can access to the field i want...but I don't know how to set or get any of his value...this code above only gets name of that field, I just put that for an example.
I just want to do next: give user a chance to print different reports for different years, and I want to have some combobox menu...hope someone could help me. thanks
Last edited by Peric; 31 Days Ago at 5:15 pm.
•
•
Join Date: Aug 2009
Posts: 44
Reputation:
Solved Threads: 0
0
#2 31 Days Ago
Anyone, please?
maybe this example is even closer...
but I don't know what to do after this
maybe this example is even closer...
VB.NET Syntax (Toggle Plain Text)
Dim aad As CrystalDecisions.CrystalReports.Engine.FieldObject aad = rep03.ReportDefinition.ReportObjects.Item("field1")
but I don't know what to do after this
•
•
Join Date: Aug 2009
Posts: 44
Reputation:
Solved Threads: 0
0
#3 31 Days Ago
in the end, i will use this, it gives me result that i've been looking for:
VB.NET Syntax (Toggle Plain Text)
Reports_Dialog.CrystalReportViewer1.SelectionFormula = "{Season.Year} = '2006.'"
•
•
Join Date: Aug 2009
Posts: 44
Reputation:
Solved Threads: 0
0
#4 22 Days Ago
Well, as I said it...I found out how to change some things in Crystal Reports...but I need one more thing.
When i'm sending value to a textObject I have something like this:
and this works great...
but I want to change picture in Crystal Reports, i'm trying something like this:
After that i'm trying to give that PictureObject some kind of path or something, but i don't have that option.
Does anyone know how to do this??? Thank you
When i'm sending value to a textObject I have something like this:
VB.NET Syntax (Toggle Plain Text)
Dim name As CrystalDecisions.CrystalReports.Engine.TextObject name = Report1.ReportDefinition.ReportObjects.Item("textImePrezime") name.Text = dtName.Rows(0).Item(0)
and this works great...
but I want to change picture in Crystal Reports, i'm trying something like this:
VB.NET Syntax (Toggle Plain Text)
Dim picture As CrystalDecisions.CrystalReports.Engine.PictureObject picture = Report1.ReportDefinition.ReportObjects.Item("Picture3")
After that i'm trying to give that PictureObject some kind of path or something, but i don't have that option.
Does anyone know how to do this??? Thank you
•
•
Join Date: Sep 2009
Posts: 303
Reputation:
Solved Threads: 43
0
#5 21 Days Ago
CR has always seemed difficult to use, the documentation for it is very difficult to understand or even find what you are looking for. I dont think the lack of responses are due to your questions just that most have a problem working with CR themselves.
As for passing parameters, I would first create the parameter field on the report, say the name is "Par1". I would then call and pass the parameter value as follows:
rpt.Load
rpt.SetDataSource(myDataSet)
rpt.SetParameterValue("Par1", txtReportParameter.Text.Trim)
As far as passing a file path to load the picture, I dont think this can be done. Of course I would think that this would/should be possible but I havent seen a way of doing so, except what Ive shown you before as an example.
As for passing parameters, I would first create the parameter field on the report, say the name is "Par1". I would then call and pass the parameter value as follows:
rpt.Load
rpt.SetDataSource(myDataSet)
rpt.SetParameterValue("Par1", txtReportParameter.Text.Trim)
As far as passing a file path to load the picture, I dont think this can be done. Of course I would think that this would/should be possible but I havent seen a way of doing so, except what Ive shown you before as an example.
Last edited by TomW; 21 Days Ago at 9:34 am.
![]() |
Similar Threads
- Help :Crystal Reports passing parameters (C#)
- Crystal Reports Fields (C#)
- Passing Values to Crystal Reports using VB.NET,ADO.NET (VB.NET)
- Crystal Reports doesnt show proper output (VB.NET)
- Creating Dynamic Crystal Reports at runtime in .Net? (ASP.NET)
- Crystal Reports?? (VB.NET)
- How to send Multiple values for one formula field in crystal reports through vb.net? (ASP.NET)
- Crystal Reports in ASP.NET (ASP.NET)
- Open cash drawer using Crystal Reports (Legacy and Other Languages)
Other Threads in the VB.NET Forum
- Previous Thread: I need help
- Next Thread: For...Next statement
| Thread Tools | Search this Thread |
"crystal .net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic dosconsolevb.net eclipse editvb.net employees excel exists firewall forms html images isnumericfuntioncall listview map math memory mobile module msaccess mssqlbackend mysql navigate net number opacity open pan pdf picturebox picturebox2 port print printpreview record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure temp textbox timer timespan transparency txttoxmlconverter upload useraccounts usercontol vb vb.net vb.nettoolboxvisualbasic2008sidebar vba vbnet vista visual visualbasic visualbasic.net visualstudio.net web wpf wrapingcode xml





