473,473 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

crystal with parameters question...

I've got two parameters on my report titled "CustName" and
"OrderID"...both are in the Details section...however, only one
parameter works, the other doesn't...

sample code:

Dim param1 As New ParameterField
Dim param2 as New ParameterField
Dim paramValue As New ParameterDiscreteValue
(tbCustomers is set to a datatable which is filtered to contain 1
record)
(tbOrders is set to a datatable which is filtered to contain all orders
for customer in tbCustomers)

param1.ParameterFieldName = "CustName"
paramValue.Value = tbCustomers.Rows(0).Item("FullName")
param1.CurrentValues.Add(paramValue)

param2.ParameterFieldValue = "OrderID"
paramValue.Value = ??? (need all OrderID's from tbOrders)
param2.CurrentValues.Add(paramValue)
param1 works because it is set to a specific field in a table.
however, I'm not sure how to assign the value of param2, since there
will be several results.

thanks...

Nov 21 '05 #1
3 935
"Eych" <ey******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I've got two parameters on my report titled "CustName" and
"OrderID"...both are in the Details section...however, only one
parameter works, the other doesn't...

sample code:

Dim param1 As New ParameterField
Dim param2 as New ParameterField
Dim paramValue As New ParameterDiscreteValue
(tbCustomers is set to a datatable which is filtered to contain 1
record)
(tbOrders is set to a datatable which is filtered to contain all orders
for customer in tbCustomers)

param1.ParameterFieldName = "CustName"
paramValue.Value = tbCustomers.Rows(0).Item("FullName")
param1.CurrentValues.Add(paramValue)

param2.ParameterFieldValue = "OrderID"
paramValue.Value = ??? (need all OrderID's from tbOrders)
param2.CurrentValues.Add(paramValue)
param1 works because it is set to a specific field in a table.
however, I'm not sure how to assign the value of param2, since there
will be several results.

thanks...


I don't think you've told us enough about what you're trying to do in order
to give a definitive answer.

The way I prefer to do crystal reports is to base them on stored procedures.
If I have guessed correctly as to what you're doing I'd have a like
comparison for the order id and stick in "%" when I wanted everything.
If I haven't guessed right then that might be no good...
--
Regards,
Andy O'Neill
Nov 21 '05 #2
Andy,

Thanks for replying.

This is the result I'm looking for

John Smith
Order# 124
Order# 233
Order# 455

if I do
paramValue.Value = tbOrders.Rows(0).Item("OrderID")
then I get

John Smith
Order# 124
Order# 124
Order# 124

this is because I gave a specific (Rows(0)) value to the parameter.
However, I just want to link the "OrderID" field in tbOrders to the
value of the parameter so that it displays all of the records.

Thanks

Nov 21 '05 #3
"Eych" <ey******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Andy,

Thanks for replying.

This is the result I'm looking for

John Smith
Order# 124
Order# 233
Order# 455

if I do
paramValue.Value = tbOrders.Rows(0).Item("OrderID")
then I get

John Smith
Order# 124
Order# 124
Order# 124

this is because I gave a specific (Rows(0)) value to the parameter.
However, I just want to link the "OrderID" field in tbOrders to the
value of the parameter so that it displays all of the records.

Thanks


I think it's more the other way round mate.
IF what you want is to select all the orders for one customer.
then you COULD use customer id as a parameter for both.

I am assuming customer id or some such is a foreign key in orders.
If it ain't then you got a VERY bad database design as you don't know who
any order is for!!!
BUT.
The two tables and two parameters aren't, IMO, the best way to use crystal.
I'd have a piece of sql links the two tables on customer.

Something like.

select o.blaa, c.blaa, from orders o inner join customers c
on c.customerId = o.customerId
where c.customer=@parameter

I'd make that a stored procedure and base the report on that.
Where you have a datatable then you have some sql used to make the thing.
The above is sql....

You set the customer id and the sql picks both stuff out both tables for
you.

--
Regards,
Andy O'Neill
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal...
10
by: Joriz | last post by:
Obviously im new with ms access..so my basic question is how do i run crystal reports in my ADP. I also pass parameters to cyrstal reports. Please help! thanks in advance
0
by: murl | last post by:
I have built a crystal report using crystal9.0 that is linked to a stored procedure built in sql2k, which requires 2 parameters beginningdate(smalldatetime),and endingdate(smalldatetime). When the...
0
by: Craig Faulkner | last post by:
I have been fighting through my first crystal report in VS2003.NET and have made some headway. Here is what I've done: 1. Created a crystal report in VS2003 from a SQL stored procedure with...
0
by: Henry | last post by:
Using ideas provided by some of you I was able to figure out how to get the names of the parameters fields of a crystal report specified at run time. The code below just basically puts the...
19
by: LP | last post by:
I am using (trying to) CR version XI, cascading parameters feature works it asks user to enter params. But if page is resubmitted. It prompts for params again. I did set...
4
by: touf | last post by:
hi, I'm using Crystal reports to generate a simple report in a VB.net windows application, I've defined all my stuffs (accessMDB,query, 2 parameters) in the report design, and it's working fine,...
12
by: Bill Nguyen | last post by:
What's the VB syntax to run the CR report using the following SP? I use CrystalreportViewer and ReportDocument. Thanks Bill Here's the SP in SQLserver 2K: CREATE proc mysp_ReportSubmission...
1
by: darf | last post by:
Firstly, I'm VERY green on all this Crystal stuff - so please excuse my ignorance. I see on other posts that to print a report without using the viewer use: Dim crReportDocument As...
0
by: Linda W. | last post by:
Hi, I would appreciate any insight into the following issue.. I have an asp.net application with crystal reports being displayed.. All works fine from my IDE & I am trying to move the app to a...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
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...
0
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...
0
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 ...
0
muto222
php
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.