Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open a report based on 1 record???

Status
Not open for further replies.

keimpe

Programmer
Oct 1, 2002
23
0
0
NL
Hi everyone,

I have created a Crystal Report (in VB.NET) based on invoices. I can't figure out how to get that report to open and show me just ONE invoice. It always shows me all invoices in the invoice table. Do I have to call the report with a certain parameter? Or do I have to change the recordsource at runtime? Or is there a 'filter' property?

Can you help me? Preferably with a bit of sample code?

Your feedback is much appreciated!

Greetings,
Keimpe Wiersma
 
Create a parameter called Invoice Number (Insert->Field Objects->Right click parameters and select New) with the same data type as in your database.

In the record selection criteria (Report->Edit Selection Formula->Record) place something like this:

{MyTable.MyInvoice} = {?Invoice Number}

This will force the report to prompt you for the Invoice number and filter the table to only that invoice.

-k kai@informeddatadecisions.com
 
It is a pain to always have to enter the information in though when you can click on a button and and have the report open to the desired record...

We use the Active Data ADO and then afterwards we pass the SQL statement in via coding.

Then the crystal report viewer we designed will then take this SQL statement with the correct "Record ID" and view it.

I have coding, but it is too complicated to post and understand, it actually reads an INI file that I design with every report to accomodate the subreports' dataconnection and sql statement.

Hope this helps. There is simple coding, I haven't had to go back and touch it in a while, so if your still stuck, post again.

Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top