<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Crystal Report' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Crystal Report' posted on the 'VB.NET' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 07:25:55 -0800</pubDate>
    <lastBuildDate>Thu, 09 Feb 2012 07:25:55 -0800</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410694/crystal-report/</link>
      <description>Hello friends, I have a invoice form that contains some billing info (i.e. textbox, dropdown field etc...) and i have a calculate button in it that calculate the sum total of the relevant fields. so i want to print the data in crystal report. i have vs 2008 that already inbuilt CR. it'll prints only the data that put in billing field not all the database field. so plz help me.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410694/crystal-report/</guid>
      <pubDate>Sun, 13 Dec 2009 04:40:35 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410709/re-crystal-report/#410709</link>
      <description>Please paste your source code in a "code" block.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410709/re-crystal-report/#410709</guid>
      <pubDate>Sun, 13 Dec 2009 14:57:49 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410716/re-crystal-report/#410716</link>
      <description>my code is as here under:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
 Try
            Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrin
gs("Billing").ConnectionString)

            Dim mmd As SqlCommand = conn.CreateCommand

            mmd.CommandType = CommandType.Text

            mmd.CommandText = "Select * From Bill"

            Using conn

                conn.Open()
                Dim da As New SqlDataAdapter(mmd)
                Dim ds As New SqlCommandBuilder(da)

                Dim mytable As New DataTable("Billing")

                da.Fill(mytable)

                mytable.Rows.Add(txtSerial.Text.Trim, cmdName.Text.Trim, dtCrDate.Text.Trim, cmbSrRate.Text.Trim, txtShrQty.Text.Trim, txtShrAmount.Text.Trim, cmbSrrRate.Text.Trim, txtShrrQty.Text.Trim, txtShrrAmount.Text.Trim, _
                cmbptRate.Text.Trim, txtPtQty.Text.Trim, txtPtAmount.Text.Trim, cmbptRRate.Text.Trim, txtPtRQty.Text.Trim, txtPtRAmount.Text.Trim, txtCoatRate.Text.Trim, txtCoatQty.Text.Trim, txtCoatAmount.Text.Trim, txtSafariRate.Text.Trim, txtSafariQty.Text.Trim, txtSafariAmount.Text.Trim, _
                txtKurtaRate.Text.Trim, txtKurtaQty.Text.Trim, txtKurtaAmount.Text.Trim, txtPjmRate.Text.Trim, txtPjmQty.Text.Trim, txtPjmAmount.Text.Trim, _
                DtDLvDate.Text.Trim, txtgrdTotal.Text.Trim)

                da.Update(mytable)
                mmd.ExecuteNonQuery()
                conn.Close()

            End Using

            MessageBox.Show("Do You want to Print the Bill", caption:="Print Bill")
        Catch ex As Exception
            MessageBox.Show("An Error has Occured: " + ex.Message.ToString + vbCritical, vbCrLf)
        End Try
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The matter is that i creating a small billing project that contains Invoice fields. Firstly i save all the data in my database, then after i added the messagebox method in it to display "Do you want to print the data". so now the trick is that the crystal report print only last Invoice record which i saved in the database i.e. LIFO method.&lt;br /&gt;
&lt;br /&gt;
thank u&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410716/re-crystal-report/#410716</guid>
      <pubDate>Sun, 13 Dec 2009 22:14:18 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410742/re-crystal-report/#410742</link>
      <description>Maybe I am not understanding what you are asking? From reading your first post, It sounds like you have a Crystal Report built, but it is not returning all of the information you want it to... You are asking for some help to get that report working correctly?&lt;br /&gt;
&lt;br /&gt;
If that is not what you were asking, please restate what you need clearly.&lt;br /&gt;
&lt;br /&gt;
The code that you provided is to insert a record into a database table. Do you already have code written to print a crystal report, if so you will need to post that, we can work off of that to get you a solution.&lt;br /&gt;
&lt;br /&gt;
If you are asking for help building a crystal report to display the last item added to the database, I do not know much about crystal report building, but I know Databases enough to help you with that.&lt;br /&gt;
&lt;br /&gt;
Add a field to the Database Table called "Creation_Time" or something similar "Added_Date" "Added_Time" and set it to be datatype "Date/Time". When you insert a record to the database, set the Creation Time = Now&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dim dtNow as Date = Now
MessageBox.Show(dtNow)
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
In your crystal report, when you query the data, your SQL should look like this:&lt;br /&gt;
&lt;br /&gt;
"SELECT TOP 1 * FROM MyDataTable ORDER BY Creation_Time DESC"&lt;br /&gt;
&lt;br /&gt;
This line returns the TOP 1 (1 result) record, with all fields (*), From the MyDataTable table, ordering the results by Creation_Time with the highest value (most recent date) at the top of the list, Ordered Descending.&lt;br /&gt;
&lt;br /&gt;
Hope this helps,&lt;br /&gt;
Sean C&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410742/re-crystal-report/#410742</guid>
      <pubDate>Mon, 14 Dec 2009 06:46:58 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410753/re-crystal-report/#410753</link>
      <description>Hi Thanx for ur reply, Now i added Crystal Report code.&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dim cryRpt As New ReportDocument
With cryRpt
                Dim str As String = "Report Directory/bill.RPT"
                .SetDataSource(mytable)
                .Load(str)
                CrystalReportViewer1.ReportSource = cryRpt
                CrystalReportViewer1.Refresh()
            End With
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
but the following error occurs: Invalid Report File Path&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410753/re-crystal-report/#410753</guid>
      <pubDate>Mon, 14 Dec 2009 13:15:09 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410772/re-crystal-report/#410772</link>
      <description>&lt;pre class="sourcecode"&gt;
Dim str As String = "Report Directory/bill.RPT"
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
Firstly, you used the wrong slash in your path (use "/" for web addresses and unix, use "\" for Windows Paths) &lt;br /&gt;
&lt;br /&gt;
Secondly, This needs to be the fully qualified path of the file you are trying to load... for instance, I want to open "SeanCampbell.RPT" and it is in a folder in "program files" my code would look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dim str as String = "C:\Program Files\Some Folder I Just Made\SeanCampbell.RPT"
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
If you want to load a file that you have added to the same folder the application is running in, u don't have to designate the full path:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dim Str as String = "Sean.RPT"
&lt;/pre&gt;&lt;br /&gt;
When I go to load this file, it will look in this path:&lt;br /&gt;
C:\Documents and Settings\SeanCampbell\My Documents\VS 2009\Projects\WindowsApplication1\WindowsApplicati
on1\Bin\Debug\Sean.RPT&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hope this helps,&lt;br /&gt;
If you still cannot get it to work after entering the correct full-path of the file, please copy the details from the error message and paste them into your next reply,&lt;br /&gt;
Sean Campbell&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410772/re-crystal-report/#410772</guid>
      <pubDate>Tue, 15 Dec 2009 06:25:32 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410790/re-crystal-report/#410790</link>
      <description>this is my complete code:&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click
        Try
            Dim cryRpt As New ReportDocument
            Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrin
gs("Billing").ConnectionString)

            Dim mmd As SqlCommand = conn.CreateCommand

            mmd.CommandType = CommandType.Text

            mmd.CommandText = "SELECT TOP 1 * FROM Bill ORDER BY [Current Date] DESC"

            conn.Open()
            Dim da As New SqlDataAdapter(mmd)
            Dim mytable As New DataTable("Billing")

            da.Fill(mytable)
            mmd.ExecuteNonQuery()

            cryRpt.SetDataSource(mytable)
            cryRpt.Load("C:\Documents and Settings\saquib1\My Documents\Visual Studio 2008\Projects\Memorial Software\Memorial Software\Memorial.rpt")
            CrystalReportViewer1.ReportSource = cryRpt
            CrystalReportViewer1.Update()
            CrystalReportViewer1.Refresh()
            conn.Close()
        Catch ex As Exception
            MessageBox.Show("An Error has occured: " + ex.Message.ToString + vbCrLf)
        Finally

        End Try

    End Sub
&lt;/pre&gt;&lt;br /&gt;
and i set the breakpoint in cryRpt.Load and it's display the error that Invalid file path but Nothing any wrong path included in it. and also when i commented the line "cryRpt.SetDataSource(mytable)" it display the report but with no database binding and nothing display on the report. Can i send u my DB with report and form files.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410790/re-crystal-report/#410790</guid>
      <pubDate>Tue, 15 Dec 2009 11:53:53 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410791/re-crystal-report/#410791</link>
      <description>I need you to paste the FULL details of the error message it gives you. &lt;br /&gt;
&lt;br /&gt;
Remove the Try Catch, let the program crash, click Details&amp;gt;&amp;gt;, copy the contents of the details and paste it into a reply.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410791/re-crystal-report/#410791</guid>
      <pubDate>Tue, 15 Dec 2009 12:09:37 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410809/re-crystal-report/#410809</link>
      <description />
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410809/re-crystal-report/#410809</guid>
      <pubDate>Wed, 16 Dec 2009 11:17:37 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410810/re-crystal-report/#410810</link>
      <description>&lt;img src="http://4.bp.blogspot.com/_i14Hz19WAp8/SykjWAB8s4I/AAAAAAAAAcY/DxZ7V15S8zo/s1600-h/error1.jpg" /&gt; if the image not display paste the image link to address bar:&lt;br /&gt;
&lt;a href="http://4.bp.blogspot.com/_i14Hz19WAp8/SykjWAB8s4I/AAAAAAAAAcY/DxZ7V15S8zo/s1600-h/error1.jpg"&gt;http://4.bp.blogspot.com/_i14Hz19WAp8/SykjWAB8s4I/AAAAAAAAAcY/DxZ7V15S8zo/s1600-h/error1.jpg&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
and the error details:&lt;br /&gt;
&lt;br /&gt;
CrystalDecisions.CrystalReports.Engine.LoadSaveRep
ortException was unhandled&lt;br /&gt;
  Message="Invalid report file path."&lt;br /&gt;
  Source="CrystalDecisions.Shared"&lt;br /&gt;
  StackTrace:&lt;br /&gt;
       at CrystalDecisions.CrystalReports.Engine.EngineExcep
tionUtils.DoThrowException(String message, EngineExceptionErrorID id)    at CrystalDecisions.CrystalReports.Engine.ExceptionTh
rower.ThrowEngineException(String messageID, EngineExceptionErrorID id)    at CrystalDecisions.CrystalReports.Engine.ReportDocum
ent.Load(String filename, OpenReportMethod openMethod, Int16 parentJob)    at CrystalDecisions.CrystalReports.Engine.ReportDocum
ent.EnsureLoadReport()    at CrystalDecisions.CrystalReports.Engine.ReportDocum
ent.SetDataSourceInternal(Object val, Type type)    at CrystalDecisions.CrystalReports.Engine.ReportDocum
ent.SetDataSource(DataTable dataTable)    at WindowsApplication1.CrystalRep.RadButton1_Click(Ob
ject sender, EventArgs e) in C:\Documents and Settings\saquib1\My Documents\Visual Studio 2008\Projects\Memorial Software\Memorial Software\CrystalRep.vb:line 33    at System.Windows.Forms.Control.OnClick(EventArgs e)    at Telerik.WinControls.RadControl.OnClick(EventArgs e)    at Telerik.WinControls.UI.RadButton.ButtonElement_Cli
ck(Object sender, EventArgs e)    at Telerik.WinControls.RadItem.OnClick(EventArgs e)    at Telerik.WinControls.UI.RadButtonItem.OnClick(Event
Args e)    at Telerik.WinControls.RadItem.DoClick(EventArgs e)    at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadEl
ement sender, RoutedEventArgs args)    at Telerik.WinControls.RadElement.RaiseRoutedEvent(Ra
dElement sender, RoutedEventArgs args)    at Telerik.WinControls.RadItem.RaiseBubbleEvent(RadEl
ement sender, RoutedEventArgs args)    at Telerik.WinControls.RadElement.RaiseRoutedEvent(Ra
dElement sender, RoutedEventArgs args)    at Telerik.WinControls.RadElement.DoMouseUp(MouseEven
tArgs e)    at Telerik.WinControls.ComponentInputBehavior.OnMouse
Up(MouseEventArgs e)    at Telerik.WinControls.RadControl.OnMouseUp(MouseEven
tArgs e)    at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons button, Int32 clicks)    at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)    at System.Windows.Forms.ScrollableControl.WndProc(Mes
sage&amp;amp; m)    at Telerik.WinControls.RadControl.WndProc(Message&amp;amp; m)    at System.Windows.Forms.Control.ControlNativeWindow.O
nMessage(Message&amp;amp; m)    at System.Windows.Forms.Control.ControlNativeWindow.W
ndProc(Message&amp;amp; m)    at System.Windows.Forms.NativeWindow.DebuggableCallba
ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)    at System.Windows.Forms.UnsafeNativeMethods.DispatchM
essageW(MSG&amp;amp; msg)    at System.Windows.Forms.Application.ComponentManager.
System.Windows.Forms.UnsafeNativeMethods.IMsoCompo
nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)    at System.Windows.Forms.Application.ThreadContext.Run
MessageLoopInner(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.ThreadContext.Run
MessageLoop(Int32 reason, ApplicationContext context)    at System.Windows.Forms.Application.Run(ApplicationCo
ntext context)    at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.OnRun()    at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.DoApplicationModel()    at Microsoft.VisualBasic.ApplicationServices.WindowsF
ormsApplicationBase.Run(String[] commandLine)    at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81    at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)    at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    at Microsoft.VisualStudio.HostingProcess.HostProc.Run
UsersAssembly()    at System.Threading.ThreadHelper.ThreadStart_Context(
Object state)    at System.Threading.ExecutionContext.Run(ExecutionCon
text executionContext, ContextCallback callback, Object state)    at System.Threading.ThreadHelper.ThreadStart()&lt;br /&gt;
  InnerException: &lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410810/re-crystal-report/#410810</guid>
      <pubDate>Wed, 16 Dec 2009 11:22:17 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410850/re-crystal-report/#410850</link>
      <description>Mind you, I really don't have any experience with this, but here is what I think is going on...&lt;br /&gt;
&lt;br /&gt;
You have to Load the Report before you set the data source... so swap your .Load and .SetDataSource lines of code to look like this:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
cryRpt.Load("C:\Documents and Settings\saquib1\My Documents\Visual Studio 2008\Projects\Memorial Software\Memorial Software\Memorial.rpt")
cryRpt.SetDataSource(mytable)
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I came to this conclusion after finding some sample code. I assume that the program trys to load the rpt when you set the DataSource (to fill it out with the data it was provided) then it throws a LoadException because the FileName is blank or nothing. &lt;br /&gt;
&lt;br /&gt;
Try this and let me know if it resolves it, if not we can look at other things. Here is that sample code i found, its a tutorial:&lt;br /&gt;
&lt;a href="http://www.thescarms.com/dotnet/CrystalRptViewer.aspx"&gt;http://www.thescarms.com/dotnet/CrystalRptViewer.aspx&lt;/a&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410850/re-crystal-report/#410850</guid>
      <pubDate>Thu, 17 Dec 2009 06:45:34 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/410856/re-crystal-report/#410856</link>
      <description>Thank u thank u sir, it works. why its not came in my mind. if i get any problem i will contact u.&lt;br /&gt;
&lt;br /&gt;
thanks you&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/410856/re-crystal-report/#410856</guid>
      <pubDate>Thu, 17 Dec 2009 09:46:58 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report file path error</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/416136/re-crystal-report-file-path-error/#416136</link>
      <description>I have a similiar problem.&lt;br /&gt;
I made crystal reports and they run in VS2008 localhost and then I deploy to my client for windows application.&lt;br /&gt;
The invalid report path error exists at report view.&lt;br /&gt;
I had already copied the crystal reports *.rpt to client's c:\MyReport folder-same as VS2008 environment and stil same error.&lt;br /&gt;
&lt;br /&gt;
Any solution?&lt;br /&gt;
&lt;br /&gt;
Tommy Leung.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/416136/re-crystal-report-file-path-error/#416136</guid>
      <pubDate>Tue, 04 May 2010 07:32:39 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report file path error</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/416137/re-crystal-report-file-path-error/#416137</link>
      <description>Tommy, in order for us to help, you must post your exact code that is crashing, and the details from the Exception that is thrown.</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/416137/re-crystal-report-file-path-error/#416137</guid>
      <pubDate>Tue, 04 May 2010 08:17:52 -0800</pubDate>
      <category>VB.NET</category>
    </item>
    <item>
      <title>Re: Crystal Report file path error</title>
      <link>http://www.programmersheaven.com/mb/VBNET/410694/416180/re-crystal-report-file-path-error/#416180</link>
      <description>Thanks.&lt;br /&gt;
I found out I need to further config project setup for crystal report under VS2008, I am following the link in :&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/bb126227(VS.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/bb126227(VS.90).aspx&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
Will report my result.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/VBNET/410694/416180/re-crystal-report-file-path-error/#416180</guid>
      <pubDate>Thu, 06 May 2010 02:48:06 -0800</pubDate>
      <category>VB.NET</category>
    </item>
  </channel>
</rss>
