cancel
Showing results for 
Search instead for 
Did you mean: 

Date Fields stripped from datasource in CR2008 SP2

Former Member
0 Kudos

I use Field Definition Files to create Reports and set an IList object to each table via a .NET C# application. This method was working fine in CR2008 SP1, however after upgrading to SP2 it seems that all Date fields are stripped from the datasource.

When a report contains a Date field it simply doesn't appear in the preview when using the Runtime Engine from the SP2 merge modules (ie. the entire field - it's not just blank); and if you use a Date field in a formula you get the error that the field is not known.

Are there any differences in how SP2 handles Field Definition Files and .NET Datasources?, or is there a problem with the SP2 merge modules?

I have since had to revert back to using SP1 merge modules.

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Field Definition Files? Do you mean TTX files? This is an old COM technology created for VB 6 and the RDC SDK. Are you using the Report Designer Component (craxddrt.dll) in your app?

Ludek

Former Member
0 Kudos

Yes I mean TTX files.. but I'm not using the Report Designer Component. I'm simply creating a report with TTX (Field Definition) files. Then load up the report in a C# App using Report.Load, then set the datasource of the report using Report.Tables.SetDataSource by passing a custom collection implementing IList.

This maybe old technology but it is a nice isolated way of creating reports. (ie no need for accessing a class or database when creating a new report).

Edited by: Simon Unsworth on Aug 29, 2009 12:16 AM

former_member183750
Active Contributor
0 Kudos

Fields stripped out means only one thing; the data passed to the report did not match what it was expecting. Best way to troubleshoot this is for you to create an xml from the IList. Then, open the report in the designer and point it st the xml. More than likely you will get a field mapping dialog popping up indicating the fields that the report can not match to what is it expecting.

For more details see the blog [Troubleshooting Issues with VS .NET Datasets and Crystal Reports|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13270] [original link is broken] [original link is broken] [original link is broken];.

The above blog is specific to ADO .NT datasets but the troubleshooting methodology is the same.

You may also consider creating your reports as described in [thishttps://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/401c4455-a31d-2b10-ae96-fa57af5aec20] article, page 5 on.

Ludek

Edited by: Ludek Uher on Aug 31, 2009 6:24 AM

Former Member
0 Kudos

Hi,

I created a very simple object called Person containing a name property and a dob property. I then created an xsd file from this as follows:


<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Person" targetNamespace="http://tempuri.org/Person.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/Person.xsd" xmlns:mstns="http://tempuri.org/Person.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="Person" type="Person" />
	<xs:complexType name="Person">
		<xs:sequence>
			<xs:element name="Name" type="xs:string" />
			<xs:element name="DOB" type="xs:date" />
		</xs:sequence>
	</xs:complexType>
</xs:schema>

in the above I used xs:date instead of xs:dateTime as crystal doesn't even seem to recognise that as a field in the field explorer in the Crystal Report Designer.

I created a blank report and added this as a datasource. Then added both fields to the details section of the report.

In a new C# Application I added this class, added a report viewer to the form and populated a List<Person> collection, then pushed this data to the report with the following:


mPeople.Clear();
mPeople.Add(new Person("Fred Flintstone", new DateTime(1972, 4, 3)));
mPeople.Add(new Person("Casper the Ghost", new DateTime(1983, 8, 24)));
CrystalDecisions.CrystalReports.Engine.ReportDocument reportDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
reportDoc.Load(Path.Combine(Application.StartupPath, "DateTest.rpt"), CrystalDecisions.Shared.OpenReportMethod.OpenReportByDefault);
if (reportDoc.IsLoaded)
{
        reportDoc.Database.Tables[0].SetDataSource(mPeople);
        viewer.ReportSource = reportDoc;
}

After this the report displays in the report viewer without the date field, but the text field is populated fine.

It seems that Crystal doesn't recognise the .NET DateTime class, as if you use xs:dateTime (which is what is generated by the xsd.exe .NET utility for DateTime properties) it doesn't show up as a field in the report designer.

All of this worked no problem at all with CR2008 SP1 which is why it's so strange that after upgrading to SP2 it no longer works.

I should also just re-iterate, as mentioned in my first post the problem only seems to be with the Runtime engine from the SP2 Merge Modules. That is I only get this problem in machines that have the SP2 merge modules installed via my application msi.

Any ideas?

Kind Regards,

Simon.

Former Member
0 Kudos

Hi Ludek,

just reading some other posts, ... would this have anything to do with the following post:

regards,

simon.

Former Member
0 Kudos

... OK... I'm trying again as I've seen numerous other posts with the same problem, but no resolution.

I've not received any response from my posts above which I've demonstrated ways to reproduce the behaviour so here's another way...

This is with Crystal Reports 2008 SP2 installed.

- Start a new C# Windows Application

- Add a form and add a Crystal Reports Viewer control.

- Then Add a DataSet

- Add a table to the DataSet

- Add two columns one for Name (string) and one for BirthDate (DateTime)

- Open Crystal and create a new blank report and assign the XSD created above as the datasource.

- Add the name and birthdate fields to the report.

- Save the report, and then add the following code to the form in the C# app...


DataRow row = ds.Tables[0].NewRow();
row.ItemArray = new object[] { "John Smith", new DateTime(1970, 4, 22) };
ds.Tables[0].Rows.Add(row);
row = ds.Tables[0].NewRow();
row.ItemArray = new object[] { "Joe Bloggs", new DateTime(1964, 8, 16) };
ds.Tables[0].Rows.Add(row);

report = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
string file = System.Configuration.ConfigurationManager.AppSettings["ReportFile"].ToString();
if (!System.IO.File.Exists(file))
{
    MessageBox.Show("Couldn't find the report file.");
    return;
}

report.Load(file);
ds.WriteXML(@"D:\ReportTestData.xml");
report.Database.Tables[0].SetDataSource(ds);
viewer.ReportSource = report;

If you run this little app on a development machine that doesn't have the redistributable runtime engine installed it runs and displays fine .. that is the dates show on the report.

If you run this app on a machine with the redistributable SP1 runtime engine installed it runs and displays fine .. that is the dates show on the report.

HOWEVER, if you install the redistributable SP2 runtime engine, the app runs but the Dates do not display.

I've taken note of the troubleshooting blog, and indeed when you write the xml as in the above code, then set that as the datasource location in the report designer you do get the map fields indicating that there is no BirthDate field.

This XML and the XSD are generated by Native .NET functionality.

The XML that is generated is below:

<?xml version="1.0" standalone="yes"?>
<PeopleDS xmlns="http://tempuri.org/DataSet1.xsd">
  <People>
    <Name>John Smith</Name>
    <BirthDate>1970-04-22T00:00:00+10:00</BirthDate>
  </People>
  <People>
    <Name>Joe Bloggs</Name>
    <BirthDate>1964-08-16T00:00:00+10:00</BirthDate>
  </People>
</PeopleDS>

Can you please try this out at your end... I've done all that has been asked to troubleshoot this at my end, and have received no response.

the other posts are

and

It also makes it very difficult to get this information across when the post doesn't display as it should.

former_member183750
Active Contributor
0 Kudos

Simon, first, I must thank you for the instructions. From here, I have good news, and not so good news. The good first;

I was able to reproduce the issue.

The bad;

I will track this with QA on Monday. Unfortunately, fixes usually take 6+ moths to resolve, so I'm quite sure we're looking at Q2 2010 when SP 3 is planned to be released. But I have been surprised before. I suppose meanwhile, we have to stay on SP 1. The latest update for SP 1 is Fix Pack 1.8. Now, SP 2 contains fixes up to and including FP 1.5. So, I am not sure what issue was addressed by SP 2 for you, but perhaps staying on SP 1 and adding the Fix Pack 1.5 will give you everything SP 2 would have. Now, since you are on SP 2, you will have to uninstall it, reinstall CR 2008 and add the FP at that point. I am at the end of my day and I'd like to test this on CR 2008 SP 1 + FP 1.5, but that will have to wait until Monday.

Have a great weekend,

Ludek

Former Member
0 Kudos

Hi Ludek,

that is good news.

My reasoning for moving to SP2 was simply to keep up to date with your software as Windows 7 is due out soon.

At the moment it is OK that I can only use SP1, although it will be good to hear what Fix pack I can go up to.

I really just wanted to know that you knew about the problem so it could be fixed.

Thanks again.

Simon.

former_member183750
Active Contributor
0 Kudos

The issue is being tracked under number 5000152266. As this appears to be a backward compatibility issue, the fix for this may be faster than the normal 6+ month. I will update this thread as more info comes in.

Ludek

Answers (4)

Answers (4)

Former Member
0 Kudos

As well as having reports where DateTime fields are stripped out, we have several reports where DateTime fields are referenced in formula fields u2013 in this scenario the user sees a nice error message stating u201CThe field is not known.u201D

The way Iu2019ve gotten around this problem is to add a calculated column to the DataTable which converts the date field to a string u2013 i.e. Convert(datefield,u2019System.Stringu2019). In the report, I use the new string column instead of using the original date column.

former_member183750
Active Contributor
0 Kudos

Thank you for sharing this workaround Roger. Nice way out of the issue if copying the dll is not acceptable.

BTW., the issue has been assigned to R&D with a high priority.

Ludek

former_member183750
Active Contributor
0 Kudos

Issue is reported to be resolved in SP 2.3 for CR 2008. The SP is available from here;

https://smpdl.sap-ag.de/~sapidp/012002523100015892592009E/cr2008v1_sp2fp23.exe

I have not tested this SP.

Ludek

Follow us on Twitter http://twitter.com/SAPCRNetSup

Former Member
0 Kudos

Hi Ludek,

I've just tested the SP2 FP2.3 merge modules and they don't want to register in Windows 7 (assume it to be the same as Vista).

I'm aware of the dependencies on VC++ 2005 Redistributable, and had installed this prior to running the installer containing the CR SP2 FP2.3 merge modules.

I also tested the prior installer containing the CR SP1 FP1.3 merge modules which also had the dependency on VC++ 2005 and it installed no problem at all, which led me to believe there is a problem with the merge modules in the Fix Pack 2.3.

Any help here would be greatly appreciated.

Cheers,

Simon.

former_member183750
Active Contributor
0 Kudos

I'll have to test the WIN 7 issue, but I do have a few questions;

1) If you complete the install despite the reg errors and then try to register the dll(s) manually, are you able to do so?

2) Can you try the MSI?

https://smpdl.sap-ag.de/~sapidp/012002523100016459862009E/cr2008_fp23_redist.zip

Ludek

Former Member
0 Kudos

Thanks Ludek, this indeed is a great tip since my Development boxes in fact can no longer produce reports......

The Clients and installed PC with SP1 work fine but my SP2 stays in my registry (unless I manually Unregister all the SP2 DLLs.)

Accordingly you tip of swapping Files can indeed come in handy. I appreciate this tip.

Thanks and we'll keep a close watch on the progress on this one of course.

Former Member
0 Kudos

Like Simon I have reverted back to SP1.

The Fix period far exceeds any useful timeframe and accordingly we are now stopping the investigation and time spend looking for a workaround.

Naturally we will keep an eye out on this thread and a fix, but we should have stayed with the orginal Crystal2008 or even Crystal XI. We have had nothing but trouble with deployments since the advent of SP1 and SP2. This has been a very expensive and bad upgrade strategy for us.

We should have known this though, as it was unrealistic to expect that SAP could adopt and improve this old product.

In my view it is even amazing that they lend any kind of support to this. For now though, it has not delivered and advantages to me and my teams. We will suspend development on SP1 for now in the hope that a fix is both imminent and good (which really has to be proven first in terms of deployments (X64 support, Printing Quality, PDF Export capabilities and quality, as well as of course the ability to run all our DataSet Driven Reports.).

Ludek, thanks for your help and guidance, we'll keep an eye out on any development from your team.

former_member183750
Active Contributor
0 Kudos

I understand your frustration completely. For now, all we can do is watch for the fix to come through. Once I have a notice of the fix, I'll re-test the issue and let you know where to download the fix from.

Ludek

former_member183750
Active Contributor
0 Kudos

I have a bit of a work-around in case you need to stay on SP 2.

Look for the file crdb_adoplus.dll on your development computer (c:\program files\business objects\businessobjects enterprise\win32_x86). The file should have a version of 12.1.2000.882.

On the deployed computer find the same dll, same dir. The version of this dll should be 12.2.2000.290. rename this dll. Then copy the dll form the dev computer to your deployed computer. Once I did htis, my app started to work as expected.

Note this is not a fix, just a work around.

Ludek

Former Member
0 Kudos

I'm marking this as unanswered as it was 'assumed answered'.

It is definitely not resolved. I'll post another message with more info on this topic soon.