<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://vstoolsforum.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Crystal Reports</title><link>http://vstoolsforum.com/blogs/crystal_reports/default.aspx</link><description>Notes, Tips and Tricks on Developing using Crystal Reports</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>VS 2008 Changing a datasource at runtime</title><link>http://vstoolsforum.com/blogs/crystal_reports/archive/2009/04/07/vs-2008-changing-a-datasource-at-runtime.aspx</link><pubDate>Tue, 07 Apr 2009 16:46:00 GMT</pubDate><guid isPermaLink="false">05d3ee43-09e1-4c21-9d53-64ecaf1acc4f:1730</guid><dc:creator>Steve Gray</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://vstoolsforum.com/blogs/crystal_reports/rsscomments.aspx?PostID=1730</wfw:commentRss><comments>http://vstoolsforum.com/blogs/crystal_reports/archive/2009/04/07/vs-2008-changing-a-datasource-at-runtime.aspx#comments</comments><description>&lt;p&gt;This is a walk through for changing the datasource of a VS 2008 Crystal Report at runtime. &lt;/p&gt;
&lt;p&gt;Create a new form in VB, add the Crystal Report Viewer control, dock it. For the sake of simplicity, I&amp;#39;ve kept the code as concise as possible. The form has two public properties, the report name and the data source. We pass those in before opening the form. &lt;/p&gt;
&lt;p&gt;&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Imports&lt;/span&gt; Microsoft.VisualBasic
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Imports&lt;/span&gt; System
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Imports&lt;/span&gt; System.Drawing
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Imports&lt;/span&gt; System.Windows.Forms


&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Public&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Class&lt;/span&gt; ReportCrystal
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Dim&lt;/span&gt; crDoc &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;New&lt;/span&gt; CrystalDecisions.CrystalReports.Engine.ReportDocument


    &lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'public variables&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Public&lt;/span&gt; ReportName &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;String&lt;/span&gt;
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Public&lt;/span&gt; ReportDataTable &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; DataTable



    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Private&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Sub&lt;/span&gt; ReportCrystal_Load(&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Object&lt;/span&gt;, &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Handles&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.Load
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Dim&lt;/span&gt; strStartupPath &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;String&lt;/span&gt; &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; Application.StartupPath
        strStartupPath += &lt;span style="color: #666666;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"\reports\"&lt;/span&gt; &amp;amp; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.ReportName
        crDoc.Load(strStartupPath)
        crDoc.SetDataSource(ReportDataTable)
        &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.CrystalReportViewer1.ReportSource &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; crDoc
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;End&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Sub&lt;/span&gt;
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;End&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Class&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So, the report is called like this. Naturally there will be parameters, but that is not covered here. &lt;/p&gt;
&lt;p&gt;&lt;pre style="overflow: scroll; background-color: #f2f2f2;"&gt;&lt;span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Private&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Sub&lt;/span&gt; btnPrintTickets_Click(&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; System.&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Object&lt;/span&gt;, &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;ByVal&lt;/span&gt; e &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Handles&lt;/span&gt; btnPrintTickets.Click
    &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Dim&lt;/span&gt; frm &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;As&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;New&lt;/span&gt; ReportCrystal


    frm.ReportName &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; &lt;span style="color: #666666;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;"PickingTickets.rpt"&lt;/span&gt;
    &lt;span style="color: Green;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;'code to populate a datatable. This code uses my custom data access classes, but any data access code will do. &lt;/span&gt;
    frm.ReportDataTable &lt;span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;=&lt;/span&gt; SPs.sp_SOP10200_SEL_bySopnumbe(&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.Orders, &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.txtPalletID.Text, &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Me&lt;/span&gt;.chkOptimize.Checked, AppUser.Database).getTable


    frm.ShowDialog()
&lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;End&lt;/span&gt; &lt;span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=1730" width="1" height="1"&gt;</description></item><item><title>'CrystalReportViewer' is ambiguous in the namespace 'CrystalDecisions.Web'</title><link>http://vstoolsforum.com/blogs/crystal_reports/archive/2008/06/23/crystalreportviewer-is-ambiguous-in-the-namespace-crystaldecisions-web.aspx</link><pubDate>Mon, 23 Jun 2008 16:14:00 GMT</pubDate><guid isPermaLink="false">05d3ee43-09e1-4c21-9d53-64ecaf1acc4f:1093</guid><dc:creator>Steve Gray</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://vstoolsforum.com/blogs/crystal_reports/rsscomments.aspx?PostID=1093</wfw:commentRss><comments>http://vstoolsforum.com/blogs/crystal_reports/archive/2008/06/23/crystalreportviewer-is-ambiguous-in-the-namespace-crystaldecisions-web.aspx#comments</comments><description>&lt;p&gt;Also:&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;13&amp;nbsp;&amp;#39;ReportDocument&amp;#39; is ambiguous in the namespace &amp;#39;CrystalDecisions.CrystalReports.Engine&amp;#39;.&amp;nbsp;C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb&amp;nbsp;11&amp;nbsp;18&amp;nbsp;C:\...\Culinart\&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;15&amp;nbsp;&amp;#39;DiskFileDestinationOptions&amp;#39; is ambiguous in the namespace &amp;#39;CrystalDecisions.Shared&amp;#39;.&amp;nbsp;C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb&amp;nbsp;47&amp;nbsp;26&amp;nbsp;C:\...\Culinart\&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;16&amp;nbsp;&amp;#39;ExportDestinationType&amp;#39; is ambiguous in the namespace &amp;#39;CrystalDecisions.Shared&amp;#39;.&amp;nbsp;C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb&amp;nbsp;50&amp;nbsp;57&amp;nbsp;C:\...\Culinart\&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;17&amp;nbsp;&amp;#39;ExportFormatType&amp;#39; is ambiguous in the namespace &amp;#39;CrystalDecisions.Shared&amp;#39;.&amp;nbsp;C:\projects\Culinart\Culinart\Reports\POSCash.aspx.vb&amp;nbsp;51&amp;nbsp;52&amp;nbsp;C:\...\Culinart\&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I solved this by going to Project Propertities &amp;gt; References, somehow I had references to two different versions of crystal in my project. While doing this I noticed that the references kept coming back. I searched the project and found that I had double lines iin the web config to different versions of Crystal. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=1093" width="1" height="1"&gt;</description></item><item><title>Crystal in VB Deployment Projects (Visual Studio 2008)</title><link>http://vstoolsforum.com/blogs/crystal_reports/archive/2007/12/12/crystal-in-vb-deployment-projects-visual-studio-2008.aspx</link><pubDate>Wed, 12 Dec 2007 20:23:00 GMT</pubDate><guid isPermaLink="false">05d3ee43-09e1-4c21-9d53-64ecaf1acc4f:766</guid><dc:creator>Steve Gray</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://vstoolsforum.com/blogs/crystal_reports/rsscomments.aspx?PostID=766</wfw:commentRss><comments>http://vstoolsforum.com/blogs/crystal_reports/archive/2007/12/12/crystal-in-vb-deployment-projects-visual-studio-2008.aspx#comments</comments><description>&lt;p&gt;In Visual Studio 2008, merge modules are no longer used for crystal reports controls.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;To add the crystal reports files:&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp; Go to the deployment project&amp;#39;s properties page.&lt;br /&gt;2.&amp;nbsp; Click the &amp;quot;Prerequisites&amp;quot; button.&lt;br /&gt;3.&amp;nbsp; Add the &amp;quot;Crystal Reports Basic for Visual Studio 2008&amp;quot;&lt;/p&gt;
&lt;p&gt;It may also require the &amp;quot;Windows Installer 3.1&amp;quot;&lt;/p&gt;&lt;img src="http://vstoolsforum.com/aggbug.aspx?PostID=766" width="1" height="1"&gt;</description></item></channel></rss>