on 01-08-2010 2:19 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.