Click here to Skip to main content
16,004,969 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralVB6 expression too complex Pin
aprx30-Sep-04 9:47
aprx30-Sep-04 9:47 
GeneralRe: VB6 expression too complex Pin
Dave Kreskowiak30-Sep-04 12:06
mveDave Kreskowiak30-Sep-04 12:06 
GeneralRe: VB6 expression too complex Pin
aprx1-Oct-04 0:44
aprx1-Oct-04 0:44 
GeneralRe: VB6 expression too complex Pin
Dave Kreskowiak1-Oct-04 2:46
mveDave Kreskowiak1-Oct-04 2:46 
Generalcrystal reporting in vb.net Pin
Britnt730-Sep-04 6:00
Britnt730-Sep-04 6:00 
GeneralRe: crystal reporting in vb.net Pin
Jim Matthews30-Sep-04 7:06
Jim Matthews30-Sep-04 7:06 
GeneralRe: crystal reporting in vb.net Pin
Britnt730-Sep-04 8:52
Britnt730-Sep-04 8:52 
GeneralRe: crystal reporting in vb.net Pin
Jim Matthews30-Sep-04 9:44
Jim Matthews30-Sep-04 9:44 
no problem. Smile | :)

i actually should have provided some source code here as the crystal objects are not very intuitive. (imho)

1. in your report create a parameter field called "ContactId"

2. in your report right click an empty area in the field explorer. go to "Report", then "Selection Formula" and then finally "Records". This should open the formula workshop. enter a formula for selection criteria like the following:
{Contact.ContactId} = {?ContactId}

where Contact is your table name and ContactId is the field which holds your unique constraint.

3. Now what you're going to do is pass the parameter value into the report via code.
'top of your object...
imports CrystalDecisions.CrystalReports.Engine
imports CrystalDecisions.Shared

'load your report 
dim myReport as New ReportDocument
with myReport
   .Load("myReportTemplate.rpt")
   .SetDataSource(myDataSet)
end with

'determine which row you want to display
dim drToDisplay as Datarow = myDataSet.Tables("Client").Select("ClientId = " & cstr(currentClientId))

'get a reference to the reports parameter field
dim prmClientIdParameter as ParameterFieldDefinition
prmClientIdParameter = myReport.DataDefinition.ParameterFields("ClientId")

'create a parameter values collection to set the parameter value
dim valsParClientId as New ParameterValues 

'create an instance of a parameter value to add to the above parameter values collection
dim valClientId as New ParameterDiscreteValue
valClientId.Value = drToDisplay("ClientId")

'add the parameter value to the parameters collection
valsParClientId.Add(valClientId)

'set the current value of the reports parameter field
prmClientIdParameter.SetCurrentValues(valsParClientID)

'--- code to display/print report etc ---'


that's pretty much it. watch out for spelling or syntactual errors above as i was typing this off of the top of my head just looking at some of my code. i didn't actually type it into the editor.

another thing to mention is
Brian Bischoff's free online crystal reports e-book
.

hope this helps.



-jim
GeneralRe: crystal reporting in vb.net Pin
Britnt730-Sep-04 10:58
Britnt730-Sep-04 10:58 
GeneralRe: crystal reporting in vb.net Pin
Jim Matthews30-Sep-04 18:21
Jim Matthews30-Sep-04 18:21 
GeneralRe: crystal reporting in vb.net Pin
Britnt71-Oct-04 2:44
Britnt71-Oct-04 2:44 
GeneralRe: crystal reporting in vb.net Pin
Britnt71-Oct-04 4:03
Britnt71-Oct-04 4:03 
GeneralRe: crystal reporting in vb.net Pin
Jim Matthews1-Oct-04 4:53
Jim Matthews1-Oct-04 4:53 
GeneralRenaming a TreeNode and updating an XML file Pin
cwayman30-Sep-04 5:33
cwayman30-Sep-04 5:33 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
Dave Kreskowiak30-Sep-04 11:08
mveDave Kreskowiak30-Sep-04 11:08 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman30-Sep-04 22:13
cwayman30-Sep-04 22:13 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
Dave Kreskowiak1-Oct-04 2:39
mveDave Kreskowiak1-Oct-04 2:39 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman1-Oct-04 3:19
cwayman1-Oct-04 3:19 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman4-Oct-04 3:30
cwayman4-Oct-04 3:30 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
Dave Kreskowiak4-Oct-04 11:00
mveDave Kreskowiak4-Oct-04 11:00 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman5-Oct-04 5:34
cwayman5-Oct-04 5:34 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
Dave Kreskowiak5-Oct-04 12:25
mveDave Kreskowiak5-Oct-04 12:25 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman5-Oct-04 22:13
cwayman5-Oct-04 22:13 
GeneralRe: Renaming a TreeNode and updating an XML file Pin
cwayman6-Oct-04 0:00
cwayman6-Oct-04 0:00 
GeneralRE: Automate code-writing in VB.NET control's development Pin
esalkin30-Sep-04 2:54
esalkin30-Sep-04 2:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.