Renaming table columns

Issues related to label design (working with databases, data processing, RFID encoding etc.) and printing (from NiceLabel Express, NiceLabel Pro, NiceForm and NicePrint)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
Tarak
Newcomer
Posts: 5
Joined: Wed Jul 10, 2019 11:05 pm

Renaming table columns

Post by Tarak » Thu Jul 11, 2019 12:36 am

Hi,

When I preview my form, the table columns are a lot wider than they need to be because of the column name, is it possible to rename the column names in an SQL connection?
This is part of the SQL code:
SELECT [jmpJobID], [jmpPartID], [jmpPartShortDescription]

I thought I could use something like the following, but it doesn't accept it.

SELECT [jmpJobID] as "Job ID", [jmpPartID] as "Part ID", [jmpPartShortDescription] as "Description"

:D

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 437
Joined: Mon Aug 28, 2017 3:07 pm

Re: Renaming table columns

Post by Kyleodonnell » Thu Jul 11, 2019 1:40 pm

Tarak,

You can use aliases in the data connection
aliases.PNG
aliases.PNG (31.27 KiB) Viewed 306 times
this will allow you to name the field whatever you wish.

Tarak
Newcomer
Posts: 5
Joined: Wed Jul 10, 2019 11:05 pm

Re: Renaming table columns

Post by Tarak » Fri Jul 12, 2019 9:14 pm

Hi Kyle,

Thanks for the response, I tried the Alias field, but that only seems to rename the field in the tree, the column name in the table still remains the name that is pulled from SQL. :-k

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 437
Joined: Mon Aug 28, 2017 3:07 pm

Re: Renaming table columns

Post by Kyleodonnell » Fri Jul 12, 2019 10:52 pm

Tarak,

can you attach a screenshot what your table columns look like?

Tarak
Newcomer
Posts: 5
Joined: Wed Jul 10, 2019 11:05 pm

Re: Renaming table columns

Post by Tarak » Fri Jul 12, 2019 11:03 pm

Hi Kyle,

No worries.
Attachments
Nicelabel Example.png
Nicelabel Example.png (10.44 KiB) Viewed 296 times

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 437
Joined: Mon Aug 28, 2017 3:07 pm

Re: Renaming table columns

Post by Kyleodonnell » Mon Jul 15, 2019 1:47 pm

Tarak,

As you are using a label, you cannot rename the columns of the data initialization object that you select records from. However, if you use powerforms, you can use a table object which allows you to rename the columns. What version of the software are you currently using? Please go to help>about in the software.

Tarak
Newcomer
Posts: 5
Joined: Wed Jul 10, 2019 11:05 pm

Re: Renaming table columns

Post by Tarak » Thu Jul 18, 2019 6:34 am

Hi Kyle,

Thanks again for all your help, I managed to figure it out, I killed 2 birds with one stone, I managed to rename the columns and trim the values using the following SQL commands:

RTRIM([jmpJobID]) as "Job ID", RTRIM([jmpPartID]) as "Part ID"

Thanks again :D

Post Reply