# Formatting MapInfo Tab file

**URL:** <https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957>\
**Category:** Silverlight\
**Created:** [September 8, 2011, 7:09am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957 "2011-09-08T07:09:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tomer](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/41988e/32.png) [@Tomer](https://community.thinkgeo.com/u/Tomer)\
**Post date:** [September 8, 2011, 7:09am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/1 "2011-09-08T07:09:52Z")

</div>

Hi,

I&nbsp;need&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;create&nbsp;formatted&nbsp;MapInfo&nbsp;tab&nbsp;files.

I&nbsp;need&nbsp;to&nbsp;control&nbsp;the&nbsp;way&nbsp;features&nbsp;are&nbsp;displayed&nbsp;-&nbsp;shape&nbsp;(e.g.&nbsp;star,&nbsp;triangle,&nbsp;Lozenge-shaped&nbsp;etc),&nbsp;line&nbsp;type&nbsp;(width,&nbsp;dashed)&nbsp;and&nbsp;colors.

There&nbsp;is&nbsp;not&nbsp;much&nbsp;documentation&nbsp;on&nbsp;the&nbsp;subject&nbsp;-&nbsp;I've&nbsp;done&nbsp;the&nbsp;following&nbsp;code:

&nbsp;

`List<TabDbfColumn> columns = new List<TabDbfColumn>();columns.Add(new TabDbfColumn("LINK_ID", DbfColumnType.String, 10, 0, true, true));columns.Add(new TabDbfColumn("X", DbfColumnType.Double, 20, 10, false, false));columns.Add(new TabDbfColumn("Y", DbfColumnType.Double, 20, 10, false, false));columns.Add(new TabDbfColumn("CreateDate", DbfColumnType.Date, 0, 0, false, false));PointShape p = new PointShape(157633, 615456);p.Id = "P1";Feature f = p.GetFeature();f.ColumnValues.Add("LINK_ID", "P1");f.ColumnValues.Add("X", "157633");f.ColumnValues.Add("Y", "615456");f.ColumnValues.Add("CreateDate", "20/12/2010");List<Feature> features = new List<Feature>();features.Add(f);TabFeatureSource.CreateTabFile(MapPath("~/app_data/MyTab.TAB"), columns, features);`

What&nbsp;do&nbsp;I&nbsp;need&nbsp;to&nbsp;modify&nbsp;in&nbsp;order&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;change&nbsp;the&nbsp;how&nbsp;the&nbsp;features&nbsp;appears?&nbsp;Is&nbsp;there&nbsp;a&nbsp;tutorial/demo&nbsp;for&nbsp;creating&nbsp;such&nbsp;files?

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [September 8, 2011, 9:04am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/2 "2011-09-08T09:04:47Z")

</div>

&nbsp;Tomer,

&nbsp;  
Thanks&nbsp;for&nbsp;your&nbsp;questions!  
&nbsp;  
If&nbsp;I&nbsp;didn't&nbsp;misunderstand&nbsp;it,&nbsp;I&nbsp;think&nbsp;you&nbsp;want&nbsp;to&nbsp;create&nbsp;the&nbsp;tab&nbsp;file&nbsp;with&nbsp;the&nbsp;special&nbsp;styles.&nbsp;Actually&nbsp;we&nbsp;don't&nbsp;support&nbsp;it&nbsp;but&nbsp;we&nbsp;have&nbsp;a&nbsp;workaround&nbsp;for&nbsp;that,&nbsp;you&nbsp;just&nbsp;need&nbsp;to&nbsp;create&nbsp;the&nbsp;tab&nbsp;file,&nbsp;then&nbsp;set&nbsp;the&nbsp;style&nbsp;to&nbsp;the&nbsp;tab&nbsp;file&nbsp;when&nbsp;loading&nbsp;it.&nbsp;Also&nbsp;you&nbsp;can&nbsp;reference&nbsp;this&nbsp;code&nbsp;community&nbsp;sample&nbsp;to&nbsp;see&nbsp;how&nbsp;to&nbsp;load&nbsp;a&nbsp;native&nbsp;tab&nbsp;file&nbsp;with&nbsp;styles&nbsp;and&nbsp;edit,&nbsp;delete&nbsp;the&nbsp;records.  
&nbsp;  
[wiki.thinkgeo.com/wiki/File:...110524.zip](http://wiki.thinkgeo.com/wiki/File:DesktopEditionSample_NativeTabFileSupport_CS_110524.zip)  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;please&nbsp;let&nbsp;me&nbsp;know&nbsp;again,  
&nbsp;  
Thanks,  
&nbsp;  
Scott,

---

<div class="post-metadata">

**Author:** ![Tomer](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/41988e/32.png) [@Tomer](https://community.thinkgeo.com/u/Tomer)\
**Post date:** [September 9, 2011, 7:00pm UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/3 "2011-09-09T19:00:20Z")

</div>

Hi&nbsp;Scott,

I&nbsp;believe&nbsp;you&nbsp;understood&nbsp;me&nbsp;well.&nbsp;I&nbsp;am&nbsp;trying&nbsp;to&nbsp;create&nbsp;TAB&nbsp;files&nbsp;with&nbsp;specific&nbsp;styles&nbsp;in&nbsp;each.

The&nbsp;problem&nbsp;with&nbsp;the&nbsp;workaround&nbsp;you&nbsp;suggested&nbsp;is&nbsp;that&nbsp;I&nbsp;need&nbsp;the&nbsp;style&nbsp;"embedded"&nbsp;in&nbsp;the&nbsp;file&nbsp;so&nbsp;that&nbsp;"external&nbsp;users"&nbsp;(that&nbsp;is,&nbsp;people&nbsp;using&nbsp;a&nbsp;difference&nbsp;viewer&nbsp;-&nbsp;e.g.&nbsp;MapInfo&nbsp;Pro/Viewer)&nbsp;will&nbsp;see&nbsp;the&nbsp;same&nbsp;view&nbsp;(and&nbsp;maybe&nbsp;Edit).

(BTW,&nbsp;does&nbsp;it&nbsp;means&nbsp;that&nbsp;the&nbsp;TAB&nbsp;layer&nbsp;I&nbsp;create&nbsp;will&nbsp;also&nbsp;not&nbsp;take&nbsp;the&nbsp;styles&nbsp;from&nbsp;the&nbsp;file&nbsp;but&nbsp;will&nbsp;be&nbsp;rendered&nbsp;as&nbsp;per&nbsp;my&nbsp;specification&nbsp;in&nbsp;the&nbsp;ZoomLevelYY.XXXStyle?)

I've&nbsp;seen&nbsp;that&nbsp;the&nbsp;writing&nbsp;of&nbsp;the&nbsp;file&nbsp;is&nbsp;based&nbsp;on&nbsp;a&nbsp;Feature&nbsp;class&nbsp;-&nbsp;maybe&nbsp;I&nbsp;can&nbsp;somehow&nbsp;subclass&nbsp;it&nbsp;and&nbsp;have&nbsp;it&nbsp;written&nbsp;or&nbsp;is&nbsp;it&nbsp;something&nbsp;internally&nbsp;with&nbsp;how&nbsp;the&nbsp;TabFeatureSource.CreateTabFile(...);&nbsp;works?

Maybe&nbsp;you&nbsp;can&nbsp;think&nbsp;of&nbsp;a&nbsp;way&nbsp;to&nbsp;"hack"&nbsp;it?

If&nbsp;not,&nbsp;and&nbsp;I&nbsp;hope&nbsp;it&nbsp;is&nbsp;ok&nbsp;to&nbsp;ask&nbsp;it&nbsp;here,&nbsp;do&nbsp;you&nbsp;know&nbsp;of&nbsp;another&nbsp;way&nbsp;I&nbsp;can&nbsp;do&nbsp;that?&nbsp;(e.g.&nbsp;open&nbsp;source&nbsp;library).&nbsp;I&nbsp;really&nbsp;like&nbsp;your&nbsp;Silverlight&nbsp;Edition&nbsp;but&nbsp;unfortunately,&nbsp;this&nbsp;TAB&nbsp;file&nbsp;creation&nbsp;is&nbsp;an&nbsp;important&nbsp;requirement&nbsp;for&nbsp;the&nbsp;first&nbsp;phase&nbsp;of&nbsp;my&nbsp;development&nbsp;(until&nbsp;I&nbsp;can&nbsp;"wean"&nbsp;my&nbsp;users&nbsp;away&nbsp;from&nbsp;these&nbsp;TAB&nbsp;dependant&nbsp;platforms&nbsp;;-)

Thanks,

Tomer

&nbsp;

---

<div class="post-metadata">

**Author:** ![Tomer](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/41988e/32.png) [@Tomer](https://community.thinkgeo.com/u/Tomer)\
**Post date:** [September 14, 2011, 2:00am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/4 "2011-09-14T02:00:06Z")

</div>

Anyone,&nbsp;anything?&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [September 14, 2011, 8:13am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/5 "2011-09-14T08:13:51Z")

</div>

&nbsp;Thomer,

&nbsp;  
Sorry&nbsp;for&nbsp;answering&nbsp;you&nbsp;delay&nbsp;we&nbsp;just&nbsp;back&nbsp;to&nbsp;work&nbsp;from&nbsp;the&nbsp;holiday,  
&nbsp;  
First&nbsp;I&nbsp;will&nbsp;tell&nbsp;you&nbsp;a&nbsp;little&nbsp;about&nbsp;the&nbsp;static&nbsp;function&nbsp;CreateTabFile,&nbsp;when&nbsp;calling&nbsp;this&nbsp;function&nbsp;in&nbsp;your&nbsp;application,&nbsp;it&nbsp;would&nbsp;call&nbsp;the&nbsp;CreateTabFile&nbsp;function&nbsp;of&nbsp;TabFeatureSource&nbsp;class,&nbsp;the&nbsp;TabFeatureSource&nbsp;class&nbsp;wraps&nbsp;the&nbsp;core&nbsp;functions&nbsp;for&nbsp;native&nbsp;tab&nbsp;file&nbsp;that&nbsp;includes&nbsp;the&nbsp;create&nbsp;tab&nbsp;file&nbsp;method.&nbsp;But&nbsp;currently,&nbsp;we&nbsp;don't&nbsp;support&nbsp;the&nbsp;ability&nbsp;for&nbsp;creating&nbsp;tab&nbsp;file&nbsp;with&nbsp;your&nbsp;special&nbsp;styles.&nbsp;We&nbsp;just&nbsp;support&nbsp;the&nbsp;special&nbsp;styles&nbsp;when&nbsp;rendering&nbsp;the&nbsp;tab&nbsp;file,&nbsp;not&nbsp;create&nbsp;it.&nbsp;  
&nbsp;  
Also&nbsp;the&nbsp;CreateTabFile&nbsp;method&nbsp;does&nbsp;not&nbsp;allow&nbsp;the&nbsp;user&nbsp;to&nbsp;override&nbsp;it,&nbsp;it&nbsp;is&nbsp;a&nbsp;static&nbsp;method.&nbsp;The&nbsp;attachment&nbsp;is&nbsp;the&nbsp;core&nbsp;method&nbsp;for&nbsp;creating&nbsp;a&nbsp;feature&nbsp;to&nbsp;the&nbsp;tab&nbsp;file.&nbsp;You&nbsp;can&nbsp;see&nbsp;there&nbsp;are&nbsp;not&nbsp;any&nbsp;codes&nbsp;represent&nbsp;writing&nbsp;the&nbsp;style&nbsp;information.&nbsp;The&nbsp;native&nbsp;tab&nbsp;file&nbsp;support&nbsp;is&nbsp;an&nbsp;new&nbsp;part&nbsp;from&nbsp;5.0.0.0&nbsp;of&nbsp;MapSuite,&nbsp;it&nbsp;is&nbsp;from&nbsp;a&nbsp;third&nbsp;part&nbsp;component&nbsp;that&nbsp;we&nbsp;converted&nbsp;it&nbsp;to&nbsp;our&nbsp;product.&nbsp;Anyway,&nbsp;your&nbsp;suggestion&nbsp;is&nbsp;really&nbsp;good&nbsp;for&nbsp;us,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;suggest&nbsp;it&nbsp;on&nbsp;our&nbsp;enhancement&nbsp;tracker&nbsp;at:&nbsp;&nbsp;  
&nbsp;  
&nbsp;[helpdesk.thinkgeo.com/EnhancementTracker](http://helpdesk.thinkgeo.com/EnhancementTracker)  
&nbsp;  
and&nbsp;see&nbsp;if&nbsp;the&nbsp;Map&nbsp;Suite&nbsp;community&nbsp;will&nbsp;give&nbsp;it&nbsp;any&nbsp;votes.&nbsp;We&nbsp;will&nbsp;consider&nbsp;to&nbsp;add&nbsp;the&nbsp;ability&nbsp;to&nbsp;the&nbsp;next&nbsp;public&nbsp;release,  
&nbsp;  
Thanks,  
&nbsp;  
Scott,  
&nbsp;  
&nbsp;  
  
[createTabFeatureCore.txt](https://community.thinkgeo.com/uploads/default/original/2X/c/c58c30efdc5dc8d94892f48cff59e7c3cc9c38ff.txt) (6.61 KB)

---

<div class="post-metadata">

**Author:** ![Tomer](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/t/41988e/32.png) [@Tomer](https://community.thinkgeo.com/u/Tomer)\
**Post date:** [September 25, 2011, 11:26am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/6 "2011-09-25T11:26:01Z")

</div>

Hi&nbsp;Scott,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;the&nbsp;reply.&nbsp;I&nbsp;didn’t&nbsp;see&nbsp;notification&nbsp;so&nbsp;I&nbsp;just&nbsp;read&nbsp;it&nbsp;now.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Maybe&nbsp;the&nbsp;ability&nbsp;to&nbsp;create&nbsp;a&nbsp;styled&nbsp;layer&nbsp;file&nbsp;(e.g.&nbsp;Shape&nbsp;file&nbsp;or&nbsp;some&nbsp;other&nbsp;format)&nbsp;is&nbsp;possible?&nbsp;  
&nbsp;&nbsp;  
&nbsp;At&nbsp;the&nbsp;end&nbsp;I&nbsp;need&nbsp;to&nbsp;be&nbsp;able&nbsp;to&nbsp;export&nbsp;the&nbsp;features&nbsp;with&nbsp;styles&nbsp;in&nbsp;a&nbsp;way&nbsp;that&nbsp;3rd&nbsp;party&nbsp;viewers&nbsp;(e.g.&nbsp;MapInfo&nbsp;Pro,&nbsp;etc)&nbsp;will&nbsp;be&nbsp;able&nbsp;to&nbsp;present&nbsp;is&nbsp;as&nbsp;I&nbsp;am&nbsp;presenting&nbsp;it&nbsp;within&nbsp;MapSuite&nbsp;rendered&nbsp;map…&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Tomer

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [September 27, 2011, 11:36am UTC](https://community.thinkgeo.com/t/formatting-mapinfo-tab-file/6957/7 "2011-09-27T11:36:14Z")

</div>

Hi&nbsp;Tomer,&nbsp;  
&nbsp;&nbsp;  
&nbsp;For&nbsp;all&nbsp;I&nbsp;know,&nbsp;Both&nbsp;the&nbsp;shape&nbsp;file&nbsp;and&nbsp;tab&nbsp;file&nbsp;don’t&nbsp;support&nbsp;style,&nbsp;only&nbsp;something&nbsp;like&nbsp;KML&nbsp;should&nbsp;support&nbsp;that.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Sorry&nbsp;our&nbsp;map&nbsp;control&nbsp;don’t&nbsp;support&nbsp;create&nbsp;KML,&nbsp;and&nbsp;I&nbsp;am&nbsp;not&nbsp;sure&nbsp;whether&nbsp;the&nbsp;3rd&nbsp;part&nbsp;viewers&nbsp;support&nbsp;read&nbsp;that.&nbsp;  
&nbsp;&nbsp;  
&nbsp;But&nbsp;if&nbsp;the&nbsp;3rd&nbsp;part&nbsp;viewer&nbsp;support&nbsp;read&nbsp;that,&nbsp;you&nbsp;can&nbsp;try&nbsp;to&nbsp;create&nbsp;logic&nbsp;for&nbsp;build&nbsp;it.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Regards,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Don
