locked
Crystal Report Text cut off at 254 characters

    Question

  • I’m creating a reports with Crystal reports that will be loaded on a web page using Crystal Reports Viewer (web form in C#).

     

    The Data source of the reports is a stored procedure that has a field varchar 2500.  The field on the report linked to this data has the “Can Grow” feature set to on.

     

    When I run it on my local dev pc (the one which has been use to created it, via the build/run option) the preview is perfect, the field is shown accordingly (all the characters are present)… 

    Then I publish the site on my local dev pc to test it (as a web site), and it worked fine also.

     

    But when I publish the site to another server (prod server),  for some reason the text box containing the data is being cut off to 255 characters, but the “can grow” feature still work.

    So it seem like (on prod) there is something limiting the text box to 255 char.

     

    Ive check on the web and saw that some people use to have an issue with the printer set up (DesignàPage SetupàPrint option) where there is an option about the printer option…  In my case Ive the check box “No printer checked.  Ive also try to uncheck it but the result is the same.

     

    Anyone has any idea what would fix this issues…

     

    For reference, on the dev pc I have ibnstalled :

    -          Visual Studio .NET 2010

    -          SAP Crystal Reports, version  for Visual Studio 2010 (v.13.0.1.220)

    -          SAP Crystal Reports runtime engine for .NET Framework 4 (32-bit) v.13.0.0.99

     

    On the web server (prod), I have :

    -          SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit) v.13.0.1.220

     

    thanks

    Wednesday, June 08, 2011 6:37 PM

Answers

  • Good to know and thank you for verifying the DB server info... Check the version of MDAC on the Production server and specifically the SQLNCLI.DLL. Compare versions, and don't simply copy the dll's over. Search here for MDAC and update/install the current version.

    If you continue to use the ODBC driver then use the SQL Client as your client driver and/or test with SQL Native Server driver. CR was updated to support MS SQL Server Native 10 client so it may have a side effect when using the Native drivers when connecting to SQL 2005.

    Use what ever works best and if you do need to convert to OLE DB then there is an option to use RAS and and the ReplaceConnection methods to update the report.

    To do so this is how you do it using RAS:

    using CrystalDecisions.CrystalReports.Engine;<br/>using CrystalDecisions.Shared;<br/>using CrystalDecisions.ReportAppServer.ClientDoc;<br/>using CrystalDecisions.ReportAppServer.Controllers;<br/>using CrystalDecisions.ReportAppServer.ReportDefModel;<br/>using CrystalDecisions.ReportAppServer.CommonControls;<br/>using CrystalDecisions.ReportAppServer.CommLayer;<br/>using CrystalDecisions.ReportAppServer.CommonObjectModel;<br/>using CrystalDecisions.ReportAppServer.ObjectFactory;<br/>using System.Data.OleDb;<br/>using CrystalDecisions.ReportAppServer.DataSetConversion;<br/>using CrystalDecisions.ReportAppServer.DataDefModel;<br/>using CrystalDecisions.ReportSource;<br/>using CrystalDecisions.Windows.Forms;<br/><br/>private void ReplaceConnection_Click(object sender, EventArgs e)
    {
    CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    ISCDReportClientDocument rcd;
    
    rcd = rptClientDoc;
    
    rptClientDoc.DatabaseController.LogonEx("YourServer", "xtreme", "sb", "pw");
    
    //Create the logon propertybag for the connection we wish to use
    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag logonDetails = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    logonDetails.Add("Auto Translate", -1);
    logonDetails.Add("Connect Timeout", 15);
    logonDetails.Add("Data Source", "YourServer");
    logonDetails.Add("General Timeout", 0);
    logonDetails.Add("Initial Catalog", "YourDatabaseTable");
    logonDetails.Add("Integrated Security", "True");
    logonDetails.Add("Locale Identifier", 1033);
    logonDetails.Add("OLE DB Services", -5);
    logonDetails.Add("Provider", "SQLOLEDB");
    logonDetails.Add("Use Encryption for Data", 0);
    logonDetails.Add("Owner", "dbo"); // schema
    
    //Create the QE (query engine) propertybag with the provider details and logon property bag.
    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag QE_Details = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    QE_Details.Add("Database DLL", "crdb_ado.dll");
    QE_Details.Add("QE_DatabaseName", "YourDatabaseTable");
    QE_Details.Add("QE_DatabaseType", "OLE DB (ADO)");
    QE_Details.Add("QE_LogonProperties", logonDetails);
    QE_Details.Add("QE_ServerDescription", "YourServer");
    QE_Details.Add("QE_SQLDB", "True");
    QE_Details.Add("SSO Enabled", "False");
    QE_Details.Add("Owner", "dbo");
    
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo newConnInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo oldConnInfo;
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos oldConnInfos;
    
    oldConnInfos = rcd.DatabaseController.GetConnectionInfos(null);
    for (int I = 0; I < oldConnInfos.Count; I++)
    {
    oldConnInfo = oldConnInfos;
    newConnInfo.Attributes = QE_Details;
    newConnInfo.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    rcd.DatabaseController.ReplaceConnection(oldConnInfo, newConnInfo, null, CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB);
    }
    }
    
    
    

    Thanks
    Don
    

    Don Williams
    Thursday, June 09, 2011 4:41 PM

All replies

  • Hello,

    It's likely your database client or driver limiting it, my first guess would be you are using ODBC. Use ProcessMonitor or Modules to check the Client and other dependencies on your Production PC.

    What DB and how are you connecting?

    Thank you

    Don

     


    Don Williams
    Wednesday, June 08, 2011 8:51 PM
  • Im using SQL Server 2005 and on both server (dev and prod) both the web site and database are installed locally.  Evidently, on the dev side it is a local sql server developer edition wherweas on the prod it is the standard edition.

     

    As for the connection, it is one that I created directly in the Crystal Reports Data Source selection page of the report wizard (when you create the first report), I created the one named “OLE DB (ADO)”, and has been re-using the same connection for all reports.

     

    I did a test using a DSN ODBC instead of the OLE DB connection, and the problem is resolved, so I will try and check the version of both OLE DB on both pc to see if I can fix this by putting the same version or else I guess ill redo them all using an ODBC.

     

    Thanks, Ill keep you posted if I have any other advancement.

    Thursday, June 09, 2011 2:01 PM
  • Good to know and thank you for verifying the DB server info... Check the version of MDAC on the Production server and specifically the SQLNCLI.DLL. Compare versions, and don't simply copy the dll's over. Search here for MDAC and update/install the current version.

    If you continue to use the ODBC driver then use the SQL Client as your client driver and/or test with SQL Native Server driver. CR was updated to support MS SQL Server Native 10 client so it may have a side effect when using the Native drivers when connecting to SQL 2005.

    Use what ever works best and if you do need to convert to OLE DB then there is an option to use RAS and and the ReplaceConnection methods to update the report.

    To do so this is how you do it using RAS:

    using CrystalDecisions.CrystalReports.Engine;<br/>using CrystalDecisions.Shared;<br/>using CrystalDecisions.ReportAppServer.ClientDoc;<br/>using CrystalDecisions.ReportAppServer.Controllers;<br/>using CrystalDecisions.ReportAppServer.ReportDefModel;<br/>using CrystalDecisions.ReportAppServer.CommonControls;<br/>using CrystalDecisions.ReportAppServer.CommLayer;<br/>using CrystalDecisions.ReportAppServer.CommonObjectModel;<br/>using CrystalDecisions.ReportAppServer.ObjectFactory;<br/>using System.Data.OleDb;<br/>using CrystalDecisions.ReportAppServer.DataSetConversion;<br/>using CrystalDecisions.ReportAppServer.DataDefModel;<br/>using CrystalDecisions.ReportSource;<br/>using CrystalDecisions.Windows.Forms;<br/><br/>private void ReplaceConnection_Click(object sender, EventArgs e)
    {
    CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
    ISCDReportClientDocument rcd;
    
    rcd = rptClientDoc;
    
    rptClientDoc.DatabaseController.LogonEx("YourServer", "xtreme", "sb", "pw");
    
    //Create the logon propertybag for the connection we wish to use
    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag logonDetails = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    logonDetails.Add("Auto Translate", -1);
    logonDetails.Add("Connect Timeout", 15);
    logonDetails.Add("Data Source", "YourServer");
    logonDetails.Add("General Timeout", 0);
    logonDetails.Add("Initial Catalog", "YourDatabaseTable");
    logonDetails.Add("Integrated Security", "True");
    logonDetails.Add("Locale Identifier", 1033);
    logonDetails.Add("OLE DB Services", -5);
    logonDetails.Add("Provider", "SQLOLEDB");
    logonDetails.Add("Use Encryption for Data", 0);
    logonDetails.Add("Owner", "dbo"); // schema
    
    //Create the QE (query engine) propertybag with the provider details and logon property bag.
    CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag QE_Details = new CrystalDecisions.ReportAppServer.DataDefModel.PropertyBag();
    QE_Details.Add("Database DLL", "crdb_ado.dll");
    QE_Details.Add("QE_DatabaseName", "YourDatabaseTable");
    QE_Details.Add("QE_DatabaseType", "OLE DB (ADO)");
    QE_Details.Add("QE_LogonProperties", logonDetails);
    QE_Details.Add("QE_ServerDescription", "YourServer");
    QE_Details.Add("QE_SQLDB", "True");
    QE_Details.Add("SSO Enabled", "False");
    QE_Details.Add("Owner", "dbo");
    
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo newConnInfo = new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo oldConnInfo;
    CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfos oldConnInfos;
    
    oldConnInfos = rcd.DatabaseController.GetConnectionInfos(null);
    for (int I = 0; I < oldConnInfos.Count; I++)
    {
    oldConnInfo = oldConnInfos;
    newConnInfo.Attributes = QE_Details;
    newConnInfo.Kind = CrystalDecisions.ReportAppServer.DataDefModel.CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    rcd.DatabaseController.ReplaceConnection(oldConnInfo, newConnInfo, null, CrystalDecisions.ReportAppServer.DataDefModel.CrDBOptionsEnum.crDBOptionDoNotVerifyDB);
    }
    }
    
    
    

    Thanks
    Don
    

    Don Williams
    Thursday, June 09, 2011 4:41 PM