Dynamic command execution fails in Crystal report viewer for parameters

We are using the Crystal Report Viewer for the .Net Application on the client side.The reports are designed using Crystal Report XI R2.
The issues that we are currently encountering is that, we are unable to load the combo-boxes in the pop-up for the parameters.
All the reports have multiple commands and the variables are of 'dynamic' type.
When the dialog box for requesting the pop-up comes up, It comes up empty even though they are linked to the respective commands.
Also,For reports having multiple parameters we are unable to give a single dialog box to get in all the parameters.It appears as a series of prompts.
Both,these issues are not encountered when the reports are launched via the Crystal reports developer tool.

Hello Varun,
I recommend to post this questionin the [dedicated NET forum|SAP Crystal Reports, version for Visual Studio;.
This forum is monitored by qualified technicians and you will get a faster response there.
Thank you for your understanding,
Falk

Similar Messages

  • Dynamic command execution fails in Crystal report viewer

    We are using the Crystal Report Viewer for the .Net Application on the client side.The reports are designed using Crystal Report XI R2.
    The issues that i am currently encountering is that, we are unable to load the combo-boxes in the pop-up for the parameters.
    All the reports have multiple commands and the variables are of 'dynamic' type.
    When the dialog box for requesting the pop-up comes up, It comes up empty even though they are linked to the respective commands.
    Also,For reports having multiple parameters we are unable to give a single dialog box to get in all the parameters.It appears as a series of prompts.
    Both,these issues are not encountered when the reports are launched via the Crystal reports developer tool.

    Did you end up cross posting this anywhere else?  I just started running into the problem with XI r1 trying to view a report I modified in r2.  The only solution I seem to have found involves upgrading all of our customers to r2, which is not a very pleasant option.  I'd be interested in learning if anyone has come up with a better solution.

  • Is there a recommended crystal reports viewer for Mavericks?

    I am having some trouble finding a Crystal reports viewer for Mavericks and was wondering if someone might have some guidance as to the best solution(s).
    Thanks!

    This is the most current:
    http://scn.sap.com/docs/DOC-29774
    I don't know about Mavericks support, but it at least launches on my system.
    Regards.

  • Crystal report Viewer for 8.5 reports

    We are using an older version of Crystal reports (8.5) and use an application called RePortal (that use Crystal Enterprise) to view the reports through out the building. We recently had a report that was created and we are getting an error:
    Error encountered by Crystal PageServer
    Unable to connect: incorrect table location. File Worksheet.rpt. On Cache/Page Server:
    I tried a few solutions I found on line, but that didn't work.
    My thought was to bypass and download the free Crystal Report viewer, but the one I found was only compatible with Reports written in 9 or higher.
    Does anyone know how to resolve the error above or we I can find an older version of Viewer to work on 8.5

    Hi
    Now am using Crystal Report 8.5 with Visual Basic 6.0
    i want to use latest of crystal report with Visual basic 6.0
    can anyone suggest which version i have to use
    it must be compatible with Visual Basic 6.0
    Regards
    Abhi

  • Reuse Crystal report Viewer For different reports - unload cache

    So I am migrating from crystal reports basic to crystal reports 2008. I have hit a stumbling block. Rather than have a new page and report viewer for each report I decided it would be easier to have one report viewer and send to it in session variables the report I wish to run and appropriate parameters. This seemed to work fine in CR basic.
    Now I have upgraded the viewer works fine for the first report I run however it then caches this report and doesn't seem to clear it down, if the new report has different parameters I will get a parameter error. If I run a report requiring the same parameters I will get the original report not an updated one.
    I believe I need to leave the CrystalReportSource cache on in order to page the report (correct me if I am wrong)
    I have taken a few snippets of code, is this possibly running too late in page life cycle have I missed something or is there a way to force a cache clear:
    protected override void OnLoad(EventArgs e) {
    //setup report in viewer with correct db logon
                    CrystalRepSource.Report.FileName = report;
                    SetupLogonInfo(CrystalRepSource);
                    //add parameters
                    AddParam(paramFields, pfItem1, dcItem1, "@year", year);
                    AddParam(paramFields, pfItem2, dcItem2, "@school", school);
                    AddParam(paramFields, pfItem3, dcItem3, "@division", division);
                    AddParam(paramFields, pfItem4, dcItem4, "@progArea", progArea);
                    AddParam(paramFields, pfItem5, dcItem5, "@type", SessionHandler.record_type);
                    AddParam(paramFields, pfItem6, dcItem6, "@filterText", "School = \'" + school +
                                                            "\' Division = \'" + division
                                                            + "\' Programme Area = \'" + progArea
                                                            + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
    CrystalViewer.ParameterFieldInfo = paramFields;
    private void SetupLogonInfo(CrystalReportSource CrystalRepSource)
            TableLogOnInfo logOnInfo = new TableLogOnInfo();
            logOnInfo = CrystalRepSource.ReportDocument.Database.Tables[0].LogOnInfo;
            ConnectionInfo connectionInfo = new ConnectionInfo();
            connectionInfo = logOnInfo.ConnectionInfo;
            connectionInfo.DatabaseName = Application["db"].ToString();
            connectionInfo.ServerName = Application["server"].ToString();
            connectionInfo.Password = Application["pass"].ToString();
            connectionInfo.UserID = Application["user"].ToString();
            CrystalRepSource.ReportDocument.Database.Tables[0].ApplyLogOnInfo(logOnInfo);
        private void AddParam(ParameterFields paramFields, ParameterField pfItem, ParameterDiscreteValue dcItem, string fieldName, string value)
            pfItem.ParameterFieldName = fieldName;
            dcItem.Value = value;
            pfItem.CurrentValues.Add(dcItem);
            paramFields.Add(pfItem);

    ok so I have tried changing the code to:
    CrystalRepSource.ReportDocument.SetParameterValue("@year", year);
                    CrystalRepSource.ReportDocument.SetParameterValue("@school", school);
                    CrystalRepSource.ReportDocument.SetParameterValue("@division", division);
                    CrystalRepSource.ReportDocument.SetParameterValue("@progArea", progArea);
                    CrystalRepSource.ReportDocument.SetParameterValue("@type", SessionHandler.record_type);
                    CrystalRepSource.ReportDocument.SetParameterValue("@filterText", "School = \'" + school +
                                                            "\' Division = \'" + division
                                                            + "\' Programme Area = \'" + progArea
                                                            + "\' Record Type = \'" + SessionHandler.record_type_text + "\'");
    private void Page_Unload(object sender, EventArgs e)
            try
                    CrystalRepSource.Report.DataSources.Clear();
                    CrystalRepSource.Report.Parameters.Clear();
                    //CrystalRepSource.ReportDocument.Close();
                    //CrystalRepSource.ReportDocument.Dispose();
                    CrystalRepSource.Dispose();
                    CrystalViewer.Dispose();
                    GC.Collect();
            catch { }
    I experimented with various bits in the page unload as you can see I have commented a bit out at present as it was throwing an exception. The SetParametersValue while handy (will clean the code up a bit) didn't make any difference I am still getting the same issue.

  • Crystal Report 10 and Visual Basic 6 - logon failed in crystal report viewe

    Guyz,.
    Report viewer is showing logon failed, pelase help me, i can able to view the data from rs1(recorset).
    please hellp me to fix this issue, i need to pass the sql query to my pre designed Crystal report which has all the field as same as SQL query.
    Please suggest me if any other alternate way to do this , my code is below.
    Environment : Crystal Report 10, Visual Basic 6
    cr_preview -> CrystalActiveXReportViewer
    RepName  -> Fiename and path of the Crystal report is designed from Crystal Report Designer.
    Function show_rep(Sql As String, RepName As String)
    Dim crystal As CRAXDRT.Application
    Dim report As New CRAXDRT.report
    Dim rs1 As New ADODB.Recordset
        If rs1.State Then rs1.Close
        rs1.Open Sql, cn, adOpenStatic, adLockReadOnly
        Set crystal = New CRAXDRT.Application
        Set report = crystal.OpenReport(RepName)
        report.DiscardSavedData
        report.Database.SetDataSource rs1
        'cr_preview.Refresh
        cr_preview.ReportSource = report
        cr_preview.Visible = True
        cr_preview.ViewReport
        Do While cr_preview.IsBusy
            DoEvents
        Loop
        cr_preview.Zoom 100
        If rs1.State Then rs1.Close
        Set rs1 = Nothing
    Set crystal = Nothing
    Set report = Nothing
    End Function

    Hi,
    Please refer to the link for the list of example, [click here|http://pscode.com/vb/scripts/BrowseCategoryOrSearchResults.asp?optSort=Alphabetical&lngWId=1&B1=QuickSearch&txtCriteria=crystalreport+10&blnWorldDropDownUsed=TRUE&txtMaxNumberOfEntriesPerPage=10&blnResetAllVariables=TRUE]
    Regards,
    Clint

  • How to display the print dialogbox in crystal reports viewer for visualstudio 2013 in wpf?

    Hi,
    In my wpf application when i click on print button i want to display the print dialog box for current report.
    Here i have written like as follows.
    1.MyCrystalReportsViewer.ViewerCore.ReportSource = reportDocument;
    2. MyCrystalReportsViewer.ViewerCore.PrintReport();
    The above two statements  is executed and displayed the report in CrystalReportViewer, but it doesn't show any print dialogbox.
    MyCrystalReportsViewer is name of the CrystalReportsVIewer control.
    Can any one help me to solve this one using code.

    Hi Sandeep,
    Did you download CR for VS SP 13 from this link?
    http://scn.sap.com/docs/DOC-7824
    First link is to integrate CR into VS.
    If you did then I suggest you do a Repair on both VS and CR for VS.
    Also, VS must be Pro or higher, CR will not work in VS 2013 Express.
    Do you have printers installed? Do not use Windows XPS printer, it has problems.
    Don

  • Crystal Report Viewer integration with Sharepoint 2010

    We had a requirement in our project to view crystal report off an hyper link embedded into sharepoint web part developed using ASP .NET. The report accepted few parameters from the sharepoint page and passed those on to the SQL server to retrive data and
    display the data in the report. The challenge was to open the report in the web browser.
    The first difficulty was to find the right control to use, the report viewer tool that comes with Visual Studio 2010 is not the right one to use to view Crystal reports, I realised this after spending half a day trying to figure out why wouldn't the report
    load. I then downloaded the Crystal Report Viewer for VS 2010 Standard from http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp. After you install this, you get the crystal report viewer in your toolbar. All you have to do is drag and drop it on
    to the web part and configure it to use your report. If any one needs help with this let me know I will show how to do that.
    So far so good. The biggest challenge was to deploy this on to the production server which took better part of 3 days to figure out how its done. If you deploy the WSP file as it is expecting that the crystal DLLs would be embedded in it then be ready to
    expect a rude shock because it isn't. Here are the steps -
    1. Deploy the WSP to the sharepoint server
    2. Install the crystal dlls used in the project (CrystalDecisions.CrystalReports.Engine.dll, CrystalDecisions.ReportSource.dll, CrystalDecisions.Shared.dll, CrystalDecisions.Web.dll) into the GAC using GacUtil command
    3. Add following entries to Web.Config file (C:\inetpub\wwwroot\wss\VirtualDirectories\80\web.congif)
        <SafeControl Assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.CrystalReports.Engine" TypeName="*" Safe="True" SafeAgainstScript="False"
    />
          <SafeControl Assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.ReportSource" TypeName="*" Safe="True" SafeAgainstScript="False" />
          <SafeControl Assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Shared" TypeName="*" Safe="True" SafeAgainstScript="False" />
          <SafeControl Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" Namespace="CrystalDecisions.Web" TypeName="*" Safe="True" SafeAgainstScript="False" />
    4. Install crystal redistributable package which can be downloaded from http://www.businessobjects.com/jump/xi/crvs2010/us2_default.asp (
    SAP Crystal Reports runtime engine for .NET Framework 4 (64-bit))
    5. Copy aspnet_client folder from C:\>inetpub\wwwroot and overwrite it on C:\>inetpub\wwwroot\wss\VirtualDirectories\80
    And we are done. Fingers crossed it should all work.
    Prasad Matkar MCP, MCTS

    Hi Mahesh,
    How are you loading the report in your webpart? This is what I have done. I have tried to explain what I am doing in the program comments. Hope this helps. Good luck.
                    SPSite mySite = new SPSite(SPContext.Current.Site.Url.ToString());
                    SPWeb thisSite = mySite.OpenWeb();
                    // Writing to event log after every step in debug mode so that you get to know if there was a failure what step the failure occured after.
                    EventLog.WriteEntry("Reports", "Inside PAge Load ", EventLogEntryType.Error);
                    SPFolder folder = thisSite.GetFolder("Reports");
                    if (folder.Exists)
                        // get collection of Crystal Reports rpt files in the document library
                        SPFileCollection files = folder.Files;
                        // open the rpt file and get the contents
                        SPFile srcfile = files[reportToLaunch];
                        byte[] content = srcfile.OpenBinary();
                        // make a temporary folder
                        DirectoryInfo dir2 = new DirectoryInfo("~/temp");
                        if (!dir2.Exists)
                            dir2.Create();
                        if (File.Exists("~/temp/temp.rpt"))
                            File.Delete("~/temp/temp.rpt");
                        // write the report definition to a temporary file
                        // EventLog.WriteEntry("Reports", "Before Creating temp report ", EventLogEntryType.Error);
                        //EventLog.WriteEntry("Reports", "Before Create ", EventLogEntryType.Error);
                        BinaryWriter bw =
                          new BinaryWriter(File.Open("~/temp/temp.rpt", FileMode.Create));
                        bw.Write(content);
                        bw.Close();
                      //  EventLog.WriteEntry("Reports", "After Create ", EventLogEntryType.Error);
                        // set up the crystal report
                        ReportDocument reportDoc = new ReportDocument();
                        reportDoc.Load("~/temp/temp.rpt");
                        EventLog.WriteEntry("Reports", "after report load ", EventLogEntryType.Error);
                        ConnectionInfo connection = new ConnectionInfo();
                        connection.ServerName = "SQLServerName";
                        connection.DatabaseName = "SQLDatabase";
                        connection.UserID = "sqluser";
                        connection.Password = "sqlpassword";
                        TableLogOnInfo logon = new TableLogOnInfo();
                        logon.ConnectionInfo = connection;
                        reportDoc.SetParameterValue("@Parameter1", parameter1);
                        reportDoc.SetParameterValue("@Parameter2", parameter2);                                               
                        EventLog.WriteEntry("Reports", "after assigning parameters ", EventLogEntryType.Error);
                       foreach (CrystalDecisions.CrystalReports.Engine.Table t in reportDoc.Database.Tables)
                            t.ApplyLogOnInfo(logon);
                        EventLog.WriteEntry("Reports", "after applying login info ", EventLogEntryType.Error);
                        // and the Crystal report Viewer                                    
                        CrystalReportViewer1.ReportSource = reportDoc;
                        EventLog.WriteEntry("Reports", "Before delete ", EventLogEntryType.Error);
                        // clean up
                        File.Delete("~/temp/temp.rpt");
                        EventLog.WriteEntry("Reports", "after delete ", EventLogEntryType.Error);
    Prasad Matkar MCP, MCTS

  • Print crystal report viewer in visual studio 2005

    please help me.i installed visual studio2005 with web crystal report viewer.i create web site and installed that on windows server 2003 sp1 and iis7. user in etwork connect to server on remote desktop and execute web site. in my project user print resume . for doing that: i used stored procedure for getting information and pass to report document and it shows in crystal report viewer. for doing that i used printtoprinter(1,false,1,1)
    it shows correct but it shows this error :operation completed successfully and can not print. all printers are shared and all of them are hp 1018.
    this program print correct on my standalone system with printer hp deskjet 1220c.
    please help me.i spent a lot of time and i could not solve that.please please please help me.

    Please re-post if this is still an issue to the .NET Development - Crystal Reports Forum or purchase a case and have a dedicated support engineer work with you directly

  • Crystal Report Viewer fails for browser versions =10

    We're using the Crystal Reports for VS2010 SP2 and get the following error when trying to generate a report in Firefox 10.0.2 and Chrome 18.0.1025.11 beta-m:
    [NullReferenceException: Object reference not set to an instance of an object.]
       CrystalDecisions.Web.ViewerGlobal.get_IsNetscape6Up() +88
       CrystalDecisions.Web.CrystalReportViewer.Render(HtmlTextWriter output) +83
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
       System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173
       System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
       System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378
       System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
       ASP.app_filters_reportviewer_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\qfmui\10eb2bd5\d0d0d3a5\App_Web_e2fg2prg.2.cs:0
       System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109
       System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
       System.Web.UI.Page.Render(HtmlTextWriter writer) +29
       System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8991378
       System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060
    If I change the user agent string in Firefox to that of Firefox 7.0.1 everything works as expected, this implies there is some logic in get_IsNetscape6Up() which is failing because the major browser version as reported by the user agent string is two digits instead of one.
    We encountered a similar issue for our legacy pages containing Infragistics 2007 controls but were able to fix that by overriding the System.Web.Configuration.HttpCapabilitiesBase.BrowserCapabilitiesProvider and faking the browser version to 9.80.  Crystal Report Viewer is apparently not using .Net's built in HttpBrowserCapabilities object, is there anything else I can adjust to stop the viewer failing?

    hello Robert
    Today must be my day. I already got a reply from PM (normally it takes a "bit" longer...). Anyhow, here is what he said:
    With Firefoxu2019s release cycles, I donu2019t think weu2019ll be able to officially support the latest versions
    of Firefox at every service release.  We do our best to test the released versions of Firefox
    that align with our releases.  I donu2019t know the details but Iu2019ve heard there is a plan in place where
    the support team(s) (?) will test the most recent releases of Firefox with whatu2019s currently
    shipping by SAP and log bugs as necessary.
    (umm, this is my - Ludek note here ) -> news to me re. support doing QA... find out something new every day. Anyhow, continuation of the message from PM:
    The current plan for CR for VS2010, the SP3 release (expected in April) will support up to
    Firefox 9.  If there are reproducible bugs in Firefox 10 (or higher), then please enter a bug
    and escalate and it will be investigated for the next available release.
    I'll revisit this once SP3 is out there and do an escalation for Firefox 10 - ok?
    - Ludek

  • Crystal Report Viewer Credential Prompt for Report with Dynamic Parameters

    The .NET Crystal Report Viewer is prompting for database credentials when launching a report containing dynamic parameters. This only occurs for reports created with SAP Crystal Reports 2011 designer. Reports created with Crystal Reports XI designer (where dynamic parameters were first introduced) work correctly.
    The credential prompt window contains the following fields:
    - Server Name: <server name> (disabled)
    - Database Name: <database name> (disabled)
    - User Name: <empty> (enabled)
    - Password: <empty> (enabled)
    - Use Single Signon Key: false (disabled)
    The values in the prompt window which are disabled are the database connection values used during the design of the report in the SAP Crystal Reports 2011 designer.
    Expected Result:
    - No prompt for database credentials.
    - Values read from the database should be populated in a drop down for the dynamic parameters.
    Environment:
    - Visual Studio 2010 (C#)
    - Windows 7 Enterprise
    - SAP Crystal Reports runtime engine for .NET Framework 4
    - SAP Crystal Reports, version for Visual Studio 2010
    - SAP Crystal Reports 2011
    The database connection is being set to use a DSN. It must be a DSN as the calling application is only aware of the DSN/Username/Password values. These values are being passed to the Crystal Report Viewer contained in a Windows form.
    The database connection for the report is being set as follows:
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection otherwise the connection does not work
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Supposed to set the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    The SetConnection method's signature is as follows:
       SetConnection(string server, string database, string name, string password)
    As you can see from the code snippet above I am setting the DSN name as the server parameter, blank for the database parameter (a database connection using DSN should only require DSN name/Username/Password) and the database username and password respectively.
    Is this a SAP bug?
    Is this the correct way of setting the database connection to use a DSN?
    Is there some other properties that need to be set somewhere else in the report through code?
    Any help would be greatly appreciated.

    Thanks for the pointer to the database connection code generator. After taking a look at the output from the tool I was able to finally get the dynamic parameters to load and populate properly without prompting for credentials. I needed to tweak the outputted code a bit to match my requirements of using a DSN only connection.
    Instead of updating the database connection properties contained within the Report.Database.Tables collection from the CrystalReports.Engine namespace, I changed it to replace the database connection properties in the Report.ReportClientDocument.DatabaseController.Database.Tables collection from the CrystalDecisions.ReportAppServer.DataDefModel namespace. For one reason or another, using the RAS namespace solved the problem.
    Below is the updated code with the change made:
    using RAPTable = CrystalDecisions.ReportAppServer.DataDefModel.Table;
    foreach (InternalConnectionInfo internalConnectionInfo in this.report.DataSourceConnections)
        // Must set the UseDSNProperties flag to True before setting the database connection
        if (internalConnectionInfo.LogonProperties.ContainsKey("UseDSNProperties"))
            internalConnectionInfo.LogonProperties.Set("UseDSNProperties", true);
        // Sets the database connection for all objects in the report (ie. main report, tables, sub reports)
        internalConnectionInfo.SetConnection(this.DSN, string.Empty, this.LoginName, this.Password);
    // The attributes for the QE_LogonProperties which is part of the main property bag
    PropertyBag innerPropertyBag = new PropertyBag();
    innerPropertyBag.Add("DSN", this.DSN);
    innerPropertyBag.Add("UserID", this.LoginName);
    innerPropertyBag.Add("Password", this.Password);
    innerPropertyBag.Add("UseDSNProperties", "true");
    // The attributes collection of the tables ConnectionInfo object
    PropertyBag mainPropertyBag = new PropertyBag();
    mainPropertyBag.Add("Database DLL", "crdb_ado.dll");
    mainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)");
    mainPropertyBag.Add("QE_LogonProperties", innerPropertyBag);
    // Pass the database properties to a connection info object
    ConnectionInfo connectionInfo = new ConnectionInfo();
    connectionInfo.Attributes = mainPropertyBag;
    connectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
    connectionInfo.UserName = this.LoginName;
    connectionInfo.Password = this.Password;
    // Replace the database connection properties of each table in the report
    foreach (RAPTable oldTable in this.report.ReportClientDocument.DatabaseController.Database.Tables)
        RAPTable table = new RAPTable();
        table.ConnectionInfo = connectionInfo;
        table.Name = oldTable.Name;
        table.QualifiedName = oldTable.QualifiedName;
        table.Alias = oldTable.Alias;
        this.report.ReportClientDocument.DatabaseController.SetTableLocation(oldTable, table);
    this.report.VerifyDatabase();
    Thanks again Ludek for the help.

  • Crystal Reports Viewer 11.5 fails in Vista

    We are using the Crystal Reports Viewer (crviewer.dll) version 11.5.10.1263. It works fine in XP but fails with the following error in Vista:
    A first chance exception of type 'System.AccessViolationException' occurred in sprdlgs2.dll
    An unhandled exception of type 'System.AccessViolationException' occurred in sprdlgs2.dll
    Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
    Sprdlgs2.dll is the DLL that contains the dialog in which the viewer resides. I know that crviewer.dll is registered correctly.
    Our product is a C++ MFC multi-document application migrated from Visual Studio 6.0 to the .NET Framework 2.0 with the managed code flag (/clr) on.
    Any help would be appreciated.

    Hi Peter,
    As Jason indicated the RDC has not been tested with Vista nor any version of .NET IDE. RDC is COM and Microsoft is moving away from COM and to their Framework which as you said you must also do as we must. Even though MS upgrades their OS's we can't follow for old technolgies, it just becomes too much coding and vertually becomes a new version of CR with the amount of work required. To move CR forward we try to release patches for the current versions that are 100% backward compatable with the current OS's. XI R2 with SP2 now supports Vista through a service patch.
    The RDC has not been updated since Version 9 at that time Windows XP and 2000 were the only OS's available and they fully supported COM. It simply becomes to costly to make everything backward compatable. For developers like yourself you can appriciate this, do you still support Windows 3.1? At some point everyone has to cut off backward compatablity.
    Moving forward because .NET 2008 is also new, even XI R2 has problems with it, this is due to MS updating their 1.1 Framework to 2.0 and 3.5. they changed things which we had specific dependencies on so now we have to also change, this all takes time to implement.
    So this becomes a "best effort support" case since you are doing this on an unsupported platform. I did not see any results of your testing in debug mode on Vista? Install .NET 2008 on a Vista 32 PC and run your app in debug mode, if you use Vista 64 set your compiler to use x86 only. I believe your dll's are wrappers around the crviewer.dll and is likely either a permission issue with our COM(ActiveX) dll's or your dll's. Using regedt32.exe will give you the ability also to change permissions on the viewer and possibly your dll. It may be that Windows is not allowing your exe to access your wrapper as the error suggests in your original post.
    Bottom line is, you should upgrade your app to use the .NET assemblies and stop using the RDC. There are lots of samples and fairly easy to migrate what your RDC app is doing to .NET code. Coding won't be one to one but the steps to execute a report and view are the same.
    Thanks again
    Don

  • How to set printersettings for the crystal report viewer in SAP BI dynamically

    Hello
    I have set the URL method for my crystal report and with parameter passing as shown below, it was displaying the crystal report viewer by connecting to the SAP BI 4.0 server with this method.
    http://cr:port/businessobjects/enterprise115/desktoplaunch/opendoc/openDocument.jsp?sDocName=CRLabelParam&sType=rpt&lsSnPrinted=0&lsSsTestProjectNr=1
    This URL will be called from Web application by different users, i would like to set the printer settings differently for different users for this crystal report viewer how shall i need to set the printer options?
    shall i need to set the printer settings programatically for each user. Please advise me how do i need to proceed.
    Thanks & Regards,
    Rajeswari.

    There are no BI / CR APIs that would do this for you. The way I see it, you'll have to have your own print button and populate it with the correct printer information for each user as they request the report. Of course, alternatively, use the viewer printer button and get the users to choose the correct printer.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Problem showing the crystal report viewer in form after added the component on it

    Greetings
    I have a problem running a program. I created a form which I added the component Crystal Report Viewer perfecty but during program execution when I call that form my VS 2012 Ultimate show the following error:
    Translated:
    Failed to create the form. See Exception.InnerException for details. Error: An exception occurred in the type initializer for 'CrystalDecisions.Shared.SharedUtils'.
    Note: If I remove the component from the form. the applications runs fine when calling the form without the component CrystalReportViewer
    It is something related to my VS? o just that the actual version 13.0.9 is not yet compatible?

    Report.Show?
    How about you try:
    CrystalReportViewer1.ReportSource = <path to your report>
    Or:
    Dim crReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    crReportDocument.Load(<path to your report>)
    CrystalReportViewer1.ReportSource = crReportDocument
    Or, if the report is added to the project:
    crReportDocument = New test
    CrystalReportViewer1.ReportSource = crReportDocument
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter
    Message was edited by: Ludek Uher

  • Crystal Reports Viewer Control  - Visual Studio 2008 WEB Application

    My question is this:  Has ANYONE on this planet been able to get the ASP .NET CR Viewer control to actually work?
    Why does this editor NOT recognize End-of-line or CR characters or any whitespace??
    I have developed a Crystal Reports "Viewer" web application in VS2008 using C#.
    It's a simple app, in that it's a single page with a treeview control (containing the grouped names of the reports to which the user has access) and the CR Viewer control.
    The report files live on a network share, and permissions to them is controlled via a SQL Server database, which, for each report, stores the UserID and Logion for the oracle database, as well as any required parameter values.
    The reports themselves are all hititng an Oracle 10g database.
    I managed to do this in a Windows desktop applcation using Visual Studio 2005 and VB .net, but now, upon trying to make this a web application in VS2008, I have completely failed. The application works when run locally, but when deployed to the web server, I experience database login prompts when I should not, (the dreaded "Report requires further information" message) even thought the setdatabaselogin has already been set. I have tried saving the reportdocument in viewstate and re-assigning the viewer Datasource property to it, that also fails. However, it only does it on some reports, and not others. (admittedly, the reports may have been created using different CR versions)
    The viewer also displays data it should not be displaying when I attempt to scroll, when I do manage to get a report to run.
    I am setting parameters dynamically at run time, whose values are stored in the SQL database.
    Code Sample:
    protected void ShowReport(int ReportID)
            SQLDataPortal2005.Common sql = new SQLDataPortal2005.Common();
            Hashtable outParms = new Hashtable();
            string sAccess;
            IDataReader dr;
            CrystalDecisions.CrystalReports.Engine.ReportDocument rptDocument = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal;
            sAccess = p.Identity.Name;
            int j = 0;
            int i = -1;
            if (!IsAdmin())
                sql.ExecNonQuery("CrystalReports", outParms, "proc_CRM_Check_Permissions", sAccess, Convert.ToInt32(TreeView1.SelectedNode.Value));
                if (outParms["@Allow"].ToString() != "True")
                   Response.Redirect("ErrorPage.aspx");  // redirect to  error page
            string sPath = System.Configuration.ConfigurationManager.AppSettings["WareHouse"].ToString();
            sPath = sPath + TreeView1.SelectedNode.Text.Trim() + ".rpt";      
            rptDocument.Load(sPath);
            dr = sql.GetDataReader("CrystalReports", "proc_CRM_Get_Report", Convert.ToInt32(TreeView1.SelectedNode.Value));
            while (dr.Read() == true)
                j += 1;
                if (j < 2)
                    rptDocument.SetDatabaseLogon(dr["DB_Login"].ToString(), dr["DB_Pwd"].ToString(), "PLAW", "LAWDB", true);
                    pList = dr["ParmList"].ToString().Split(',');
            dr.Close();
            dr.Dispose();
            if (pList.Length > 0 && pList[0].ToString().Trim() != "")
                foreach (CrystalDecisions.Shared.ParameterField x in rptDocument.ParameterFields)
                    i++;
                    switch (x.ParameterValueType)
                        case CrystalDecisions.Shared.ParameterValueKind.BooleanParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToBoolean(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.CurrencyParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToDouble(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.DateParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToDateTime(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.DateTimeParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToDateTime(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.NumberParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToInt32(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.StringParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToString(pList<i>));
                            break;
                        case CrystalDecisions.Shared.ParameterValueKind.TimeParameter:
                            rptDocument.SetParameterValue(x.Name, Convert.ToDateTime(pList<i>));
                            break;
            Session["CReport"] = rptDocument;
            CRV1.ReportSource = rptDocument;
            CRV1.DisplayGroupTree = false;
            CRV1.HasRefreshButton = true;
            CRV1.ShowFirstPage();
    Is there a better/different way of accomplishing this very simply process? All I need this application to do is to view a report, while setting it's parmeters (if required) dynamically at run time. I don't EVER want the user to be prompted for DB LOGIN INFO.
    Edited by: RichardK on May 10, 2010 4:14 PM
    Edited by: RichardK on May 10, 2010 4:14 PM
    Edited by: RichardK on May 10, 2010 4:16 PM
    Edited by: RichardK on May 10, 2010 4:18 PM
    Edited by: RichardK on May 10, 2010 4:22 PM
    Edited by: RichardK on May 10, 2010 4:23 PM

    To answer you question; Yes, I suspect that most of the users in this community have managed to successfully create web apps. And this is the tiniest of sampling of the developers out there...
    A few suggestions;
    1) Keep the posts to under 1200 characters. Otherwise, the formatting is lost which makes it difficult to read.
    2) Try out a few sample apps from here:
    https://wiki.sdn.sap.com/wiki/display/BOBJ/CrystalReportsfor.NETSDK+Samples
    Suggest; csharp_web_simplelogonengine.zip, csharp_web_simplelogonviewer.zip and csharp_web_subreport_logon.zip.
    3) Start simple; one table, one field, no subreports. Hard code the database logon parameters. Convince your self that this does work. Increase the complexity - add fields, tables, subreports. Do not mix connection methods (e.g.; if ODBC for main, than ODBC for sub is a good idea, though not a requirement).
    4) See the article [Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b0225775-88c4-2c10-bd80-8298769293de].
    5) See  [this|http://www.sdn.sap.com/irj/boc/go/portal/prtroot/docs/library/uuid/d05b3bb7-0f28-2c10-4ea3-84dbdc4e414e?quicklink=index&overridelayout=true] article.
    6) Consider creating a phone case here:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300
    Ludek
    Follow us on Twitter
    http://twitter.com/SAPCRNetSup

Maybe you are looking for