Solved

Frustrating Crystal Reports / VS2013 problem

Posted on 2015-02-07
16
158 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with deleting records by comparing two files using VB.NET 8 55
Copy/Clone an object. 9 29
VB.Net - Oracle BulkCopy from CSV Date Format 7 44
Close word object 13 38
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
A short film showing how OnPage and Connectwise integration works.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

930 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

13 Experts available now in Live!

Get 1:1 Help Now