Solved

Frustrating Crystal Reports / VS2013 problem

Posted on 2015-02-07
16
157 Views
Last Modified: 2015-03-14
I have a strange problem. I inherited a project that was written in VB 6, and needs to be converted to .NET.  I am now down to the reports.  I have a report that contains several subreports (7).  Every bit of the data I'm feeding each subreport is being displayed appropriately with the exception of one subreport.

I am providing data by means of the .SetDataSource(<datatable) method.  I have verified that the XSD has the correct field mappings, and that the data types are correct.  I have also verified that the table I'm passing has data in it.  The data just doesn't display on the report.  I have tried updating to release 13 of CR for Visual Studio version 13, but I still get the same results.

I realize I'm not providing a lot of informaiton, but I'm not sure what to give you beyond the code snippets below (remember, naming conventions have been inherited from vb6 days):
            crpReport.SetDataSource(rsRunReport.Tables(0))
            crpSubLogo.SetDataSource(rsLogoPic.Tables(0))
            crpSubRunLot.SetDataSource(rsRunLot.Tables(0))
            crpSubProcessArea.SetDataSource(rsProcessInfo.Tables(0))
            crpSubAddress.SetDataSource(rsAddress.Tables(0))
            crpSubProdData.SetDataSource(rsProcessInfo.Tables(0))
            crpSubEventLog.SetDataSource(rsEventLog.Tables(0))

Open in new window

I have verified that rsProcessInfo.Tables(0) has valid data.  I have also checked the specific fields called by that subreport and they are populated correctly.  The rsProcessInfo.Tables(0) datatable is intended to supply data to multiple subreports.  Again, this is inherited code.
The results of this report run returns the information on the screenshot I uploaded.
report.png
0
Comment
Question by:Shane Kahkola
  • 10
  • 6
16 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40596129
WHat are the formulas you are using on the report for the values?

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40596134
I'm not using a formula for the missing data.  Those fields were created by dragging the datasource field name to the report.  The formulas you are seeing are labels.  Those are being populated appropriately.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40596137
Can you upload the report file?

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40596142
Due to confidentiality documents, no, I can't.  I realize that limits what others can do to help. Basically I'm looking for someone to see the problem and thin, "I've seen that before."

I realize it's probably an odd problem.  So, I would take any suggestions, and I do appreciate the frustration that can ensue when trying to help someone who can't give you all of the information.

I would probably be able to do it if I exchanged the file with you privately.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40596158
Can you upload with no data?

How is the subreport linked to the main report?

If you run that subreport as its own report does it show data?

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40596167
Private messaged
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 150 total points
ID: 40596184
WHen you generate the data file, are you sure there is data for that subreport?

There is no filter on the subreport.  It is not linked to the main report.
Knowing those 2 items indicates there is no data for the subreport.

Try a verify database to ensure all subreports are correctly tied to the sources.

You could also try a set datasource location on that subreport

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40596189
I looped through the rsProcessInfo table in the code and sent the output to a text file.  I have attached it here.
Data.txt
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 100

Expert Comment

by:mlmcc
ID: 40596263
The report thinks the values are strings.  When I converted your text file to a spreadsheet everything was taken to be numbers

I also don't see those column names in the XSD file.

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40596297
I'll fix the column names, and doesn't excel automatically consider a numeric value as a number when it imports?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40596351
Probably.  Are they strings in the XSD?

mlmcc
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40597217
Yes, they are strings in the XSD.  What's interesting is that I generated the XSD from the rsProcessInfo.WriteXmlSchema() method.  Then I added the XSD to the project, and re-mapped the Data Source Location in the field explorer to the new XSD.  I did have to change a couple of field mappings, but the rest matched-up with what the report expected to see.
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40606388
The issue still is not resolved, but I was able to create a new report, use the same XSD, and get data on the new report.  I'm really confused as to why that is working.  I have decided to rebuild the report from scratch.  I'm going to add one dataset at a time, and one subreport at a time.  When it breaks, hopefully that will resolve the issue.
0
 
LVL 3

Author Comment

by:Shane Kahkola
ID: 40613336
Now the stupid thing keeps asking for a login.  I can't win.
0
 
LVL 3

Accepted Solution

by:
Shane Kahkola earned 0 total points
ID: 40654923
The original issue was me modifying one report while the program was calling for a different report.  They are "basically" the same report.  My only defense is that I inherited the application -- I didn't write it.

The second issue comes down to an empty dataset being passed to the report.  Once I corrected the empty dataset issue, all was well.
0
 
LVL 3

Author Closing Comment

by:Shane Kahkola
ID: 40664875
I appreciate the help MLMCC, I gave you some points because of the effert you put into helping me.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.

757 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