views:

530

answers:

3

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 updated the fields on the report to point at the new fields in the view?
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)

+1  A: 

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

serge_bg
A: 

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.

shahkalpesh
And I would manually add that field _how_?
CodeSlave
How did you create the report? Did you not drag-drop each of the field to design your report?
shahkalpesh
You see, that was the problem. I didn't create the report. And the original author is no longer available to me.
CodeSlave
A: 

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.

CodeSlave
Verify will also pick up changed field lengths, which can lead to some odd results when you forget to do it.
CodeByMoonlight