Solved

CR SUB REPORT PROBLEM

Posted on 2013-05-24
4
344 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

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. …
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now