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

Feature to force text columns #18

Closed
sbcgua opened this issue Sep 8, 2021 · 3 comments
Closed

Feature to force text columns #18

sbcgua opened this issue Sep 8, 2021 · 3 comments

Comments

@sbcgua
Copy link
Owner

sbcgua commented Sep 8, 2021

When value is e.g. "01.02" it is interpreted as a date on Excel paste. While this may be plain text.

There should be a feature to force all or selected fields to be text. Seems like "01.02" is treated as text (apart from 01.02) so there is a technical possibility

@sbcgua
Copy link
Owner Author

sbcgua commented Oct 4, 2021

"1.1" does not work. But seems there is another solution - HTML ...
Copying excel fragment with styles and viewing it with Free Clipboard Viewer gives a hint

<table>
<tr><td>H1</td><td>H2</td><td>H3</td></tr>
<tr><td>abc</td><td style='mso-number-format:"\@"'>1.1</td><td>123,45</td></tr>
</table>

This seems to paste correctly

@sbcgua
Copy link
Owner Author

sbcgua commented Oct 4, 2021

Version:1.0
StartHTML:0000000105
EndHTML:0000002495
StartFragment:0000001914
EndFragment:0000002443

<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=ProgId content=Excel.Sheet>
<meta name=Generator content="Microsoft Excel 15">
<style>
<!--table
	{mso-displayed-decimal-separator:"\,";
	mso-displayed-thousand-separator:" ";}
@page
	{margin:.75in .7in .75in .7in;
	mso-header-margin:.3in;
	mso-footer-margin:.3in;}
tr
	{mso-height-source:auto;}
col
	{mso-width-source:auto;}
br
	{mso-data-placement:same-cell;}
td
	{padding-top:1px;
	padding-right:1px;
	padding-left:1px;
	mso-ignore:padding;
	color:black;
	font-size:11.0pt;
	font-weight:400;
	font-style:normal;
	text-decoration:none;
	font-family:Calibri, sans-serif;
	mso-font-charset:204;
	mso-number-format:General;
	text-align:general;
	vertical-align:bottom;
	border:none;
	mso-background-source:auto;
	mso-pattern:auto;
	mso-protection:locked visible;
	white-space:nowrap;
	mso-rotate:0;}
.xl65
	{font-size:10.0pt;
	font-family:Calibri, sans-serif;
	mso-font-charset:0;
	vertical-align:middle;
	white-space:normal;}
.xl66
	{font-size:10.0pt;
	font-family:Calibri, sans-serif;
	mso-font-charset:0;
	mso-number-format:"\@";
	vertical-align:middle;
	white-space:normal;}
-->
</style>
</head>

<body link="#0563C1" vlink="#954F72">

<table border=0 cellpadding=0 cellspacing=0 width=192 style='border-collapse:
 collapse;width:144pt'>
<!--StartFragment-->
 <col width=64 span=3 style='width:48pt'>
 <tr height=19 style='height:14.4pt'>
  <td height=19 class=xl65 width=64 style='height:14.4pt;width:48pt'>H1</td>
  <td class=xl65 width=64 style='width:48pt'>H2</td>
  <td class=xl65 width=64 style='width:48pt'>H3</td>
 </tr>
 <tr height=21 style='height:15.6pt'>
  <td height=21 class=xl65 width=64 style='height:15.6pt;width:48pt'>abc</td>
  <td class=xl66 width=64 style='width:48pt'>1.1</td>
  <td class=xl65 align=right width=64 style='width:48pt'>123,45</td>
 </tr>
<!--EndFragment-->
</table>

</body>

</html>

Complete fragment, might be useful, e.g. for decimal separator styles

@sbcgua
Copy link
Owner Author

sbcgua commented Oct 10, 2021

done in v2.3.4

@sbcgua sbcgua closed this as completed Oct 10, 2021
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

1 participant