Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports Field Length

Status
Not open for further replies.

Alfy101

Technical User
Apr 5, 2002
12
GB
Hi I'm new to using Crstal Reports and am having a problem with field sizes.

I have a Vb 6.0 Application which uses MY SQL as the back end database. I've started using Crystal to create various reports.
The problem is whatever field length the initial data i use to create my report is - the field length wont increase.
E.g. my data brings back a string field of size 7 (Arsenal), which displays great on the report.

However if i send across other data to the report the field size wont increase,
E.g. next time my field needs size 17 (Manchester United), only the first 7 characters can be seen.

I've made sure that I DiscardSavedData when opening the report again - but problem persists. At the moment I'm getting arpound the problem by making sure I'm using data which uses up the max length my fields can be when saving the original report.
Fingers crossed its a simple solution
 
Hi,
When designing the report be sure the field size is wide enough to hold the max length ..
Don't rely on what CR creates when the field is added to the report. Manually stretch it to the max size needed.






[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
So are you saying you're expecting the width of the field to grow automatically depending on its contents? If so, CR doesn't behave that way. When you place your fields on the report, you should try to size them to fit the largest expected length.

-dave
 
It's not the length of the field on the actual report I want to grow its the problem that the field type will never grow when new data is being used.

The actual lenth of the text box on the report is fine as i've manually made this large - but I dont seem to be able to specify what size my field Type should be.

Hope this clarifies

thanks for any feedback ;)
 
Hi,
Nope..It confuses things..

The 'actual' field size is determined when the table is created/altered. Crystal does not care - it only deals with displaying whatever is there.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Hi Turkbear

I'll try again :)

In the Field Explorer it shows me the fields which are available from the SQL statement I've made.

Each field is listed and shows the Field Type
for example: address1(14)
which means that when i last verified the data i had an Address1 of size 14.

My problem is that when the sql statement is run again by running the report if address1 is now 20 characters long the field type remains at 14

so on the report my address1 is truncated to only 14 characters even though it should now be 20.

better?


 
Hi,
Please post your Sql statement ( how was it created?)
What database? Version?

What is the Table structure in the database?





[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
the sql statement was made by:
Creating a New ODBC Connection

Example of SQL command:
select address1 from clients where clientid = {?ClientID}

I dont use a table just the results from the SQL Statment
its looking at a DSN connected to a MYSQL base

The Clients table in the database has an Address1 datatype of varchar (100)

I have no problem with the correct data being displayed on the report - just that the length of Address1 does not increase the length of the fieldtype in crystal (version 9.2.0.448)

I cant find anyway to specify to always make the field length size 100 in crystal other than to pass through an Address1 of size 100 when i use:
Report > Verify Database

this does the trick - but its a long winded way as I'll have to do the same with every field everytime i make a small change.
 
Hi,
OK, a more basic question...Why do you care? If it displays correctly, why worry about what the field definition says it is?

Also, why write Sql Command and not access the table directly and select the fields you want to show?




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
lol

OK cheers! I'll muddle along as it's working ok with my workaround.

I just figured there should be a better way of doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top