|
-
Sep 28th, 2012, 05:20 PM
#1
Thread Starter
Member
cr 2008 and vs 2008
Have a program using cr2008 & vs2008. Everything works except that the report is not viewable within vs2008. And I don't have a clue. This is the code that calls the report:
Code:
Private Sub mnuReportsWater_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuReportsWater.Click
With frmWater
.StartPosition = FormStartPosition.CenterScreen
.Width = 875
.Height = 1000
.Top = 25
.Text = "Water Usage"
'.Hide()
.Show()
End With
End Sub
the only thing in frmWater is a line to suppress the CR logo:
Code:
Public Class frmWater
Private Sub CrystalReportViewer1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CrystalReportViewer1.Load
CrystalReportViewer1.ShowLogo = False
End Sub
End Class
When crWater is clicked/double clicked a message 'There are no items to show for the selected document.' Frustraing as all heck since the report was developed in cr 2008 (v12)or cr2008 basic (v10) in vs 2008.
That was before a couple of re-installs of the OS over a period of several months. Now, nothing.
Any ideas would be great. Thanks.
-
Sep 28th, 2012, 08:47 PM
#2
Re: cr 2008 and vs 2008
When crWater is clicked/double clicked a message 'There are no items to show for the selected document.'
what is "crWater"? Is it a button on a form, a menu selection or something else.
Have you checked CrystalReportViewer1 to see if it has a report assigned to it. what appears when frmWater is shown?
-
Sep 29th, 2012, 07:11 AM
#3
Thread Starter
Member
Re: cr 2008 and vs 2008
Should have been crWater.rpt.

Clicking the edit the current crystal report, a blank page shows. However, when the program is run, voila!, the report is there. Can't seem to make it appear in vs2008.
Thanks for the help.
-
Sep 29th, 2012, 11:47 AM
#4
Re: cr 2008 and vs 2008
Ok, I understand what your saying. I don't know what would cause that, I never use that function. I always assign the crystalreportviewer reportsource at runtime because I use the same viewer for all my reports. I always edit my reports by selecting the report from the "Project Explorer". Is "crWater" in the project explorer? If not, then add it to your project. Then all you have to do to edit the report is double click the report in the project explorer.
btw - Just curious, is this an irrigation water tracking application? I wrote a large app for that purpose, haven't seen to many around.
Last edited by wes4dbt; Sep 29th, 2012 at 11:50 AM.
-
Oct 10th, 2012, 07:47 AM
#5
Thread Starter
Member
Re: cr 2008 and vs 2008
I have a form and cr report for each and they are in the solution explorer.

You mention that you have only one viewer for all reports, which may be a better way. Would you share how that is done?
Thanks for your help.
-
Oct 10th, 2012, 10:57 AM
#6
Re: cr 2008 and vs 2008
Here's an example,
Code:
Dim con As New OleDb.OleDbConnection(My.Settings.WaterConnectionString)
Dim ds As New WaterTablesDataSet
Dim da As New OleDb.OleDbDataAdapter("select userid,name from users", con)
da.Fill(ds.users)
Dim rpt As New CrystalReport2
rpt.SetDataSource(ds)
Dim frm As New frmReports
frm.CrystalReportViewer1.ReportSource = rpt
frm.Show()
btw - The reports "Build Action" property is set to Embedded Resource.
Last edited by wes4dbt; Oct 10th, 2012 at 11:01 AM.
-
Oct 12th, 2012, 10:12 AM
#7
Thread Starter
Member
Re: cr 2008 and vs 2008
Thanks. Will that enable me to edit the crystal report in vs 2008?
And it appears that the code you offered would be placed in the form for each report ie -> If there is a crAttending.rpt, crLastname.rpt and crPayments.rpt then each report would have a corresponding form such as frmAttending, frmLastname and frmPayments?
Last edited by kimt; Oct 12th, 2012 at 10:34 AM.
-
Oct 12th, 2012, 11:50 AM
#8
Re: cr 2008 and vs 2008
Why would each report need a form? Why not just select the report from a menu or list box or combobox....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|