473,568 Members | 2,923 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Record Selection in Crystal Reports 9 using VB.net

16 New Member
How to use the record selection formula in CR9 programatically using vb.net? I have a combo box that displays the date. If I select date, I can generate a report based on the selected date. Thanks in advance
Nov 23 '07 #1
16 11623
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Pass this RecordSelection Formula to the Report:

Expand|Select|Wrap|Line Numbers
  1. m_Report.RecordSelectionFormula ="{MyTable.MyDateField} =Date(" & Format(Combo1.Text,"yyyy,mm,dd") & ")"
  2.  
Regards
Veena
Nov 23 '07 #2
freedom
16 New Member
Ah, I see, that's what Im missing, I acutally used that ".recordselecti onformula = Date & " combbox.text... .and it says a date-time is required here... I guess this is what Im missing. Thanks for your response. I check it out.
Nov 23 '07 #3
freedom
16 New Member
Hi Veena,
I tried to used this in my record selection, however, I received an error, "The ) is missing" when I checked it, any part here that I missed? thnks.

VB code:
CrystalReportVi ewer1.Selection Formula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"

Regards
Nov 26 '07 #4
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

For CR9, it .RecordSelectio nFormula.
Looks like, you have not declared the Report Object..
What code are you using to display the report...?
Check this :

m_Report.Select ionFormula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"


Regards
Veena
Nov 26 '07 #5
freedom
16 New Member
The "m_report" here you use is the Crystal Report viewer, right? I'm using CR9, tried to use the .RecordSelectio nFormula, but it's not working. I tried to use the previous post you have here but still to no avail. What do I miss here? Thanks
Nov 26 '07 #6
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Post your complete code here..
It will be easy for me to Identify..

Regards
Veena
Nov 26 '07 #7
freedom
16 New Member
Hi Veena,

Here is my code I used, I can't find what's seems to the error here, but everytime I used it, I encountered the error "The ) missing" . Thanks in advance

CrystalReportVi ewer1.ReportSou rce = New ReportName CrystalReportVi ewer1.ReportSou rce = ReportDocument
CrystalReportVi ewer1.Selection Formula = "{vTITO_Rpt.Wor kDate} In Date (" & Format(cmbxDate From.Text, "YYYY,MM,DD ") & ") To Date (" & Format(cmbxDate To.Text, "YYYY,MM,DD ") & ")"
CrystalReportVi ewer1.Show()

Regards
Nov 26 '07 #8
QVeen72
1,445 Recognized Expert Top Contributor
Hi,

Syntax of SelectionFormul a seems OK,
Did you check both the combo-boxes, have data..?
You may get error, if either one of them is Blank...

and FromDate < ToDate..?

Regards
Veena
Nov 26 '07 #9
freedom
16 New Member
Hi,

Yes, both combo boxes has data, I even tried to change the combo box to text box, inputting the date manuallu, but to no avail. Can we say that the code is ok?

Thanks
Nov 26 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
18842
by: Pierre | last post by:
Hi, Can anyone tell me how I can populate Crystal Reports, using a DataTable in C#? Regards, Pierre
0
1464
by: tomi | last post by:
Hi I'm using RDC for analyzing .rpt files. I need to output all sections, but by using Section.Name i get names like "Section1", "section2" while I'd like to have names like "Group Header a" a.s.o. I'm using Crystal version 10 with library CRAXDRT. Can anyone halp me? Thx alot tomi
1
1511
by: lmalavika | last post by:
Hi All, I need to display crystal Reports using ASP. The webserver hosting this will not have Crystal Reports installed on it. We had done a similar requirement in ASP.Net by using the crystal viewers provided in .Net. Can something similar be done in ASP. Can we use the same objects in ASP as in ASP.Net
0
1091
by: srivalli | last post by:
I am Sridhar In vb I use Crystal Reports for reporting but this if i call the crystal report then it displays once and exit but it dont show i call the Crystal report as Crystalreport1.action=1 If u know the answer please reply me
1
1701
by: zEE | last post by:
Hi, I'm facing an issue when I use the MicrosoftMail option for emailing the crystal report. My code is as follows - ReportDocument ReportFile = new ReportDocument(); ReportFile.Load(filename); ReportFile.SetDataSource(DataSet1); CrystalDecisions.Shared.ExportOptions myExportOptions;
2
10638
by: chyogesh76 | last post by:
i created a report in crystal report i am using it in vb6.0. while printing through vb it was printing in a4 size but i want make it custom size(small size 5'' X10"). how can i do. any one please help me to find it with kind heart.
4
6926
by: Smish | last post by:
please can ne1 guide me how to create a report by passing parameters by using crystal reports using c# thanx
1
2393
by: Roy Brown | last post by:
I am trying to use Crystal Reports X1 with Visual basic 6 and an Access 2003 database, I have downloaded an evaluation copy of Crystal Reports and have tried to run the sample code provided, this code doesn't work correctly for it says it can't load the report file. My main question is can I use CR X1 with VB6 or do I need a earlier version,...
1
2817
by: meshmeshaa | last post by:
hiii , really need help and quickly please... i have created a database using php and i need to get reports from this database using php code but i don't know how to make crystal reports using php ??!!!! can anyone plz send me a code to try it as really i have no time .... thanks in advance.
0
1567
by: ramkumar533 | last post by:
Hi All.. Now i am doing a Project related with students report. There i need to display the each student profile with his image.. The image location is stored in the database table. While i tried to retrieve the image location and load to the OLE Object , Which i have placed in the report to hold the image. But If i suppose...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.