Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

crystal sub report asking for a parameter value? .net

Posted on 2004-09-20
12
Medium Priority
?
338 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 101

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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 101

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 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 12440926
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

704 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