Solved

crystal sub report asking for a parameter value? .net

Posted on 2004-09-20
12
334 Views
Last Modified: 2008-01-09
I'm using .net 2002 with crystal 10.

I have a main report linking to a subreport. in Crystal it all works good. individually (without them being linked) they work through .net, however when i include the sub report on the main report and set the datasource correctly for each report, for some reason it asks me to enter a parameter, is there something i'm missing?

Sub BindReport()

        Dim myConnection As New SqlClient.SqlConnection()

        myConnection.ConnectionString = "data source=sqlserver;initial catalog=MAIN;integrated security=SSPI;persist security info=False;workstation id=CHRISTOPHER;packet size=4096"

        Dim MyCommand As New SqlClient.SqlCommand()
        Dim MyCommand1 As New SqlClient.SqlCommand()

        MyCommand.Connection = myConnection
        MyCommand1.Connection = myConnection

        MyCommand.CommandText = "SELECT vw_rpt_DevCase_90.* FROM vw_rpt_DevCase_90 where developmentcasename <> 'Change of Zone' and developmentcasename <> 'Lot Line Adjustment' and developmentcasename <> 'Variance' and developmentcasename <> 'General Plan Amendment' and developmentcasename <> 'Specific Plan'"
        MyCommand1.CommandText = "select top 100 developmentcaseid,timeextdateentered,timeexttermindays,timeextnotes,timeextphonenotificationdate,timeextdatefiled from vw_developmentcasesforinetwithtimeexts2 command"
        MyCommand.CommandType = CommandType.Text
        MyCommand1.CommandType = CommandType.Text

        Dim MyDA As New SqlClient.SqlDataAdapter()
        Dim myda1 As New SqlClient.SqlDataAdapter()


        MyDA.SelectCommand = MyCommand
        myda1.SelectCommand = MyCommand1


        Dim myDS As New DataSet1()
        Dim myds1 As New DataSet1()


        'This is our DataSet created at Design Time      

        MyDA.Fill(myDS, "Cases")
        myda1.Fill(myds1, "Table")


        'You have to use the same name as that of your Dataset that you created during design time

        Dim oRpt As New rpt_DevCase_90()

       ' Set the SetDataSource property of the Report to the Dataset

        oRpt.SetDataSource(myDS.Tables("Cases"))
        oRpt.Subreports.Item("rpt_time_ext.rpt").SetDataSource(myds1.Tables("Table"))

        ' Set the Crystal Report Viewer's property to the oRpt Report object that we created
         cviewer.ReportSource = oRpt
        cviewer.DataBind()


    End Sub
0
Comment
Question by:simmonsusa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
12 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 12108676
Does either of the report use a parameter?  If so you must pass the parameter to the report.

How did you link the reports?

mlmcc
0
 
LVL 2

Expert Comment

by:sajid_bwp
ID: 12109593
hi simmonsusa
It is MUST to give values to all the parameters of the report either on main report or sub report
If you are using the Parameter in sub report and want to give parmater value of Main report, you can use the
RightClick on Sub Report and Click CHNAGE SUB REPORT LINK

Hope this will solve the Issue

Good Luck
Sajid Majeed
0
 

Author Comment

by:simmonsusa
ID: 12113162
There is no parameter. i'm linking each report on a field in each report. I suppose the parameter is the linked field, but would think that crystal would work that out when you have the select field as {?PM-Field name} when i run the report in crystal it's fine and doesn't pompt me for any values obviously. I can get the sub-report to show values only if i don't link them, but when i link them they don't show any value, it's really strange.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:simmonsusa
ID: 12371040
I don't know who abandoned the question I know i didn't, hopefully someone out there can helpp.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12439981
Is the data correct in the subreports when you don't link them?

mlmcc
0
 

Author Comment

by:simmonsusa
ID: 12440072
yes if i run the report in crystal it's fine run them seperately it's fine, maybe if anyone has a link to an example of a linked sub-report on the net then that would be great.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 12440926
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question