Question

Keep getting prompted for Parameter Entry.

Asked by: BlakeMcKenna

I have a Crystal Report 11 with 3 SubReports in a VB.Net program. Each subreport takes the exact same parameters. The main reports' parameters match the subreports parameters in every way. Each time I try to preview the report from the app...I get the following prompt. How can I eliminate it. I have provided my VB code as well as a screenshot.

Public Function AccessGASR(ByVal strUserID As String, _
                               ByVal intGroupID As Integer, _
                               ByVal strInputType As String, _
                               ByVal strReportPath As String)
        Try
            rptErr.clsModule = "GroupActivitySummaryReportDLL"
 
            Dim crDoc As New rptGroupActivitySummary
 
            With crConnectionInfo
                .ServerName = "HERCULES"
                .DatabaseName = "Drip"
                .IntegratedSecurity = True
            End With
 
            crDoc.SetParameterValue("@userID", strUserID)
            crDoc.SetParameterValue("@groupID", intGroupID)
 
            If strInputType = "O" Then
                PrintGASR(crDoc)
            ElseIf strInputType = "B" Then
                CreatePDFReport(crDoc)
            End If
 
        Catch ex As Exception
            rptErr.clsProcedure = "AccessGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
 
    Public Sub PrintGASR(ByVal rptDoc As rptGroupActivitySummary, _
                         ByRef strUserID As String, _
                         ByRef intGroupID As Integer)
        Try
            Dim frmReport As New frmReport
 
            frmReport.WindowState = Windows.Forms.FormWindowState.Maximized
 
            frmReport.crViewer.ReportSource = rptDoc
            frmReport.crViewer.DisplayGroupTree = False
            frmReport.ShowDialog()
 
        Catch ex As Exception
            rptErr.clsProcedure = "PrintGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-07-16 at 12:35:50ID23570964
Topics

Microsoft Visual Basic.Net

,

Crystal Reports Software

Participating Experts
2
Points
500
Comments
40

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Passing Parameters to a unlinked subreport
    I have a report set up in Crystal(7) that contains a unlinked subreport in the report footer. The subreport contains the same 5 parameter fields as the main report. The reports run fine when I run them from Crystal. However when I run them through vb the subreport data doe...
  2. Crystal keeps prompting for parameter values
    I am working with Crystal Reports 9.2 and trying to show a print preview from viewer, but the report keeps poping up the "Enter Parameter Value" screen. The report have two date parameters and previewing it from "Crystal Reports" works, but from viewer it ...
  3. disable prompting for parameters
    How do you prevent prompting for parameters? In crystal report XI developer Seb
  4. Crystal Reports Subreport Parameter
    I have a main report which takes in a date parameter as a string. On the subreport i have created a link to the main reports parameter. But once the report is being loaded i still get the parameter prompt for the subreport and the main report parameter is not prompted and wor...
  5. How To Set Crystal Report Subreport Parameter From Appli…
    I have a parameter in a subreport that is being used by the DB Command (sql command) that is pulling in the subreports data. Does anyone know 100% how to set this parameter from application code (C#,VB.NET, etc.) ? I always get prompted by the viewer to specify the parameter.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: TheLearnedOnePosted on 2008-07-16 at 13:48:53ID: 22019995

You need to set the ParameterValue for each Subreport:

For Each subReport As ReportDocument In crDoc.Subreports
   report.SetParameterValue("@userID", strUserID)
   report.SetParameterValue("@groupID", intGroupID)
Next subReport

                                              
1:
2:
3:
4:

Select allOpen in new window

 

by: BlakeMcKennaPosted on 2008-07-16 at 14:04:59ID: 22020140

That didn't work...

 

by: TheLearnedOnePosted on 2008-07-16 at 14:12:28ID: 22020218

Why not?   Are you still getting prompted?  Are you getting exceptions?

 

by: BlakeMcKennaPosted on 2008-07-16 at 14:14:52ID: 22020237

Still getting prompted. Here's my code.

    Public Function AccessGASR(ByVal strUserID As String, _
                               ByVal intGroupID As Integer, _
                               ByVal strInputType As String, _
                               ByVal strReportPath As String)
        Try
            rptErr.clsModule = "GroupActivitySummaryReportDLL"
 
            Dim crDoc As New rptGroupActivitySummary
 
            With crConnectionInfo
                .ServerName = "HERCULES"
                .DatabaseName = "Drip"
                .IntegratedSecurity = True
            End With
 
            If strInputType = "O" Then
                PrintGASR(crDoc, strUserID, intGroupID)
            ElseIf strInputType = "B" Then
                CreatePDFReport(crDoc)
            End If
 
        Catch ex As Exception
            rptErr.clsProcedure = "AccessGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
    '
    '
    '
    Public Sub PrintGASR(ByVal rptDoc As rptGroupActivitySummary, _
                         ByRef strUserID As String, _
                         ByRef intGroupID As Integer)
        Try
            Dim frmReport As New frmReport
 
            frmReport.WindowState = Windows.Forms.FormWindowState.Maximized
 
            For Each subReport As ReportDocument In rptDoc.Subreports
                rptDoc.SetParameterValue("@userID", strUserID)
                rptDoc.SetParameterValue("@groupID", intGroupID)
            Next subReport
 
            frmReport.crViewer.ReportSource = rptDoc
            frmReport.crViewer.DisplayGroupTree = False
            frmReport.ShowDialog()
 
        Catch ex As Exception
            rptErr.clsProcedure = "PrintGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-07-16 at 14:16:03ID: 22020254

Don't I feel foolish:

            For Each subReport As ReportDocument In rptDoc.Subreports
                subReport.SetParameterValue("@userID", strUserID)
                subReport.SetParameterValue("@groupID", intGroupID)
            Next subReport

 

by: BlakeMcKennaPosted on 2008-07-16 at 14:26:16ID: 22020347

I tried that and it gave me the following error on the following line:

subReport.SetParameterValue("@userID", strUserID)

 

by: BlakeMcKennaPosted on 2008-07-16 at 14:29:10ID: 22020374

Actually, the Error Message, instead of "Object reference not set to an instance of an object", was
"Not supported within subreports".

 

by: BlakeMcKennaPosted on 2008-07-16 at 14:35:55ID: 22020433

LearnedOne,

I owe you an apology. You are not totally wrong with your initial solution. When I perform a build on my VB.Net app and deploy it on my Development machine...it works like it's supposed to (No prompting). However, when I deploy the application to a Terminal Server...that's when the problems occur.

 

by: BlakeMcKennaPosted on 2008-07-16 at 15:01:18ID: 22020621

Ok,

I just had this idea.

Is it possible to remove the parameters from the main report and pass the values into the main report via a SelectionFormula coded in the VB app and then move these values into the subreport parameters?

If this is possible, can someone show me how to do it in the CR IDE?

Thanks,

 

by: TheLearnedOnePosted on 2008-07-17 at 04:13:35ID: 22024105

What are the parameters doing?  How are they used in the report and sub-reports?  If they are used in formulas, that is one thing, but if they are used to filter data, there are others ways to skin that cat.

 

by: BlakeMcKennaPosted on 2008-07-17 at 07:05:31ID: 22025574

Each of the subreports are driven by a Stored Procedure which takes 2 parameters. The actual main report is driven by a single SQL Server Table, however, it has the 2 parameter fields as well. The parameter fields themselves are not on any of the subreports.

 

by: TheLearnedOnePosted on 2008-07-17 at 07:09:44ID: 22025620

I would think that it would be better to bind the report to a DataSet that is filled from the Stored Procedure--which is what I do.  You can bind the report to an .xsd document that provides you fields, and then you can use Push techniques to set the datasource to the DataSet.  I don't like having to use report parameters.

 

by: BlakeMcKennaPosted on 2008-07-17 at 07:19:31ID: 22025718

Sounds good....except I have no idea how to do this and I'm under the gun for this particular project which means I don't have alot of time to learn how to do this. If you have some samples of how to do it...perhaps I could give that a shot and see what happens.

 

by: TheLearnedOnePosted on 2008-07-17 at 07:42:14ID: 22025932

If you are under the gun, and you can't afford to change this late in the game, then we can get the parameters to work.  

It has been a long time since I have worked with Terminal Server.  

Are you embedding the Crystal Report in your application, or using it as an external file?

 

by: BlakeMcKennaPosted on 2008-07-17 at 07:47:12ID: 22025995

It's embedded in my application.

 

by: TheLearnedOnePosted on 2008-07-17 at 07:49:57ID: 22026034

I am confused why you are getting that error on your Terminal Server.  What line is it having a problem with?

 

by: BlakeMcKennaPosted on 2008-07-17 at 07:50:32ID: 22026042

Well, it's probably an external file. In my VB.Net project, I have several Crystal Reports that have naming conventions like rptGroupSummary.rpt. The following code is a DLL only because it is called by an online program as well as a batch program. I actually create each report from within the Crystal Reports IDE.

    Public Function AccessGASR(ByVal strUserID As String, _
                               ByVal intGroupID As Integer, _
                               ByVal strInputType As String, _
                               ByVal strReportPath As String)
        Try
            rptErr.clsModule = "GroupActivitySummaryReportDLL"
            Cursor.Current = Cursors.WaitCursor
 
            Dim crDoc As New rptGroupActivitySummary
 
            With crConnectionInfo
                .ServerName = "HERCULES"
                .DatabaseName = "Drip"
                .IntegratedSecurity = True
            End With
 
            If strInputType = "O" Then
                PrintGASR(crDoc, strUserID, intGroupID)
            ElseIf strInputType = "B" Then
                CreatePDFReport(crDoc)
            End If
 
            Cursor.Current = Cursors.Arrow
 
        Catch ex As Exception
            rptErr.clsProcedure = "AccessGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
    '
    '
    '
    Private Sub CreatePDFReport(ByRef rptObj As ReportDocument)
        Try
            Dim crDOC As New ReportDocument
            Dim strGASRReport As String = ""
            Dim strReportDate As String = ""
            Dim diskOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
            Dim exportOpts As ExportOptions = New ExportOptions()
            Dim yr As String = ""
 
            crDOC = rptObj
 
            yr = Mid(Year(Now.Date), 3, 2)
 
            strReportDate = ""
            strReportDate = Month(Now.Date).ToString.PadLeft(2, "0") & _
                            Microsoft.VisualBasic.DateAndTime.Day(Now.Date).ToString.PadLeft(2, "0") & _
                            yr & _
                            Hour(Now) & _
                            Minute(Now) & _
                            Second(Now)
 
            exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
            exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
 
            strGASRReport = ""
            strGASRReport &= "GASR_" & strReportDate & ".PDF"
            strReportDestination = strReportDirectory & strGASRReport
 
            diskOpts.DiskFileName = strReportDestination
            exportOpts.ExportDestinationOptions = diskOpts
            crDOC.Export(exportOpts) 'Exporting report to a PDF format
 
            crDOC = Nothing
 
        Catch ex As Exception
            rptErr.clsProcedure = "CreatePDFReport()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub
    '
    '
    '
    Public Sub PrintGASR(ByVal rptDoc As rptGroupActivitySummary, _
                         ByRef strUserID As String, _
                         ByRef intGroupID As Integer)
        Try
            Dim frmReport As New frmReport
 
            frmReport.WindowState = Windows.Forms.FormWindowState.Maximized
 
            For Each subReport As ReportDocument In rptDoc.Subreports
                rptDoc.SetParameterValue("@userID", strUserID)
                rptdoc.SetParameterValue("@groupID", intGroupID)
            Next subReport
 
            frmReport.crViewer.ReportSource = rptDoc
            frmReport.crViewer.DisplayGroupTree = False
            frmReport.ShowDialog()
 
        Catch ex As Exception
            rptErr.clsProcedure = "PrintGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-07-17 at 07:53:13ID: 22026074

>>Dim crDoc As New rptGroupActivitySummary
This would suggest that the report is embedded.  

Can you determine what line you are having a problem with?

 

by: BlakeMcKennaPosted on 2008-07-17 at 08:00:50ID: 22026164

I don't think you can run an application in debug mode on a Terminal Server. If you can I've never done it.
As far as having a problem with a line of code....the application isn't giving me any errors except after the prompting of the parameters. I enter the same 2 parameter values 3 different times...once for each subreport. After I've done that is when I get the error message (see screen shot). Anyway, the code I provided is how I create all my reports using Crystal Reports.

 

by: BlakeMcKennaPosted on 2008-07-17 at 08:01:49ID: 22026173

Here is the Error I get after parameter value entry.

 

by: TheLearnedOnePosted on 2008-07-17 at 08:12:50ID: 22026316

As a casual observer, I don't think that I can do much to help you.  You might want to log a StackTrace to the Event Log, or a log file.

 

by: BlakeMcKennaPosted on 2008-07-17 at 08:20:14ID: 22026425

How do I do that?

 

by: TheLearnedOnePosted on 2008-07-17 at 08:22:18ID: 22026454

That can be a large undertaking, so how are you displaying the exception message in the first place?

 

by: BlakeMcKennaPosted on 2008-07-17 at 09:03:20ID: 22026954

My application is not generating the message...Crystal Reports is.

 

by: BlakeMcKennaPosted on 2008-07-17 at 09:17:35ID: 22027070

Ok,

Here's what I'm trying now. In my DLL code, I'm going to create a Dataset for each of the Stored Procedures. My problem is how do I reference this dynamic Dataset in my subreports? Here is my revised code. Also, I'm getting this message on one of my variable declarations and I don't know what it means. See Screenshot.

 

by: BlakeMcKennaPosted on 2008-07-17 at 09:20:09ID: 22027098

Sorry...forgot my code.

Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
 
Public Class clsGASR
    Private daIRStatus As SqlDataAdapter
    Private daOver3Days As SqlDataAdapter
    Private daTotalByAssignees As SqlDataAdapter
 
    Private dsIRStatus As New DataSet
    Private dsOver3Days As New DataSet
    Private dsTotalByAssignees As New DataSet
 
    Private resp As Exception
    Private crConnectionInfo As New ConnectionInfo
    Private rptErr As New ErrorHandler.clsErrorHandler
 
    Private strReportDestination As String = ""
 
    Public Function AccessGASR(ByVal cn As SqlConnection, _
                               ByVal strUserID As String, _
                               ByVal intGroupID As Integer, _
                               ByVal strInputType As String, _
                               ByVal strReportPath As String) As Exception
        Try
            rptErr.clsModule = "GroupActivitySummaryReportDLL"
            Cursor.Current = Cursors.WaitCursor
 
            LoadIRStatusSubReportCommands(cn, strUserID, intGroupID)
            LoadOver3DaysSubReportCommands(cn, strUserID, intGroupID)
            LoadTotalByAssigneesSubReportCommands(cn, strUserID, intGroupID)
 
            Dim crDoc As New rptGroupActivitySummary
 
            With crConnectionInfo
                .ServerName = "HERCULES"
                .DatabaseName = "Drip"
                .IntegratedSecurity = True
            End With
 
            If strInputType = "O" Then
                PrintGASR(crDoc, strUserID, intGroupID)
            ElseIf strInputType = "B" Then
                CreatePDFReport(crDoc)
            End If
 
            Cursor.Current = Cursors.Arrow
 
        Catch ex As Exception
            rptErr.clsProcedure = "AccessGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
    '
    '
    '
    Private Sub CreatePDFReport(ByRef rptObj As ReportDocument)
        Try
            Dim crDOC As New ReportDocument
            Dim strGASRReport As String = ""
            Dim strReportDate As String = ""
            Dim diskOpts As DiskFileDestinationOptions = ExportOptions.CreateDiskFileDestinationOptions()
            Dim exportOpts As ExportOptions = New ExportOptions()
            Dim yr As String = ""
 
            crDOC = rptObj
 
            yr = Mid(Year(Now.Date), 3, 2)
 
            strReportDate = ""
            strReportDate = Month(Now.Date).ToString.PadLeft(2, "0") & _
                            Microsoft.VisualBasic.DateAndTime.Day(Now.Date).ToString.PadLeft(2, "0") & _
                            yr & _
                            Hour(Now) & _
                            Minute(Now) & _
                            Second(Now)
 
            exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat
            exportOpts.ExportDestinationType = ExportDestinationType.DiskFile
 
            strGASRReport = ""
            strGASRReport &= "GASR_" & strReportDate & ".PDF"
            strReportDestination = strReportDirectory & strGASRReport
 
            diskOpts.DiskFileName = strReportDestination
            exportOpts.ExportDestinationOptions = diskOpts
            crDOC.Export(exportOpts) 'Exporting report to a PDF format
 
            crDOC = Nothing
 
        Catch ex As Exception
            rptErr.clsProcedure = "CreatePDFReport()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub
    '
    '
    '
    Public Sub PrintGASR(ByVal rptDoc As rptGroupActivitySummary, _
                         ByRef strUserID As String, _
                         ByRef intGroupID As Integer)
        Try
            Dim frmReport As New frmReport
 
            frmReport.WindowState = Windows.Forms.FormWindowState.Maximized
 
            For Each subReport As ReportDocument In rptDoc.Subreports
                If subReport.Name = "IRStatus" Then
                    subReport.SetDataSource(dsIRStatus)
                ElseIf subReport.Name = "Over3Days" Then
                    subReport.SetDataSource(dsOver3Days)
                ElseIf subReport.Name = "TotalByAssignees" Then
                    subReport.SetDataSource(dsTotalByAssignees)
                End If
            Next subReport
 
            frmReport.crViewer.ReportSource = rptDoc
            frmReport.crViewer.DisplayGroupTree = False
            frmReport.ShowDialog()
 
        Catch ex As Exception
            rptErr.clsProcedure = "PrintGASR()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Sub
    '
    '
    '
    Private Function LoadIRStatusSubReportCommands(ByRef cn As SqlConnection, _
                                                   ByRef strUserID As String, _
                                                   ByRef intGroupID As Integer) As Exception
        Try
            'SELECT SQL Command
            Dim cmdSelect As New SqlCommand("prcSelectGASR", cn)
            cmdSelect.CommandType = CommandType.StoredProcedure
 
            cmdSelect.Parameters.Add(New SqlParameter("@userID", SqlDbType.VarChar, 25, "userID"))
            cmdSelect.Parameters.Add(New SqlParameter("@groupID", SqlDbType.Int, 0, "groupID"))
 
            cmdSelect.Parameters("@userID").Value = strUserID
            cmdSelect.Parameters("@groupID").Value = intGroupID
 
            daIRStatus = New SqlDataAdapter(cmdSelect)
            daIRStatus.SelectCommand = cmdSelect
            dsIRStatus.Clear()
            daIRStatus.Fill(dsIRStatus)
 
            Return Nothing
 
        Catch ex As Exception
            rptErr.clsProcedure = "LoadIRStatusSubReportCommands()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
    '
    '
    '
    Private Function LoadOver3DaysSubReportCommands(ByRef cn As SqlConnection, _
                                                    ByRef strUserID As String, _
                                                    ByRef intGroupID As Integer) As Exception
        Try
            'SELECT SQL Command
            Dim cmdSelect As New SqlCommand("prcSelectGASR_NoActivity", cn)
            cmdSelect.CommandType = CommandType.StoredProcedure
 
            cmdSelect.Parameters.Add(New SqlParameter("@userID", SqlDbType.VarChar, 25, "userID"))
            cmdSelect.Parameters.Add(New SqlParameter("@groupID", SqlDbType.Int, 0, "groupID"))
 
            cmdSelect.Parameters("@userID").Value = strUserID
            cmdSelect.Parameters("@groupID").Value = intGroupID
 
            daOver3Days = New SqlDataAdapter(cmdSelect)
            daOver3Days.SelectCommand = cmdSelect
            dsOver3Days.Clear()
            daOver3Days.Fill(dsOver3Days)
 
            Return Nothing
 
        Catch ex As Exception
            rptErr.clsProcedure = "LoadOver3DaysSubReportCommands()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
    '
    '
    '
    Private Function LoadTotalByAssigneesSubReportCommands(ByRef cn As SqlConnection, _
                                                           ByRef strUserID As String, _
                                                           ByRef intGroupID As Integer) As Exception
        Try
            'SELECT SQL Command
            Dim cmdSelect As New SqlCommand("prcSelectGASR_TotalByAssignees", cn)
            cmdSelect.CommandType = CommandType.StoredProcedure
 
            cmdSelect.Parameters.Add(New SqlParameter("@userID", SqlDbType.VarChar, 25, "userID"))
            cmdSelect.Parameters.Add(New SqlParameter("@groupID", SqlDbType.Int, 0, "groupID"))
 
            cmdSelect.Parameters("@userID").Value = strUserID
            cmdSelect.Parameters("@groupID").Value = intGroupID
 
            daTotalByAssignees = New SqlDataAdapter(cmdSelect)
            daTotalByAssignees.SelectCommand = cmdSelect
            dsTotalByAssignees.Clear()
            daTotalByAssignees.Fill(dsTotalByAssignees)
 
            Return Nothing
 
        Catch ex As Exception
            rptErr.clsProcedure = "LoadTotalByAssigneesSubReportCommands()"
            rptErr.clsMsg = ex.Message
            rptErr.WriteToTextFile(ErrorDirectory, "DRIP-ErrorLog.txt")
        End Try
    End Function
End Class

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-07-17 at 09:24:35ID: 22027138

Open the Object Browser, and search for SqlDataAdapter, and see if you find more than one entry.

 

by: BlakeMcKennaPosted on 2008-07-17 at 09:41:18ID: 22027282

Yes, I saw 2 of them. Here is what they look like. I don't know which one to remove.

 

by: TheLearnedOnePosted on 2008-07-17 at 10:18:29ID: 22027687

Look at all the references to System.Data in all the projects.

 

by: BlakeMcKennaPosted on 2008-07-17 at 10:23:43ID: 22027741

This sounds dumb but what am I looking for and then what should I do?

 

by: TheLearnedOnePosted on 2008-07-17 at 10:25:20ID: 22027768

Find them first, and then I can tell you what to do.

 

by: BlakeMcKennaPosted on 2008-07-17 at 10:32:40ID: 22027841

Here's a screen shot. I found 2 references. There's one just above the highlighted line.

 

by: TheLearnedOnePosted on 2008-07-17 at 10:38:38ID: 22027901

Project References:

 

by: BlakeMcKennaPosted on 2008-07-17 at 10:51:13ID: 22028046

Ok, that fixed it. I just removed the System.Data.SqlClient reference and that fixed the errors.

 

by: BlakeMcKennaPosted on 2008-07-17 at 13:56:32ID: 22030225

Do I enter something here?

 

by: TheLearnedOnePosted on 2008-07-17 at 13:58:15ID: 22030242

Did you fix the problem?

 

by: BlakeMcKennaPosted on 2008-07-17 at 14:13:48ID: 22030407

Yes, I was trying to close out the question and give you 500 points....was I successful in doing so?

 

by: TheLearnedOnePosted on 2008-07-17 at 15:07:18ID: 22030890

No, I don't believe so.  You could just accept a comment as a solution, or try again.  I just wanted to know what your resolution was?

 

by: BlakeMcKennaPosted on 2008-07-17 at 15:28:21ID: 22031009

I went with creating a dynamic dataset as a result from the SP's. I then created a DataSource XSD and passed the datasets into the subreports and that seemed to work just fine. Bottom line...........I got my results.

 

by: landerson999Posted on 2009-08-18 at 13:18:55ID: 25127205

The learned one....I was wondering if you can to your knowledge use SetParameterValue on a subreport
as such...Report.Subreports.Item(1).SetParameterValue("nameoffiled","value")...so far I am getting the same Not supported within subreports error message, but I have no such reference set to the System.Data.SqlClient as per your post to Blake...

Is this not feasible? If not, I heard something about setting a field in the master, that would relate to the same field in the sub???

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...