Solved

CR SUB REPORT PROBLEM

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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 …
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

761 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