Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Technical Questions
Message Icon Topic: Change Data Type Post Reply Post New Topic
Author Message
amy79g
Newbie
Newbie


Joined: 25 Feb 2009
Location: United States
Online Status: Offline
Posts: 10
Quote amy79g Replybullet Topic: Change Data Type
    Posted: 25 Feb 2009 at 1:48pm

I need my subreport to link to my primary report through a field called "WO#".  In my primary report, this field is coming from a primary database and is a string data type.  In my subreport, the data is coming from a supplemental data sheet (in an excel format) and the data type is a number.  Because they are not the same data type, I cannot link them so my subreport shows only the information I need it to.

I have tried formatting the data in excel to text (doesn't work) and I have tried creating a formula that says ToText(Wo# field) and linking through that formula, but that isn't working either.
 
Help please! Confused
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2009 at 2:12pm
Your totext formula probably added ".00" onto the end of it so it is not matching the other string exactly.
Try either adjusting your formula to:
ToText({table.Wo# field},0,'') to remove the decimal point and zeros.
 
If that doesn't work try reversing your logic and making a formula to convert your string to a number field and link on that.
tonumber(table.textfield)
IP IP Logged
amy79g
Newbie
Newbie


Joined: 25 Feb 2009
Location: United States
Online Status: Offline
Posts: 10
Quote amy79g Replybullet Posted: 25 Feb 2009 at 2:29pm
In this formula:  ToText({table.WO# field},0,")
 
Crystal is looking for the opposing " -- where should that go?
 
Thank you!
 
IP IP Logged
amy79g
Newbie
Newbie


Joined: 25 Feb 2009
Location: United States
Online Status: Offline
Posts: 10
Quote amy79g Replybullet Posted: 25 Feb 2009 at 2:32pm
Oh wait - got it -- I did 2 "" and it works!  Big%20smile
 
Next question -- now it is repeating my subreport many times.  How do I get it to show only once?? 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2009 at 2:32pm
It is 2 single ' characters not one double quote ( ' and ' not ").
You may not need it at all and can just use:
ToText({table.WO# field},0)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 25 Feb 2009 at 2:33pm
DO you have your sub report on a Details line?
If so it will run the report for every instance.
Move it to a header or footer.
IP IP Logged
amy79g
Newbie
Newbie


Joined: 25 Feb 2009
Location: United States
Online Status: Offline
Posts: 10
Quote amy79g Replybullet Posted: 25 Feb 2009 at 2:49pm
YIPPEE!  Thank you!Thumbs%20Up
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.016 seconds.