Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add a field in to a report (Crystal Reports in Visual Studio)

I have an existing report (Crystal Report) in my Visual Studio project that is based off of an SQL Server View. using an OLE DB (ADO) connection.

I've updated the View since the report was created. I've changed some field names and added a field.

How can I update the fields on the report to point at the new field names in the view?

OR

How can I add a new field to the report that points at the new field in the view?

(I know, that's two questions. But the answer is probably going to be very similar for both)

like image 876
BIBD Avatar asked Sep 09 '09 18:09

BIBD


4 Answers

I finally figured it out. For the sake of the next guy...

  1. shahkalpesh and serge_ bg are right about the "Verify Data"
    If you right click on a blank spot on your report, you will get a popup menu. Select Database -> Verify__Database. Crystal Reports should update the fields that have changed.

  2. You can drag-n-drop the new field onto your report.
    There should be a "Field Explorer" tree view (probably on the left). Select Database Fields -> View/Table Name -> Field Name and drag that onto your report.

A worst case scenario of Crystal Reports updating report field to match up with the wrong field on the view, can be resolved by deleting the old field and re-adding the field using the drag and drop method.

like image 86
BIBD Avatar answered Nov 19 '22 14:11

BIBD


"Verify database" should help you. This is the answer on both questions.

like image 43
Serge Bogatyrev Avatar answered Nov 19 '22 16:11

Serge Bogatyrev


How can I add a new field to the report that points at the new field in the view?
You will have to manually add that field to the report. What do you think should be the case?

I think there is some option which sounds like "Verify Data". If you do that, it will prompt you with "some fields has changed... proceed to fix report?", I think that should take care of your first question.

like image 3
shahkalpesh Avatar answered Nov 19 '22 15:11

shahkalpesh


Thanks to the geniuses at Microsoft who promptly thought that it might be possible to change tables and view columns, this is a piece of cake! You get that I'm being sarcastic I hope.

You're missing 1 step, that's to drop and recreate your DataAdapter otherwise you'll go nuts trying to add the new fields into your report... then you can run the verify db option to refresh your columns...

like image 2
can.do Avatar answered Nov 19 '22 16:11

can.do