Single Quote Problem in Excel to Export


P

Prasad Dannani

Hi,

We have to export our data in sql server table to any excel sheet. We have a
template to export, using oledb we are inserting rows to this template and
generating the excel output.

The problem here is we are getting a single quote extra in front of each
cell. can anyone help us in clearing this kind of an issue.

we tried sending some static strings to some columns on for taking from sql
server eventhen we are getting the same


Its Urgent, Please reply ASAP,
Prasad Dannani
 
Ad

Advertisements

P

Prasad Dannani

We tried by specify the datatype to the oledb parameters, We tried to find
that charecter in the string which are retreive from sql server but it was
not there and then we removed the first charecter and tried then we also
tried by hardcoding the values to one or two columns. We tried by specfying
the datatype to text in the excel template.

None of the above are worked. If there is any otherway to remove it then
please inform us.

Alvin Bruney - ASP.NET MVP said:
That's how excel forces data to be a string. You will have to write code to
remove it. Or you can set the cell to a date type or some other relevant
type to get rid of the quote character.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Prasad Dannani said:
Hi,

We have to export our data in sql server table to any excel sheet. We
have
a
template to export, using oledb we are inserting rows to this template and
generating the excel output.

The problem here is we are getting a single quote extra in front of each
cell. can anyone help us in clearing this kind of an issue.

we tried sending some static strings to some columns on for taking from sql
server eventhen we are getting the same


Its Urgent, Please reply ASAP,
Prasad Dannani
 
Ad

Advertisements

P

Prasad Dannani

We tried all possible combinations and finally able to find that the problem
is there in the excel template i specified the cells format type to text
then it worked properly.



Prasad Dannani said:
We tried by specify the datatype to the oledb parameters, We tried to find
that charecter in the string which are retreive from sql server but it was
not there and then we removed the first charecter and tried then we also
tried by hardcoding the values to one or two columns. We tried by specfying
the datatype to text in the excel template.

None of the above are worked. If there is any otherway to remove it then
please inform us.

Alvin Bruney - ASP.NET MVP said:
That's how excel forces data to be a string. You will have to write code to
remove it. Or you can set the cell to a date type or some other relevant
type to get rid of the quote character.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Prasad Dannani said:
Hi,

We have to export our data in sql server table to any excel sheet. We
have
a
template to export, using oledb we are inserting rows to this template and
generating the excel output.

The problem here is we are getting a single quote extra in front of each
cell. can anyone help us in clearing this kind of an issue.

we tried sending some static strings to some columns on for taking
from
sql
server eventhen we are getting the same


Its Urgent, Please reply ASAP,
Prasad Dannani
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top