Help in VB.NET Crystal Report

1 view
Skip to first unread message

Manish Pithwa

unread,
May 3, 2006, 11:41:27 PM5/3/06
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
hi,

1. I want help on .NET Crystal Report to display data in Crystal
Report Viewer by supplying value in a variable to form a criteria to
fetch desired record from Dataset. can onyone tell me that how can I
retrieve criteria matching
records ? e.g. we give where clause in select query like
empcode='0002'. what is the code to make a paramaterized report in
which we can dynaymically select record when we supply value. I heard
abt RecordSelectionFormula but I don't know what's syntax to use it.
please help me. where can I find info abt Crystal Reports.

2. is it true that after regestring .NET inbuilt Crystal Report we can
use more features of it? or if we use Crystal Report as third party
component will be more benificail to use all features of it.

Thanks,
Manish Pithwa

jackmm

unread,
May 5, 2006, 8:03:23 AM5/5/06
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Manish, I am assuming that you have imported the required Crystal
namespaces. In this example I am passing a session variable but you
can pass any varialble, literal or value of a text box.

CrystalReportViewer1.SelectionFormula = "{Print_Req.Dir_ID}= '" &
Session("dir_id") & "'"

Print_Req is the database table name, Dir_ID is the field and
("dir_id") is of course my session variable that I am passing to
Crystal.

Along those lines, the following code logins into all the tables that
my Crystal report uses.

For Each dbTable In crPrintReq1.Database.Tables
dbLogin = dbTable.LogOnInfo
dbLogin.ConnectionInfo.Password = "'" & Session("Pword") & "'"
dbLogin.ConnectionInfo.UserID = "'" & Session("Uname") & "'"
dbTable.ApplyLogOnInfo(dbLogin)
Next


CrystalReportViewer1.ReportSource = crPrintReq1
I hope this helps some

Manish Pithwa

unread,
May 6, 2006, 5:37:01 AM5/6/06
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
thank you for this guidance.

Reply all
Reply to author
Forward
0 new messages