Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Data- Giving Format to Excel column #12

Closed
KeidyU opened this issue Sep 5, 2017 · 3 comments
Closed

Export Data- Giving Format to Excel column #12

KeidyU opened this issue Sep 5, 2017 · 3 comments

Comments

@KeidyU
Copy link

KeidyU commented Sep 5, 2017

Hi guys,
i have this issue: when i export a varchar from a sql query, example: name = '000782541245', in the column it put '782541245' and i need the 3 zeros in the begin.

There is a way to giving format text for the excel column.
Do i make myself understand?

@cewi
Copy link
Owner

cewi commented Sep 6, 2017

Hi,
yes, I got your problem and am working on a solution. I've to change the code in the Helper. It has to check the type of data and then set explicitly the type of the cell in the sheet. The problem is that there is no explicit Cell-Type for Dates in PHP-Excel.
I'll have to do some more checks and tests and will probably publish a new release the next days.

@cewi
Copy link
Owner

cewi commented Sep 6, 2017

changed the way data is filled in cells:

  • if data ist of type string or date, cell type will be explicitly set to string (seems to be correct type for dates, too)
  • if data is numeric, numeric cell type will be used.

Please test and close the issue if you're ok with the solution

@KeidyU
Copy link
Author

KeidyU commented Sep 6, 2017

Yes, exactly like that is working.
The problem is when a varchar has only number it put type numeric, when it is varchar.

The trick i did was just to concatenate a '\x20' to my field. Then is a string. :(

Anyway thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants