cancel
Showing results for 
Search instead for 
Did you mean: 

Drilldowns not working on .NET Crystal Reports Viewer

Former Member
0 Kudos

Hi,

I am using CR2008 and VS 2005 (framework2.0). I have 2 issues with the crystal reports on .NET environment.

1. The drilldown are not working on .net environment when the report has any charts. Drilldowns works fine if the reports doesn't have any charts. If the report has any charts, the report is loaded with javascript errors and the drilldowns doesnt' work. The Javascript error is "lowerBoundType is null or not is an object."

However the all the drilldowns works fine in CR 2008 desinger.

2. I have a formula field which looks like below:

if x=y then " Nuclear" else "Coal"

In CR2008 designer, this displays well but when reprot is displayed dispalyed through .net crystal viewer, the white spaces are removed.

Please let me know if any one have some solution for above 2 issues.

below is the code I am using to launch the report on .net environment.

==============================

TableLogOnInfo crTableLogOnInfo;

ConnectionInfo crConnectionInfo = new ConnectionInfo();

//CREATE REPORT OBJECT

ReportDocument crReportDocument = new ReportDocument();

string filename = Server.MapPath(@Request.QueryString["ReportURL"]);

crReportDocument.Load(filename);

//Set the ConnectionInfo properties for logging on to

//the Database

crConnectionInfo.ServerName = sServerName;

crConnectionInfo.DatabaseName = "";

crConnectionInfo.UserID = sUserName;

crConnectionInfo.Password = sPassword;

//Loop through all tables in the report and apply the

//connection information for each table.

foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crReportDocument.Database.Tables)

{

crTableLogOnInfo = crTable.LogOnInfo;

crTableLogOnInfo.ConnectionInfo = crConnectionInfo;

crTable.ApplyLogOnInfo(crTableLogOnInfo);

}

//Create parameter objects

XmlDocument xmlParamsDoc = new XmlDocument();

XmlNodeList xmlParams;

XmlNodeList xmlValues;

ParameterFields myParams = new ParameterFields();

ParameterField myParam;

ParameterDiscreteValue myDiscreteValue;

//xmlParamsDoc.Load(Request.InputStream);

xmlParamsDoc.LoadXml(Session["XMLParams"].ToString());

xmlParams = xmlParamsDoc.SelectNodes("//parameters/parameter");

foreach (XmlNode xmlParam in xmlParams)

{

// Set the ParameterFieldName to the name of the parameter created in the Field Explorer

myParam = new ParameterField();

myParam.ParameterFieldName = xmlParam.Attributes["name"].Value;

xmlValues = xmlParam.SelectNodes("values/value");

foreach (XmlNode xmlValue in xmlValues)

{

// Add parameter value

myDiscreteValue = new ParameterDiscreteValue();

myDiscreteValue.Value = xmlValue.Attributes["value"].Value;

myParam.CurrentValues.Add(myDiscreteValue);

}

myParams.Add(myParam);

}

// Finally Assign the params collection to the report viewer

crViewer.ParameterFieldInfo = myParams;

crViewer.ReportSource = crReportDocument;

========================

Thanks

Rama

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Rama;

Please post your second question as it's own post.

For the drill down issue, is this happening on your client system, or development system?

If it is on the client, how did you deploy the runtime for Crystal Reports?

Do you have service pack 2 for CR 2008 installed?

Regards,

Jonathan

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

Former Member
0 Kudos

Hi, Jonathan,

Drilldown issue is happening on both development and client machines. Today I installed CR2008 Runtime SP 2 on the web server and recompiled the ASP.NET web applciation but still I am facing the same issue on the client machines.

Thanks

Rama

Former Member
0 Kudos

Hi, Rama;

The java script error is not a familiar one in regards to Crystal. Can you try running one of our sample reports that has a chart in your application and see if it works. Or, create a new, simple application that just has our viewer and views a report. Does it work or fail?

What is the operating system you are having issues on? Which web browser are you using?

Regards,

Jonathan

Former Member
0 Kudos

Thank you Jonathan.

This is becuase of date parameter. I changed the date parameter to string parameter on the report and passed the date as string. It did work now.

Thank your support.

Thanks

Rama

Answers (1)

Answers (1)

Former Member
0 Kudos

I've got the same error (LowerBoundType is null or not an object) with IE 7 and 8

I've created crystal reports for each parameter type and I've got only this error with types datetime, date and time.

I put parameters values with the method Me.Report.SetParameterValue(name,value).

The error occured at the line "if (value.lowerBoundType !== undefined"

_getDisplayText: function(param,value) {
        if (value === undefined) {
            return undefined;    
        }
        
        if (value.lowerBoundType !== undefined || value.upperBoundType !== undefined) {
            return this._getRangeDisplayText(param, value);    
        }        
        
        var valueText = this._getValueTextFromDefaultValue(param,value);
        
        if(valueText == null) {
            valueText = this._getValueText(param.valueDataType, value);
        }
        
        return valueText;
    }

How can I fix that ? I can't change date parameter to string parameter.

Thanks

Matt

former_member183750
Active Contributor
0 Kudos

Try the code below:

'Retrieve the Parameters collection from the Report. It is important to note that 'Subreport Parameters are contained within the Main Report's ParameterFieldDefinitions 'collection. 'Passing Subreport Parameter values directly to the Subreport will result 'in the values not being applied and the user being prompted at runtime to provide new values

        crParameterFieldDefinitions = crrptdoc.DataDefinition.ParameterFields

        'Access the individual report parameter field "Order Date Range"
        crParameterFieldDefinition = crParameterFieldDefinitions.Item("Order Date Range")

        'Cast the variable to hold the values to pass to the Report before execution
        crParameterValues = crParameterFieldDefinition.CurrentValues

        'Cast the variable to hold the range value for the parameter
        crParameterRangeValue = New ParameterRangeValue()

        'Set the Date range and include the upper and lower bounds. Use the Cdate function as insurance 'to ensure that the value  
        'passed is cast to the appropriate data type 
        With crParameterRangeValue
            .EndValue = CDate("1/1/1997")
            .LowerBoundType = RangeBoundType.BoundInclusive
            .StartValue = CDate("12/20/1997")
            .UpperBoundType = RangeBoundType.BoundInclusive
        End With

        'Apply the Date range to the values to be passed to the Report 
        crParameterValues.Add(crParameterRangeValue)

        'Pass the parameter values back to the report
        crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)

Ludek

Former Member
0 Kudos

I've tried your code but there is an issue :

I don't have a range date parameter (only one date value parameter) so when I try your code an error has occured :

Message = "The parameter field current values cannot contain range values because the ValueRangeKind property is set to discrete."

I've tried to replace New ParameterRangeValue() by New ParameterDiscreteValue()

and so LowerBoundType is null or not an object come again

Any ideas ?

Thanks

Matt

Former Member
0 Kudos

I've found what's my problem and so the solution ^^

When I use SetParameterValue(name,value), value was always a string object

And I supposed it works because crystal report displayed my value

If I transform value in Datetime (or timespan), it works

Thanks

Matt