Solved

How to show multiple tables records in Crystal Report for VB.NET at run-time?

Posted on 2008-06-23
2
1,549 Views
Last Modified: 2012-06-27
Hi Experts

I am creating a project based on Student Classes Attendance, in which I have 6 tables, all are linked with main table.  Main table is "tblSheet" and related tables are like "tblPeriod", "tblBatch", "tblTerm" etc.
I created Crystal Report in which I have linked all 6 tables Crystal Report.
With the same query / tables and fields query I have created a DataSet, now the data in DataSet is correct, when I watching preview in Crystal Report (which was created at design time) is also displaying correct result, but When I pass this dataSet to Crystal Report at run-time the records are multiple and repeating again and again.
I have digged the problem that the INNER JOIN is not working when I pass the dataset in Crystal Report.
How can i make joining of tables in Crystal Report at run time or is there any other alternate solution to preserve linking of tables.

if you want then I can furnish my Ms Access Databse and complete project.
'This is query from which I am creating DataSet
SELECT     tblbatch.BatchName, tblsheet.EngagedBy, tblsheet.LectureNo, tblsheet.NoOfStudents, tblsheet.Topic, tblsheet.[Date], tblsheet.[Day],
tblsubject.SubjectName, tblterm.TermName, tbltime.[Time],  tblperiod.PeriodName           
FROM         (((((tblbatch INNER JOIN
                      tblsheet ON tblbatch.BatchId = tblsheet.BatchId) INNER JOIN
                      tblsubject ON tblsheet.SubjectId = tblsubject.SubjectId) INNER JOIN
                      tblterm ON tblsheet.TermId = tblterm.TermId) INNER JOIN
                      tbltime ON tblsheet.TimeId = tbltime.TimeId) INNER JOIN
                      tblperiod ON tblsheet.PeriodId = tblperiod.PeriodId)
 
 
'----- Report Code -------------
'Create Report Document to Load Report and Parameters for Report.
            Dim dbRep As New ReportDocument
 
            'Load Report from Specified path to Report document object.
            dbRep.Load(ReportPath)
 
            'Load DataSet (created from above query) into Report.
            dbRep.SetDataSource(dbDS.Tables("tblsheet"))   
 
            'Bind Report Document to CrystalReportViewer to Show Report.
            CrystalReportViewer1.ReportSource = dbRep

Open in new window

0
Comment
Question by:imtiazwighio
[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
2 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 500 total points
ID: 21847873
Have you seen this example on how to feed your report from an application?

http://www.emoreau.com/Entries/Articles/2006/09/Feeding-Crystal-Reports-from-your-application.aspx

mlmcc
0
 

Author Closing Comment

by:imtiazwighio
ID: 31469779
Thanks a lot Mr. Mlmcc
I have got my solution, I was using very old stylish report... Thanks again
0

Featured Post

Increase Agility with Enabled Toolchains

Connect your existing build, deployment, management, monitoring, and collaboration platforms. From Puppet to Chef, HipChat to Slack, ServiceNow to JIRA, Splunk to New Relic and beyond, hand off data between systems to engage the right people.

Connect with xMatters.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
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…

695 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