Universal Data Exporter PHP Support Product Page

Solved

Leading Zeroes

Reported 26 Sep 2010 17:06:51
1
has this problem
26 Sep 2010 17:06:51 Bart Garner posted:
How can I keep leading zeros when building a CSV file?

Replies

Replied 27 Sep 2010 10:40:02
27 Sep 2010 10:40:02 Miroslav Zografski replied:
Hello Bart,

Please, provide more info on the issue to clarify it.

Regards,
Replied 20 Oct 2010 02:35:33
20 Oct 2010 02:35:33 Bart Garner replied:
Not very complex

Enter a number in the db, say it's a serial #

0001234567

View it in PHP, you see 0001234567

Export it to CSV with File Genie and you get 1234567

How can I retain the 000's
Replied 20 Dec 2010 18:52:45
20 Dec 2010 18:52:45 Bart Garner replied:
Where is the support? I have at least 10 questions on this forum that are not being answered!
Replied 22 Dec 2010 11:19:17
22 Dec 2010 11:19:17 Miroslav Zografski replied:
Hello Bart,

Try following:

Set up a table that contains the records in your DB table.

Set up an export link that uses the Behavior method (from TAG INSPECTOR panel)

Export the table to CSV and see if 000's are retained.

Regards,
Replied 22 Dec 2010 17:07:10
22 Dec 2010 17:07:10 Bart Garner replied:
When you do it that way, the behaviour is not triggered. It would be nice if it did because if I could generate from a table rather than on page load I can concatenate some fields which woudl be handt (AND eleminitate leading zeroes)

1. Removed Universal Data Export that was already on the page.
2. Added table, gave it an ID
3. Added fields and repeate region
4. Added Behaviour as above, uploaded all, no export.

Note: in post above I typed File Genie, that was a typo. I was having an issue with that extension as well on that day. Obviously I was using UDE.
Replied 03 Jan 2011 10:30:09
03 Jan 2011 10:30:09 Miroslav Zografski replied:
Hello Bart,

Under "Ste up link to export in CSV format" I mean that you set a link on the page with the table that leads to nowhere :
href="#" or href="javascript:void(0)"
and assign an behavior for onClick event for that link through the behaviors in TAG INSPECTOR panel.

Regards,
Replied 25 Feb 2011 14:00:08
25 Feb 2011 14:00:08 Matt Lane replied:
I am also seeing this issue and need to know how to resolve it, i have a lot of phone numbers being exported (UK number which all start with a 0).

Of course with all the leading 0 removed from every single phone number is a problem. My fields are all set as 'Text' on my database (MySQL).

Thanks in advance.

Matt
Replied 26 Feb 2011 00:14:11
26 Feb 2011 00:14:11 Bart Garner replied:
Miroslav's solution worked perfectly.
Replied 28 Feb 2011 14:55:28
28 Feb 2011 14:55:28 Matt Lane replied:
Sorry but that makes no sense. I already have a link in place to a page where the export is being handled, the page then downloads as a CSV.

Am i supposed to be adding the JS link and then another behaviour to launch the page?

The situation i have at present is this:

1, Hyperlink on page, linking directly to the php file the produces the CSV
2, click link and CSV downloads, current page stays in browser.

The export has the header of filetype which forces it to download, I'm a bit confused as to how a JS link can possibly replace all the 0's.

Also slightly stumped why this cannot be fixed within the files the extension uses to create the export. Surely exporting numbers with leading 0's included should be as standard and not something i have to hack around to make work.
Replied 28 Feb 2011 17:24:41
28 Feb 2011 17:24:41 Bart Garner replied:
Create a table on the page, add the headers, data and repeat rows as normal for display, then create the CSV from the table rather than from the recordset.

Add a link to the page something like:

<a href="javascript:void(0);">Create</a>



Use Behaviours to create an On Click event that calls the File Export behaviour.

Make sure your table has an id, or you will not be able to select it from the File Export UI.
Replied 14 Apr 2012 02:02:38
14 Apr 2012 02:02:38 Dennis Maier replied:
It is important to me to have this problem fixed.

The server behavior is exactly what I need and why I purchased this product.

Dennis

Reply to this topic