<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechBlog &#187; BigText</title>
	<atom:link href="http://techblog.byllemos.com/tag/bigtext/feed/" rel="self" type="application/rss+xml" />
	<link>http://techblog.byllemos.com</link>
	<description>Accelerating into the Future with Wisdom about Technology! Ingrid Byllemos</description>
	<lastBuildDate>Tue, 05 Jan 2010 00:04:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Using BigText in a Report</title>
		<link>http://techblog.byllemos.com/2009/04/using-bigtext-in-a-report/</link>
		<comments>http://techblog.byllemos.com/2009/04/using-bigtext-in-a-report/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 21:41:40 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[Navision]]></category>
		<category><![CDATA[BigText]]></category>
		<category><![CDATA[Report]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=174</guid>
		<description><![CDATA[<p>As you properly know BigText can be used to handle large texts.<br />
BigText is stored in records as Blob fields, so what to do if you like to use the BigText in a Report?</p>
<p>First you have to get&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>As you properly know BigText can be used to handle large texts.<br />
BigText is stored in records as Blob fields, so what to do if you like to use the BigText in a Report?</p>
<p>First you have to get the text from the Blob field. This is done by using streams.<span id="more-174"></span></p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="cside"><div class="devcodeoverflow">
myDemoTable.FIND(’-’);
myDemoTable.CALCFIELDS(BlobField);
myDemoTable.BlobField.CREATEINSTREAM(InStr);
varBigText.READ(InStr);
</div></pre><!--END_DEVFMTCODE--></p>
<p>See also one of my ealier posts about Strings: <a title="Strings larger then 250 characters" href="http://techblog.byllemos.com/?p=53" target="_blank">Strings larger then 250 characters</a></p>
<p>How do we now use the BigText in a Report? Reports cannot handle a Big Text variable, but a Text variable. So what you have to do is to read parts of the BigText, split it nicely and then fill it into a Text variable, which then can be used.</p>
<p>Ok &#8211; let’s look on some details.</p>
<p>Define an Integer DataItem. This is used to handle the run through of the BigText variable.</p>
<p>On the Integer &#8211; OnPreDataItem you should set the variable Pos.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="cside"><div class="devcodeoverflow">
Pos := 1

</div></pre><!--END_DEVFMTCODE--></p>
<p>Pos is used to note which starting position you should get Text from.</p>
<p>Now on the AfterGetRecord add the code to handle the Text:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="cside"><div class="devcodeoverflow">
IF Pos > varBigText.Length THEN
  CurrReport.BREAK;

varBigText.GETSUBTEXT(varBigText_as_Text,Pos,100);
varBigText_as_Text := WhereToSplit(varBigText_as_Text, Pos);

</div></pre><!--END_DEVFMTCODE--></p>
<p>GETSUBTEXT returns text to the variable varBigText_as_Text from position Pos and number of characters to return is 100. 100 is the size of my Text variable.</p>
<p>Next we use the function WhereToSplit to get a nicely splitted text, and after this we are ready to use the Text in the Report <img src='http://techblog.byllemos.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I assume you know how to add a Text variable to the Sections of a Report, so will not describe this <img src='http://techblog.byllemos.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The function WhereToSplit looks like this:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="cside"><div class="devcodeoverflow">
i := STRLEN(InText);

IF i = 0 THEN
  EXIT;

WHILE (NOT (InText[i] IN [' ',',','.'])) AND (i > 1) DO
  i -= 1;

Pos += i;

IF i > 0 THEN
  outText := COPYSTR(InText,1,i);

</div></pre><!--END_DEVFMTCODE--></p>
<p>It finds the last space, comma or point and splits the text there.</p>
<p>That’s all &#8211; now you can print Big Text in you Report <img src='http://techblog.byllemos.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2009/04/using-bigtext-in-a-report/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strings larger then 250 characters</title>
		<link>http://techblog.byllemos.com/2008/03/strings-larger-then-250-characters/</link>
		<comments>http://techblog.byllemos.com/2008/03/strings-larger-then-250-characters/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 21:58:15 +0000</pubDate>
		<dc:creator>iby</dc:creator>
				<category><![CDATA[Basics]]></category>
		<category><![CDATA[BigText]]></category>
		<category><![CDATA[Navision]]></category>
		<category><![CDATA[Strings]]></category>

		<guid isPermaLink="false">http://techblog.byllemos.com/?p=53</guid>
		<description><![CDATA[<p>In the early version of Navision it was only possible to handle string with a length up till 250 characters. This was often not enough and there was only a few ways to handle those strings. E.g. store the info&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>In the early version of Navision it was only possible to handle string with a length up till 250 characters. This was often not enough and there was only a few ways to handle those strings. E.g. store the info in several fields, variables or a text file &#8211; that was imported to a blob field.</p>
<p>From Navision 4 it was suddenly possible to handle strings with a length up till 2147483647 characters &#8211; this is equivalent to 2 gb. In Navision 4 the data type BigText was introduced.<br />
<span id="more-53"></span><br />
BigText can only be used for variables (global, local) and not as a field type (in a table). If you need to store a BigText value in a table, then the BigText data must be moved to a BLOB.</p>
<p>BigText can not be displayed in forms, message windows or in the debugger.</p>
<p>To assign text to a BigText variable use the commands ADDTEXT.</p>
<blockquote><p>varBigText.ADDTEXT(’my text’);<br />
varBigText.ADDTEXT(varMyText);<br />
varBigText.ADDTEXT(varMyText,atPosition);</p></blockquote>
<blockquote><p>If no position is omitted, the text will be added to the end of the BigText variable.</p></blockquote>
<p>To read text from a BigText variable use the command GETSUBTEXT</p>
<blockquote><p>varBigText.GETSUBTEXT(varText,atPosition,Length) ;</p></blockquote>
<blockquote><p>If Length is not ommitted, then the function GETSUBTEXT will retrieve data from the beginning position (atPosition) till the end of the BigText Variable.</p></blockquote>
<p>The command TEXTPOS, can be used to search for a text in a BigText variable.</p>
<blockquote><p>atPos := varBigText.TEXTPOS(’my search text’);</p></blockquote>
<blockquote><p>This function will often be used in combination with GETSUBTEXT</p></blockquote>
<p>To get current length of a BigText variable use the command LENGTH.</p>
<blockquote><p>StrLength := varBigText.LENGTH</p></blockquote>
<p>To stream a BigText variable into a BLOB use the command WRITE.</p>
<blockquote><p>varBigText.ADDTEXT(’Text to be stored in a BLOB field ‘);<br />
myDemoTable.BlobField.CREATEOUTSTREAM(outstr);<br />
varBigText.WRITE(outstr);<br />
myDemoTable.INSERT;</p></blockquote>
<p>To stream a BLOB into a BigText variable use the command READ.</p>
<blockquote><p>myDemoTable.FIND(’-&#8217;);<br />
myDemoTable.CALCFIELDS(BlobField);<br />
myDemoTable.BlobField.CREATEINSTREAM(InStr);<br />
varBigText.READ(InStr);</p></blockquote>
<p>Now you are able to create functionality which reads entire text files, text streams into BigText variables, perform searches in the BigText variables and store the entire file info in a BLOB field.</p>
]]></content:encoded>
			<wfw:commentRss>http://techblog.byllemos.com/2008/03/strings-larger-then-250-characters/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

