Export to excel

QuestionsExport to excel
germanmary asked 8 years ago

hi sir

The data with 0 ie(09588545) is not getting exported.The 0 is getting omitted.

How to resolve this ?

Waiting for your help

Thank you

4 Answers
Abu Ghufran answered 8 years ago

In lib/inc/php-export-data.class.php we have a code:

if(preg_match("/^-?d+(?:[.,]d+)?$/",$item) && (strlen($item) < 10)) {
$type = 'Number';
}

If length is < 10 and is number, then we'll export number format in excel export.
You can change this logic for your case.

germanmary answered 8 years ago

thank you sir,

but that is not a number field.that is the varchar field but it will contain only the numbers like account details such TIN NO,ACCOUNT NO like that

how to solve this?

Abu Ghufran answered 8 years ago

You can comment out above code and all fields will export as text.
Second option is to use custom excel export and put conditions to writeLabel or writeNumber for formatting.
Refer xlsWriteLabel function in demos > export > custom export code.

germanmary answered 8 years ago

Thank you sir,

i have used the custom export and it is working well thank you

Your Answer

3 + 8 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?