Solved

Delete a record in Crystal Reports

Posted on 2004-08-04
7
388 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get Client IP on RDS - VB.NET 15 68
HTML - Color not displaying correctly in EMAIL. 6 49
Expression Evaluater 3 38
Sending receiving text messages in vb.net 15 48
This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…

860 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