Solved

CR SUB REPORT PROBLEM

Posted on 2013-05-24
4
358 Views
Last Modified: 2013-06-03
Hi All,

I have created a CR report.

It has problem with login prompt.

 Public Sub Print()

               Dim strReportFile As String = strAppFolder & "\REPORT\" & strCRReportName

        Try
            Dim frmCRReportViewer As frmCRReportViewer = New frmCRReportViewer
            Dim ds As DataSet = Me.GetDataSource(strYear & strMonth)

            Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument

            With rpt
                .Load(strReportFile)
             
                .SetDataSource(ds.Tables("HEADER"))
                .Subreports("PENDAPATAN").SetDataSource(ds.Tables("PENDAPATAN"))


                .Subreports("POTONGAN").SetDataSource(ds.Tables("POTONGAN"))
                Object reference not set to an instance of an object.
         
             End With

            With frmCRReportViewer
                .CrystalReportViewer.ReportSource = rpt
                     .Show()
            End With

        Catch ex As Exception
     
        End Try

    End Sub

If I remarks :
      .Subreports("POTONGAN").SetDataSource(ds.Tables("POTONGAN"))
                Object reference not set to an instance of an object.
         
Then show up login.

What should I do?

Thank you.
rptSlipGajiFullSMIT.rpt
SlipGajiFullSMIT.xsd
0
Comment
Question by:emi_sastra
[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
4 Comments
 
LVL 1

Author Comment

by:emi_sastra
ID: 39193809
One more info, the ds (dataset) has no problem. All data needed are there.

Thank you.
0
 
LVL 1

Author Comment

by:emi_sastra
ID: 39217650
Hi All,

Could some experts here help ?

Thank you.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39217795
Generally this is done opening each subreport in turn then assigning the dataset.


This link has a subreport logon example
http://wiki.sdn.sap.com/wiki/display/BOBJ/Crystal+Reports+for+.NET+SDK+Samples

Direct link
https://smpdl.sap-ag.de/~sapidp/012002523100006252712008E/csharp_web_smpl.exe

mlmcc
0
 
LVL 1

Author Closing Comment

by:emi_sastra
ID: 39217930
Great.

Thank you very much for your help.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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