<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-1850047779793623762</atom:id><lastBuildDate>Thu, 28 Jul 2011 21:00:22 +0000</lastBuildDate><title>DotNetIdeas</title><description>.NET Framework/Compact Framework and SharePoint Programming Tips and Tricks</description><link>http://dotnetideasblog.blogspot.com/search/label/Others</link><managingEditor>noreply@blogger.com (DotNetIdeas)</managingEditor><generator>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-4637016794010696104</guid><pubDate>Wed, 11 Aug 2010 21:53:00 +0000</pubDate><atom:updated>2010-08-11T14:53:42.199-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>ComponentOne 2.x upgrade issues</title><description>&lt;p&gt;We&amp;#160; have been using ComponentOne 1.x for quite some time. We used C1PrintDocument to merge some RTF templates and generate PDF document. Recently we planed to upgrade our server to 64-bit machine. When we tested out the ComponentOne PDF generation code, we kept getting &amp;quot;Attempted to read or write protected memory. This is often an indication that other memory is corrupt&amp;quot; error. After upgrade to ComponentOne 2.x, that issue is gone. However, we ran into several other issues. When I re-compile the code after the upgrade, a lot of syntax do not work anymore. Some of them are easy to fix, but some of the deprecated functions are not that easy to replace since they no longer exist in the package. There are the changes I want to document here:&lt;/p&gt;  &lt;p&gt;1. &amp;quot;Page [@@PageNo@@] of [@@PageCount@@]&amp;quot;&lt;/p&gt;  &lt;p&gt;If you have used the code above, you have to add the following code now in order to use them:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1PrintDocument1.TagOpenParen = &lt;span style="color: #006080"&gt;&amp;quot;[@@&amp;quot;&lt;/span&gt;;
c1PrintDocument1.TagCloseParen = &lt;span style="color: #006080"&gt;&amp;quot;@@]&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;2. Table border style&lt;/p&gt;

&lt;p&gt;from:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;RenderTable headerTable = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RenderTable(c1PrintDocument1);
headerTable.Style.Borders.AllEmpty = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
headerTable.StyleTableCell.BorderTableHorz.Empty = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;
headerTable.StyleTableCell.BorderTableVert.Empty = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;RenderTable headerTable = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RenderTable(c1PrintDocument1);
headerTable.Style.Borders.All = LineDef.Empty;
headerTable.Style.GridLines.All = LineDef.Empty;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;3. Page Header/Footer&lt;/p&gt;

&lt;p&gt;from:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1PrintDocument1.PageHeader.RenderObject = headerTable;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;c1PrintDocument1.PageLayouts.Default.PageHeader = headerTable;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;4. Check remaining space&lt;/p&gt;

&lt;p&gt;from:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;RenderRichText obj = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RenderRichText(c1PrintDocument1);
obj = ...;
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c1PrintDocument1.AvailableBlockFlowHeight &amp;lt; c1PrintDocument1.MeasureBlock(obj).Height) 
    c1PrintDocument1.NewPage();&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;to:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;RenderRichText obj = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RenderRichText(c1PrintDocument1);
SizeD objSize = obj.CalcSize(&lt;span style="color: #006080"&gt;&amp;quot;2in&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;auto&amp;quot;&lt;/span&gt;);
&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (c1PrintDocument1.AvailableBlockFlowHeight &amp;lt; objSize.Height) 
    c1PrintDocument1.NewPage();&lt;/pre&gt;
&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-4637016794010696104?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2010/08/componentone-2x-upgrade-issues.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-3316216189685171300</guid><pubDate>Mon, 16 Nov 2009 21:23:00 +0000</pubDate><atom:updated>2009-11-16T13:23:38.219-08:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.</title><description>&lt;p&gt;We just experienced a problem with web services authentication. Two of our production servers suddenly failed to authenticate users. We kept getting the 401.1 error. We are using &amp;quot;digest authentication&amp;quot;. We had this issue before when we setup a new server. Rebooting the server fixed it. However, this time the trick didn't work. Finally, our administrator decided to remove the server from the domain and re-join it. That fixed the issue.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-3316216189685171300?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/11/http-error-4011-unauthorized-access-is.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-8683951125187496143</guid><pubDate>Fri, 25 Sep 2009 20:55:00 +0000</pubDate><atom:updated>2009-09-25T13:55:51.871-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>Learning Silverlight – Miscellaneous Tips</title><description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;How to use OpenFileDialog?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;OpenFileDialog ofd = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; OpenFileDialog();&lt;br /&gt;ofd.Multiselect = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;br /&gt;ofd.Filter = &lt;span style="color: #006080"&gt;&amp;quot;xml files (*.xml)|*.xml&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (ofd.ShowDialog()==&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; fileContent = ofd.File.OpenText().ReadToEnd();&lt;br /&gt;    &lt;span style="color: #008000"&gt;// do some thing&lt;/span&gt;&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;
  &lt;br /&gt;&lt;strong&gt;&lt;em&gt;How to use SaveFileDialog?&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;SaveFileDialog sfd = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; SaveFileDialog();&lt;br /&gt;sfd.Filter = &lt;span style="color: #006080"&gt;&amp;quot;xml files (*.xml)|*.xml&amp;quot;&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (sfd.ShowDialog() == &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] fileBytes = System.Text.Encoding.UTF8.GetBytes(fileString); &lt;span style="color: #008000"&gt;// fileString would be something you want to save to the file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; (Stream fs = (Stream)sfd.OpenFile())&lt;br /&gt;    {&lt;br /&gt;        fs.Write(fileBytes, 0, fileBytes.Length);&lt;br /&gt;        fs.Close();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How to parse XML?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To parse a XML file like this:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;List&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;DotNetIdeas.CF.RecipeBox.RecipeBox&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;category&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Breakfast&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;order&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;item&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;pan cake&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;item&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;milk&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;category&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Desert&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;order&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;List&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;

    &lt;br /&gt;&lt;/div&gt;
You can do something like this:&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;XDocument xd = XDocument.Parse(xml);&lt;br /&gt;&lt;br /&gt;XElement node = xd.Root;&lt;br /&gt;&lt;br /&gt;var categories = (from category &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; xd.Descendants(&lt;span style="color: #006080"&gt;&amp;quot;category&amp;quot;&lt;/span&gt;)&lt;br /&gt;                  select &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Category()&lt;br /&gt;                  {&lt;br /&gt;                      Name = category.Attribute(&lt;span style="color: #006080"&gt;&amp;quot;name&amp;quot;&lt;/span&gt;).Value,&lt;br /&gt;                      Order = Convert.ToInt32(category.Attribute(&lt;span style="color: #006080"&gt;&amp;quot;order&amp;quot;&lt;/span&gt;).Value),&lt;br /&gt;                      Items = FromXml(category.Elements(&lt;span style="color: #006080"&gt;&amp;quot;item&amp;quot;&lt;/span&gt;))&lt;br /&gt;                  }).ToList();&lt;br /&gt;       &lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;If you happened to be like me, migrating the code from some old programs, don’t forget to add “using System.Linq” which is in System.Core.dll. Otherwise you will get a compiler error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How to use TreeView?&lt;/em&gt;&lt;/strong&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/Sr0uVFwuTnI/AAAAAAAAAaY/r2QVdLI6Mfw/s1600-h/image%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_ElXg_EOWn5c/Sr0uVrCHxmI/AAAAAAAAAac/ib99sjmwrNQ/image_thumb.png?imgmax=800" width="244" height="223" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create a TreeView like this one, you will need to use HierarchicalDataTemplate. It is in System.Windows.Controls. So add the following namespace first:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;xmlns:control=&amp;quot;clr-namespace:System.Windows;assembly=System.Windows.Controls&amp;quot;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&amp;lt;controls:TreeView x:Name=&lt;span style="color: #006080"&gt;&amp;quot;ingredientList&amp;quot;&lt;/span&gt; Height=&lt;span style="color: #006080"&gt;&amp;quot;330&amp;quot;&lt;/span&gt; Width=&lt;span style="color: #006080"&gt;&amp;quot;248&amp;quot;&lt;/span&gt; Canvas.Left=&lt;span style="color: #006080"&gt;&amp;quot;17&amp;quot;&lt;/span&gt; Canvas.Top=&lt;span style="color: #006080"&gt;&amp;quot;18&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;    &amp;lt;controls:TreeView.ItemTemplate&amp;gt;&lt;br /&gt;        &amp;lt;control:HierarchicalDataTemplate ItemsSource=&lt;span style="color: #006080"&gt;&amp;quot;{Binding Items}&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;            &amp;lt;StackPanel Orientation=&lt;span style="color: #006080"&gt;&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&amp;gt;&lt;br /&gt;                &amp;lt;CheckBox x:Name=&lt;span style="color: #006080"&gt;&amp;quot;itemCheckbox&amp;quot;&lt;/span&gt; IsChecked=&lt;span style="color: #006080"&gt;&amp;quot;{Binding ItemChecked, Mode=TwoWay}&amp;quot;&lt;/span&gt;/&amp;gt;&lt;br /&gt;                &amp;lt;TextBlock Text=&lt;span style="color: #006080"&gt;&amp;quot;{Binding Path=Name}&amp;quot;&lt;/span&gt; /&amp;gt;&lt;br /&gt;            &amp;lt;/StackPanel&amp;gt;&lt;br /&gt;        &amp;lt;/control:HierarchicalDataTemplate&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;/controls:TreeView.ItemTemplate&amp;gt;&lt;br /&gt;&amp;lt;/controls:TreeView&amp;gt;&lt;br /&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;&lt;strong&gt;&lt;em&gt;How to force data binding in TextChanged event?&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;

&lt;div&gt;When a text box has data binding, it will not update the source until it lost the focus. Sometimes we want the source to change as soon as we type something. Here is how to do it:&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ingredientName_TextChanged(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, System.Windows.Controls.TextChangedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    BindingExpression bExp = ingredientName.GetBindingExpression(TextBox.TextProperty);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (bExp != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;br /&gt;    {&lt;br /&gt;        bExp.UpdateSource();&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div&gt;
  &lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-8683951125187496143?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/09/learning-silverlight-miscellaneous-tips.html</link><author>noreply@blogger.com (DotNetIdeas)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_ElXg_EOWn5c/Sr0uVrCHxmI/AAAAAAAAAac/ib99sjmwrNQ/s72-c/image_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-7126726765664671084</guid><pubDate>Fri, 25 Sep 2009 14:25:00 +0000</pubDate><atom:updated>2009-09-25T07:25:41.414-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>Learning Silverlight – How to programmatically add animation?</title><description>&lt;p&gt;Recently I created a little Silverlight application called “&lt;a href="http://www.dotnetideas.com/silverlight/littlemath/littlemath.html"&gt;LittleMath&lt;/a&gt;”. It is a simple number addition game. It randomly generate two numbers between 0 and 9. The user clicks on the number pad to give the answer and check it by clicking on “Check Answer”. This is my first Silverlight application. I found it very interesting. With the help of Expression Blend, you can build nice looking application with animation fairly quickly. However, sometimes you may need to animation programmatically. In my &lt;a href="http://www.dotnetideas.com/silverlight/littlemath/littlemath.html"&gt;demo&lt;/a&gt;, when you check “Show Beads”, it will show the red beads one by one according to the randomly generated numbers. Here is how to do it.&lt;/p&gt;  &lt;p&gt;First we create a story board and animation duration for each bead:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;div id="codeSnippetWrapper"&gt;&lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;double&lt;/span&gt; beadDuration = 0.5;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Storyboard showBeadsStoryBoard = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Storyboard();&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Then add the story board to resources with a name&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;LayoutRoot.Resources.Add(&lt;span style="color: #006080"&gt;&amp;quot;showBeads&amp;quot;&lt;/span&gt;, showBeadsStoryBoard);&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;

&lt;div&gt;Before showing the beads, we need to clear the existing beads. Then set the story board duration based on the total numbers. For each bead, we create a DoubleAnimation so the bead will gradually appear on the screen. Because we want the bead to show up one by one, we will need to set the BeginTime. The rest is pretty straight forward. 
  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ShowBeads()&lt;br /&gt;{&lt;br /&gt;    ClearBeads();&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; num1 = Convert.ToInt32(number1.Text);&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; num2 = Convert.ToInt32(number2.Text);&lt;br /&gt;    Duration storyBoardduration = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Duration(TimeSpan.FromSeconds(beadDuration * (num1 + num2)+1));&lt;br /&gt;    showBeadsStoryBoard.Duration = storyBoardduration;&lt;br /&gt;    Duration duration = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Duration(TimeSpan.FromSeconds(beadDuration));&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; num1; i++)&lt;br /&gt;    {&lt;br /&gt;        AddBead(beadsPanel1, TimeSpan.FromSeconds(beadDuration * i + 1), duration);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; num2; i++)&lt;br /&gt;    {&lt;br /&gt;        AddBead(beadsPanel2, TimeSpan.FromSeconds(beadDuration * (num1 + i) + 1), duration);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Begin the animation.&lt;/span&gt;&lt;br /&gt;    showBeadsStoryBoard.Begin();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AddBead(StackPanel beadsPanel, TimeSpan beginTime, Duration duration)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Add bead&lt;/span&gt;&lt;br /&gt;    Ellipse bead = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Ellipse();&lt;br /&gt;    bead.Width = 20;&lt;br /&gt;    bead.Height = 20;&lt;br /&gt;    bead.Margin = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Thickness(0);&lt;br /&gt;    bead.Fill = beadBrush;&lt;br /&gt;    bead.Opacity = 0;&lt;br /&gt;    beadsPanel.Children.Add(bead);&lt;br /&gt;               &lt;br /&gt;    &lt;span style="color: #008000"&gt;// Add animation&lt;/span&gt;&lt;br /&gt;    DoubleAnimation beadDoubleAnimation = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DoubleAnimation();&lt;br /&gt;    beadDoubleAnimation.Duration = duration;&lt;br /&gt;    beadDoubleAnimation.BeginTime = beginTime;&lt;br /&gt;    showBeadsStoryBoard.Children.Add(beadDoubleAnimation);&lt;br /&gt;    Storyboard.SetTarget(beadDoubleAnimation, bead);&lt;br /&gt;    Storyboard.SetTargetProperty(beadDoubleAnimation, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyPath(&lt;span style="color: #006080"&gt;&amp;quot;(UIElement.Opacity)&amp;quot;&lt;/span&gt;));&lt;br /&gt;    beadDoubleAnimation.To = 1;&lt;br /&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ClearBeads()&lt;br /&gt;{&lt;br /&gt;    showBeadsStoryBoard.Stop();&lt;br /&gt;    beadsPanel1.Children.Clear();&lt;br /&gt;    beadsPanel2.Children.Clear();&lt;br /&gt;}&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;It is really neat. 
  &lt;br /&gt;&lt;/div&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-7126726765664671084?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/09/learning-silverlight-how-to.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-5684161142594705455</guid><pubDate>Fri, 04 Sep 2009 15:30:00 +0000</pubDate><atom:updated>2009-09-04T08:30:11.384-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>How to make an icon’s background transparent using Visual Studio Icon Editor?</title><description>&lt;p&gt;To make an icon’s background transparent, you open the icon file using Visual Studio Icon Editor, choose the “Fill Tool”. Then choose the “Transparent” color from “Colors” on the left. Click on the areas you want to make transparent. That’s it.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ElXg_EOWn5c/SqEygAwF8LI/AAAAAAAAAaQ/KeAVUD_cJ1A/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_ElXg_EOWn5c/SqEygkRLHiI/AAAAAAAAAaU/vppTJQH6cJo/image_thumb%5B1%5D.png?imgmax=800" width="463" height="291" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-5684161142594705455?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/09/how-to-make-icons-background.html</link><author>noreply@blogger.com (DotNetIdeas)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_ElXg_EOWn5c/SqEygkRLHiI/AAAAAAAAAaU/vppTJQH6cJo/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-8387775880895108784</guid><pubDate>Wed, 02 Sep 2009 14:12:00 +0000</pubDate><atom:updated>2009-09-09T12:03:53.992-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>Microsoft Bing on SmartPhone</title><description>&lt;p&gt;To download “Bing”, type m.bing.com in your web browser. Click “Download interactive maps” for Windows Mobile. Then following the on-screen instruction.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_ElXg_EOWn5c/Sp59O7QTMeI/AAAAAAAAAZg/mMsdD_yJPZc/s1600-h/image5.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_ElXg_EOWn5c/Sp59PIwr9fI/AAAAAAAAAZk/y-kMe6Q_GPw/image_thumb1%5B1%5D.png?imgmax=800" width="187" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;After the installation, you will see the “Bing” icon in Programs.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/Sp59PlaHH9I/AAAAAAAAAZo/J75tGV8v59M/s1600-h/image14.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_ElXg_EOWn5c/Sp59P1orgjI/AAAAAAAAAZs/1L9mhm9sYlI/image_thumb4.png?imgmax=800" width="185" height="244" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Tap on “Bing” icon to run it. Below is the dashboard of Bing. The Map is very similar to Google Map. It also use cellular phone tower to decide your location, so it is not very accurate. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/Sp59QCeZNvI/AAAAAAAAAZw/mSPFCYuAkH0/s1600-h/image17.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_ElXg_EOWn5c/Sp59QtMxmtI/AAAAAAAAAZ0/9wGkLmxrA1Y/image_thumb5.png?imgmax=800" width="185" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The two features I really like is the “Traffic” and “Movies”. The “Traffic” map seems accurate and it automatically update every 2 minutes. The “Movies” is easy to navigate. You can quickly find the theater a movie is playing in or check the show time of any particular theater around your area. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_ElXg_EOWn5c/Sp59RkSH7GI/AAAAAAAAAZ4/d-3e-bucX-c/s1600-h/image2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_ElXg_EOWn5c/Sp59Sb4n1AI/AAAAAAAAAZ8/DGeBld6rJbU/image_thumb.png?imgmax=800" width="185" height="244" /&gt;&lt;/a&gt; &lt;a href="http://lh6.ggpht.com/_ElXg_EOWn5c/Sp59TLfTKcI/AAAAAAAAAaA/n5vED9nLVKw/s1600-h/image5%5B1%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_ElXg_EOWn5c/Sp59Tnb9s0I/AAAAAAAAAaE/UjwLiEOHK4Q/image_thumb1.png?imgmax=800" width="186" height="244" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;The “Gas Princes” searches the lowest gas price around your area. But I think they could add more sorting capabilities.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_ElXg_EOWn5c/Sp59UP28ARI/AAAAAAAAAaI/xyPrk8Znr2A/s1600-h/image8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh5.ggpht.com/_ElXg_EOWn5c/Sp59Ut70dxI/AAAAAAAAAaM/jA0dxu_LSOg/image_thumb2.png?imgmax=800" width="184" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;“Categories” allow you search local business by category. It is like a yellow page and I think it is very handy.&lt;/p&gt;  &lt;p&gt;“Collections” has some predefined search criteria. I found the “Upcoming event” is kind of strange.&amp;#160; It is not sorted by date/time. It even listed classes at some hospitals.&lt;/p&gt;  &lt;p&gt;“Bing” crashed a couple times when the memory on my cell phone running low. With all the maps and automatic updates, you could imagine that it requires a lot of resources. But overall, I think “Bing” is a really nice application. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-8387775880895108784?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/09/microsoft-bing-on-smartphone.html</link><author>noreply@blogger.com (DotNetIdeas)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_ElXg_EOWn5c/Sp59PIwr9fI/AAAAAAAAAZk/y-kMe6Q_GPw/s72-c/image_thumb1%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-7609078041426748221</guid><pubDate>Tue, 17 Mar 2009 18:56:00 +0000</pubDate><atom:updated>2009-03-17T11:56:51.597-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>Display HTML code in HTML web page</title><description>&lt;p&gt;To display HTML code in a HTML page, you need first to replace &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; with &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;amp;gt;&amp;quot;, then add &amp;lt;pre&amp;gt;&amp;lt;/pre&amp;gt; around them. Here is an example:&lt;/p&gt;  &lt;p&gt;To display the following in a HTML page&lt;/p&gt;  &lt;p&gt;&amp;lt;h2&amp;gt;Header&amp;lt;/h2&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;p&amp;gt;This is my HTML code&amp;lt;/p&amp;gt;&lt;/p&gt;  &lt;p&gt;You actually have the following text in your HTML page&lt;/p&gt;  &lt;p&gt;&amp;lt;pre&amp;gt;&amp;amp;lt;h2&amp;amp;gt;Header&amp;amp;lt;/h2&amp;amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;amp;lt;p&amp;amp;gt;This is my HTML code&amp;amp;lt;/p&amp;amp;gt;&amp;lt;/pre&amp;gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-7609078041426748221?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/03/display-html-code-in-html-page.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-6452857121959279689</guid><pubDate>Mon, 16 Mar 2009 22:02:00 +0000</pubDate><atom:updated>2009-10-20T09:18:23.037-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>Using OLE web browser control in PowerBuilder?</title><description>&lt;p&gt;Using OLE web browser control in PowerBuilder is easy. You choose &amp;quot;Create OLE control&amp;quot; from control list. Click on &amp;quot;Insert Control&amp;quot; tab and choose &amp;quot;Microsoft Web Browser&amp;quot;. You may use it for web browsing or display PDF files. When I worked on a project in 2001, I had an issue with OLE Adobe Reader control in PowerBuilder. It had memory leak. After opening a handful PDF files, it would crash. Finally I found the solution to work around this issue. That was using &amp;quot;Microsoft Web Browser&amp;quot; control.&lt;/p&gt;  &lt;p&gt;Here is how to use it and some of the features I used:&lt;/p&gt;  &lt;p&gt;1. How to navigate?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;ole_browser.object.navigate(&amp;quot;&lt;a href="http://www.google.com"&gt;http://&lt;/a&gt;&lt;a href="http://www.google.com"&gt;www.google.com&lt;/a&gt;&lt;/a&gt;&amp;quot;)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;2. How to go back and forward?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;ole_browser.object.GoBack()&lt;/p&gt;    &lt;p&gt;ole_browser.object.GoForward()&lt;/p&gt;    &lt;p&gt;If you have the &amp;quot;Back&amp;quot; and &amp;quot;Forward&amp;quot; button, you will want to enable them only when there are pages you can go back and forward. Then you need to have the following code in the &amp;quot;&lt;strong&gt;commandstatechange&lt;/strong&gt;&amp;quot; event of the OLE control.&lt;/p&gt;    &lt;p&gt;CHOOSE CASE command      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; CASE 1 //CSC_NAVIGATEFORWARD       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cb_forrward.enabled = enable       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; CASE 2 //CSC_NAVIGATEBACK       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; cb_back.enabled = enable       &lt;br /&gt;END CHOOSE&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;3. How to get the url and name&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In &amp;quot;&lt;strong&gt;navigatecomplete2&lt;/strong&gt;&amp;quot; event you can use the following properties &lt;/p&gt; &lt;/blockquote&gt;  &lt;blockquote&gt;   &lt;p&gt;ole_browser.Object.LocationUrl&lt;/p&gt;    &lt;p&gt;ole_browser.Object.LocationName&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;4. How to do some common actions?&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;You may use &lt;strong&gt;ExecWB&lt;/strong&gt;(&amp;#160; &lt;em&gt;cmdID&lt;/em&gt;&lt;strong&gt; As OLECMDID&lt;/strong&gt;&lt;strong&gt;,&lt;/strong&gt;&amp;#160;&lt;em&gt;cmdexecopt&lt;/em&gt;&lt;strong&gt; As OLECMDEXECOPT&lt;/strong&gt;&lt;strong&gt;,&lt;/strong&gt;&amp;#160; [&lt;em&gt;pvaIn&lt;/em&gt;&lt;strong&gt; As &lt;strong&gt;Variant&lt;/strong&gt;&lt;/strong&gt;&lt;strong&gt;,&lt;/strong&gt;]&amp;#160; [&lt;em&gt;pvaOut&lt;/em&gt;&lt;strong&gt; As &lt;strong&gt;Variant&lt;/strong&gt;&lt;/strong&gt;]) to perform some common actions in Web Browser Control. For example, ole_browser.object.ExecWB(12, 2) is to copy the highlighted text. Below is the list of command arguments:&lt;/p&gt;    &lt;pre&gt;typedef enum  
{ 
     OLECMDID_OPEN                   = 1, 
     OLECMDID_NEW                    = 2, 
     OLECMDID_SAVE                   = 3, 
     OLECMDID_SAVEAS                 = 4, 
     OLECMDID_SAVECOPYAS             = 5, 
     OLECMDID_PRINT                  = 6, 
     OLECMDID_PRINTPREVIEW           = 7, 
     OLECMDID_PAGESETUP              = 8, 
     OLECMDID_SPELL                  = 9, 
     OLECMDID_PROPERTIES             = 10, 
     OLECMDID_CUT                    = 11, 
     OLECMDID_COPY                   = 12, 
     OLECMDID_PASTE                  = 13, 
     OLECMDID_PASTESPECIAL           = 14, 
     OLECMDID_UNDO                   = 15, 
     OLECMDID_REDO                   = 16, 
     OLECMDID_SELECTALL              = 17, 
     OLECMDID_CLEARSELECTION         = 18, 
     OLECMDID_ZOOM                   = 19, 
     OLECMDID_GETZOOMRANGE           = 20, 
     OLECMDID_UPDATECOMMANDS         = 21, 
     OLECMDID_REFRESH                = 22, 
     OLECMDID_STOP                   = 23, 
     OLECMDID_HIDETOOLBARS           = 24, 
     OLECMDID_SETPROGRESSMAX         = 25, 
     OLECMDID_SETPROGRESSPOS         = 26, 
     OLECMDID_SETPROGRESSTEXT        = 27, 
     OLECMDID_SETTITLE               = 28, 
     OLECMDID_SETDOWNLOADSTATE       = 29, 
     OLECMDID_STOPDOWNLOAD           = 30, 
     OLECMDID_ONTOOLBARACTIVATED     = 31, 
     OLECMDID_FIND                   = 32, 
     OLECMDID_DELETE                 = 33, 
     OLECMDID_HTTPEQUIV              = 34, 
     OLECMDID_HTTPEQUIV_DONE         = 35, 
     OLECMDID_ENABLE_INTERACTION     = 36, 
     OLECMDID_ONUNLOAD               = 37, 
     OLECMDID_PROPERTYBAG2           = 38, 
     OLECMDID_PREREFRESH             = 39, 
     OLECMDID_SHOWSCRIPTERROR        = 40, 
     OLECMDID_SHOWMESSAGE            = 41, 
     OLECMDID_SHOWFIND               = 42, 
     OLECMDID_SHOWPAGESETUP          = 43, 
     OLECMDID_SHOWPRINT              = 44, 
     OLECMDID_CLOSE                  = 45, 
     OLECMDID_ALLOWUILESSSAVEAS      = 46, 
     OLECMDID_DONTDOWNLOADCSS        = 47, 
     OLECMDID_UPDATEPAGESTATUS       = 48, 
     OLECMDID_PRINT2                 = 49, 
     OLECMDID_PRINTPREVIEW2          = 50, 
     OLECMDID_SETPRINTTEMPLATE       = 51, 
     OLECMDID_GETPRINTTEMPLATE       = 52, 
     OLECMDID_PAGEACTIONBLOCKED      = 55,
     OLECMDID_PAGEACTIONUIQUERY      = 56,
     OLECMDID_FOCUSVIEWCONTROLS      = 57,
     OLECMDID_FOCUSVIEWCONTROLSQUERY = 58,
     OLECMDID_SHOWPAGEACTIONMENU     = 59,
     OLECMDID_ADDTRAVELENTRY         = 60,
     OLECMDID_UPDATETRAVELENTRY      = 61,
     OLECMDID_UPDATEBACKFORWARDSTATE = 62,
     OLECMDID_OPTICAL_ZOOM           = 63,
     OLECMDID_OPTICAL_GETZOOMRANGE   = 64,
     OLECMDID_WINDOWSTATECHANGED     = 65,
     OLECMDID_ACTIVEXINSTALLSCOPE    = 66
} OLECMDID;&lt;/pre&gt;

  &lt;pre&gt;typedef enum  
{ 
    OLECMDEXECOPT_DODEFAULT        = 0, 
    OLECMDEXECOPT_PROMPTUSER       = 1, 
    OLECMDEXECOPT_DONTPROMPTUSER    = 2, 
    OLECMDEXECOPT_SHOWHELP         = 3 
} OLECMDEXECOPT; 
 &lt;/pre&gt;

  &lt;pre&gt;Although it says OLECMDEXECOPT_DONTPROMPTUSER = 2 doesn't show the dialog, but when you run execwb(6,2) to print a web page, it will always show the dialog. That is be design. Check Microsoft KB &lt;a title="http://support.microsoft.com/kb/247671" href="http://support.microsoft.com/kb/247671"&gt;http://support.microsoft.com/kb/247671&lt;/a&gt; for more info.&lt;/pre&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-6452857121959279689?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2009/03/using-ole-web-browser-control-in.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>1</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-1850047779793623762.post-8710481769506164783</guid><pubDate>Fri, 01 Dec 2006 15:50:00 +0000</pubDate><atom:updated>2009-03-18T08:47:32.288-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Others</category><title>How to use PowerBuilder to create PDF file?</title><description>&lt;p class="MsoNormal"&gt;When work on a project several years ago, I was asked to create PDF files using PowerBuilder and the process would be triggered by a web service written in C#. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;The first issue I ran into was how to communicate between PowerBuilder and .NET web services. I wrote about this in detail in &lt;a href="http://wuyueblog.blogspot.com/2008/11/how-to-communicate-between-net-and.html"&gt;another blog&lt;/a&gt; , so I am not going to repeat it here.&lt;/p&gt; &lt;p class="MsoNormal"&gt;Since PowerBuilder doesn’t have intellisense, it is hard to write code with a lot of business entities. So I put all the business logic on the .NET side. PowerBuilder was only used to take the data passed in, build the datawindow and save the datawindow to PDF file. &lt;/p&gt; &lt;p class="MsoNormal"&gt;Here are the steps for saving a datawindow into PDF file:&lt;/p&gt; &lt;ol style="margin-top: 0in" type="1"&gt; &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1"&gt;Install GhostScript. I have GhostScript 7.06 installed. You can download this from the Internet for free.  &lt;li class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-list: l0 level1 lfo1"&gt;Create a new folder under GhostScript directory c:\gs\PdfPrinterSetupFiles and copy the following files to this location. I don’t remember where I downloaded those files, but you should be able to find them on the Internet. &lt;/li&gt;&lt;/ol&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5.INF&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5.PPD&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5CS.PPD&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5CT.PPD&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5J.PPD&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;ADIST5K.PPD&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;PSCRIPT.DLL&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;PSCRIPT.DRV&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;PSCRIPT.HLP&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;PSCRPTUI.DLL&lt;/p&gt; &lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal"&gt;&lt;?xml:namespace prefix = o /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt; &lt;ol style="margin-top: 0in" type="1" start="3"&gt; &lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1"&gt;Setup a “Sybase DataWindow PS” printer on your machine.&lt;/li&gt;&lt;/ol&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;a)&lt;span style="font: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Open “Add Printer”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;b)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Hit Next in that dialog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2; tab-stops: 45.8pt 49.5pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;c)&lt;span style="font: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Select "Local Printer" and hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;d)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;For "Use the following port", select "File:" and hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2; tab-stops: 45.8pt 49.5pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;e)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Hit "Have Disk"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 45pt; text-indent: -9pt; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;f)&lt;span style="font: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Browse to the directory we created above (in item 6) and select the ADIST5.INF file, then hit Open.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2; tab-stops: 45.0pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;g)&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Hit OK to close the Install from Disk dialog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 49.5pt; text-indent: -13.5pt; mso-list: l1 level1 lfo2; tab-stops: 45.0pt 49.5pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;h)&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Select "Acrobat Distiller" and hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;i)&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;It may prompt you to keep existing driver, your choice, hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 45pt; text-indent: -9pt; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;j)&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;For Printer Name, enter "Sybase DataWindow PS".&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Or you can enter something else, and then add that printer name to the DataWindow print specs.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;k)&lt;span style="font: 7pt 'Times New Roman'"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;On printer sharing, hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;l)&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Decide whether or not you want a test page, and then hit Next.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; text-indent: -0.25in; mso-list: l1 level1 lfo2; tab-stops: 45.8pt .75in 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: calibri; mso-bidi-font-family: calibri"&gt;&lt;span style="mso-list: ignore"&gt;m)&lt;span style="font: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: 'Calibri','sans-serif'; mso-fareast-language: zh-cn; mso-fareast-font-family: simsun; mso-bidi-font-family: 'Times New Roman'"&gt;Hit Finish.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="margin-left: 0.75in; tab-stops: 45.8pt .75in 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;ol style="margin-top: 0in" type="1" start="4"&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1"&gt;Create a datawindow in the PowerBuilder application. Set the properties of the datawindow to the following&lt;/li&gt;&lt;/ol&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;dw_1.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;.DataWindow.Export.PDF.Method = Distill! &lt;br&gt;dw_1.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;.DataWindow.Printer = &lt;span style="color: #006080"&gt;"Sybase DataWindow PS"&lt;/span&gt; &lt;br&gt;dw_1.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;.DataWindow.Export.PDF.Distill.CustomPostScript=&lt;span style="color: #006080"&gt;"Yes"&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;ol style="margin-top: 0in" type="1" start="5"&gt;&lt;br&gt;
&lt;li class="MsoNormal" style="mso-list: l0 level1 lfo1"&gt;The rest was easy. Just call SaveAs function and you are done. &lt;/li&gt;&lt;/ol&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;dw_1.SaveAs(filename, PDF!, &lt;span style="color: #0000ff"&gt;FALSE&lt;/span&gt;) &lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1850047779793623762-8710481769506164783?l=dotnetideasblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</description><link>http://dotnetideasblog.blogspot.com/2006/12/how-to-use-powerbuilder-to-create-pdf.html</link><author>noreply@blogger.com (DotNetIdeas)</author><thr:total>2</thr:total></item></channel></rss>