Data Connectivity
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Data Connectivity
Message Icon Topic: How to change a field name in CR Post Reply Post New Topic
Author Message
StephanieD
Newbie
Newbie
Avatar

Joined: 12 Feb 2009
Location: United States
Online Status: Offline
Posts: 4
Quote StephanieD Replybullet Topic: How to change a field name in CR
    Posted: 13 Feb 2009 at 3:56am
I am a VB programmer by trade, and just started using Crystal Reports within the Visual Studio 2005 development suite.

I am impressed with CR and will be using it a lot more from now on.

I'm not sure if many people her are VB programmers, but I have a Crystal Report that reads data in from a DataView that is created in VB.

One of the field names in the DataView is changing. [IssuedBy] is becoming [IssuedByName].

What I would like to do is click the [IssuedBy] field on my Crystal Report, go to Properties, and find an area where I can make the change to the field name that it expects to find from its data source.

I can't seem to find it though!

Any suggestions?

If I were reading directly from a database, I would browse to it in the database and insert a new copy of the field.

But I can't browse a DataView that I build in code.

Can anyone help?
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 13 Feb 2009 at 1:34pm
I haven't worked with VB or DataViews but try this:  After the DataView structure has  been updated, open the report design and select "Set Location" from the Database menu.  Point it to the DataView.  This should bring up a box that shows any field differences and allow you to map them to the new fields.
 
If that doesn't work, try selecting "Verify Database" from the Database menu.  It should come up with a message that the database has changed and it's "proceeding to fix up the report".  This will delete the renamed field from anywhere it's located (on the report or in formulas) so you'll have to re-add it to the report and update the formulas before it will run correctly.
 
-Dell
IP IP Logged
StephanieD
Newbie
Newbie
Avatar

Joined: 12 Feb 2009
Location: United States
Online Status: Offline
Posts: 4
Quote StephanieD Replybullet Posted: 16 Feb 2009 at 8:04am
ha, you're a genius.

I had to tweak your idea a little, but it got me looking in the right spot. I made a copy of the original database, changed the field names to the new names, and pointed to the new database instead. Since my code disconnects the CR report from the database anyway and reconnects it to my dataview that is produced at run time, it doesn't matter that CR was once pointed to a temp copy of a database that no longer exists - all that counts is that we fooled CR into changing the field names on the report.

What I really need to learn how to do is create an .xsd file containing the TableAdapter to perform the query I need, plus the corresponding DataTable to store the data. But this solution was easier for now. THANKS!!

IP IP Logged
aluckhaupt
Newbie
Newbie
Avatar

Joined: 30 Jan 2012
Location: United States
Online Status: Offline
Posts: 1
Quote aluckhaupt Replybullet Posted: 30 Jan 2012 at 1:35pm
I ran into an issue where I wanted to substitute one view for another and this solution was wonderful. Thanks for posting it, even if it was almost 3 years ago.
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.