Solved

Delete a record in Crystal Reports

Posted on 2004-08-04
7
387 Views
Last Modified: 2010-04-23
Hey,

I have a crystal report that displays username information. In the crystal report viewer, you click next page to move on to the next record. I was wondering how can i make it so that the user can delete a record they are seeing on the form. Please help! Thanks
0
Comment
Question by:Chipwpb
7 Comments
 
LVL 4

Expert Comment

by:jrandallsexton
ID: 11719358
As far as I am aware, there is no way to do that.  How would you know what 'row' you have selected in the report.

I think the only way to accomplish something like that is by putting the results into a table/grid and allowing the user to delete them from there.

Just as a note, the general idea of a report is that it provides read-only access to data arranged in an intelligible manner.  Reports, while often configured to be interactive with drilldowns, are generally read-only.
0
 

Author Comment

by:Chipwpb
ID: 11719433
The thing is, ive seen it done before. Each page is a new record.
0
 
LVL 10

Expert Comment

by:Clif
ID: 11719487
Whatever you may have seen delete a record, it wasn't Crystal you were seeing.

As jrandallsexton said, Crystal Reports is strictly read-only.
0
 
LVL 42

Expert Comment

by:frodoman
ID: 11719826
Chipwpb,

What the previous posts have said isn't completely accurate.  You *can* use Crystal to, among other things, delete records from your database.  Witness this text copied from Business Objects (owners of Crystal) website:

-----------------------------------------------------------------------------------------------------------------
Crystal Reports is not recommended as a tool to write to, update or delete from a database.
Database clients or applications designed specifically to edit databases should be used
instead. However, now that CR has full SQL functionality it is possible to write to, update
and delete from databases.
-----------------------------------------------------------------------------------------------------------------

Having said that though, I would advise 100% against doing this.  Just because something is possible doesn't mean it should be done!  Crystal is designed as a reporting tool, not as a database interface.

frodoman

0
 
LVL 42

Accepted Solution

by:
frodoman earned 125 total points
ID: 11719850
Chipwpb,

If you persist in doing this, one way would be to create on on-demand subreport linked to each detail record.  Your subreport could contain the sql command to delete a record.  You would have to link the subreport parameter to the main report record(s) that contain the PK for the table.

Again though, I have to advise in strongest terms not to do this.  Look for another way to accomplish whatever it is you want to do.

Cheers,

frodoman
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question