[Crystal Report 13.0.2000.0 & VB 2010] - Database connection from VB Code

Hi,
i want establish a connection between report and MsAccess database using source code in VB .NET 2010 listed below:
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim crtableLogoninfos As New TableLogOnInfos()
        Dim crtableLogoninfo As New TableLogOnInfo()
        Dim crConnectionInfo As New ConnectionInfo()
        Dim CrTables As Tables
        Dim CrTable As Table
        Dim crReportDocument As New CrystalReport()
        With crConnectionInfo
            .ServerName = "c:\db.mdb"
            .DatabaseName = "db.mdb"
            .UserID = ""
            .Password = ""
        End With
        CrTables = crReportDocument.Database.Tables
        For Each CrTable In CrTables
            crtableLogoninfo = CrTable.LogOnInfo
            crtableLogoninfo.ConnectionInfo = crConnectionInfo
            CrTable.ApplyLogOnInfo(crtableLogoninfo)
            CrTable.Location = crConnectionInfo.DatabaseName
        Next
        CrystalReportViewer1.ReportSource = crReportDocument
    End Sub
End Class
This code work fine but the database connection parameters prompt every time on runtime!
HELP ME!

Hello,
I used our sample Xtreme.mdb to test this and it works for me. I am using RAS to make the connection though.
Here's the code on how:
Public Function ChangeConnectionInfo() as ReportDocument
Dim boReportDocument as New ReportDocument
'**EDIT** Change the path and report name to the report you want to change.
boReportDocument.Load("c:\reports\yourreport.rpt", OpenReportMethod.OpenReportByTempCopy)
'Create a new Database Table to replace the reports current table.
Dim boTable As New CrystalDecisions.ReportAppServer.DataDefModel.Table
'boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
Dim boMainPropertyBag As New PropertyBag
'boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
'In the main property bag (boMainPropertyBag)
Dim boInnerPropertyBag As New PropertyBag
'Set the attributes for the boInnerPropertyBag
boInnerPropertyBag.Add("Data Source", "C:\xtreme.mdb")
boInnerPropertyBag.Add("Database Type", "Access")
boInnerPropertyBag.Add("Locale Identifier", "1033")
boInnerPropertyBag.Add("OLE DB Services", "-6")
boInnerPropertyBag.Add("Provider", "Microsoft.Jet.OLEDB.4.0")
boInnerPropertyBag.Add("Use DSN Default Properties", "False")
'Set the attributes for the boMainPropertyBag
boMainPropertyBag.Add("Database DLL", "crdb_ado.dll")
boMainPropertyBag.Add("QE_DatabaseName", "")
boMainPropertyBag.Add("QE_DatabaseType", "OLE DB (ADO)")
'Add the QE_LogonProperties we set in the boInnerPropertyBag Object
boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag)
boMainPropertyBag.Add("QE_ServerDescription", "C:\xtreme.mdb")
boMainPropertyBag.Add("QE_SQLDB", "True")
boMainPropertyBag.Add("SSO Enabled", "False")
'Create a new ConnectionInfo object
Dim boConnectionInfo As New CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo
'Pass the database properties to a connection info object
boConnectionInfo.Attributes = boMainPropertyBag
'Set the connection kind
boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE
'**EDIT** Set the User Name and Password if required.
boConnectionInfo.UserName = "UserName"
boConnectionInfo.Password = "Password"
'Pass the connection information to the table
boTable.ConnectionInfo = boConnectionInfo
'Get the Database Tables Collection for your report
Dim boTables As CrystalDecisions.ReportAppServer.DataDefModel.Tables = _
boReportDocument.ReportClientDocument.DatabaseController.Database.Tables
'For each table in the report:
' - Set the Table Name properties.
' - Set the table location in the report to use the new modified table
boTable.Name = "Credit"
boTable.QualifiedName = "Credit"
boTable.Alias = "Credit"
boReportDocument.ReportClientDocument.DatabaseController.SetTableLocation(boTables(0), boTable)
'Verify the database after adding substituting the new table.
'To ensure that the table updates properly when adding Command tables or Stored Procedures.
boReportDocument.VerifyDatabase()
Return boReportDocument
End Function
Thank you
Don

Similar Messages

  • How to get total number of Database connections from Java code

    Hi,
    I am using Myql4.1.12.
    I am conncting to mysql through Java.
    I want to know how many active database connections were running at a specific time. Is it possible?
    Can you please help me.
    Thanks in advance.

    Seems like this would be a question for MySql, not for Java. And if it's possible you'd run some MySql utility to do that, not code it in a Java app.

  • How to create crystal reports using MSDE 2000?

    Post Author: S_Muhilan
    CA Forum: Deployment
    Hi,
    I am using Crystal report 8.5. My Database sqlserver 2000. I generated reports and are working fine.
    Now I want to use MSDE 2000 instead of Sqlserver 2000 due to license factor.
    My application is developed in VB 6. The all the parts of the application is working fine except the report.
    All reports produced Database DLL error.
    So I opened the report and try to verify the database. But it gives pdssql.dll not found. Database error.
    After this error, I tried to create a new report and found that there is no option for MSDE 2000 database selection under more database.
    I usually select Sql server 2000 database under More Database option of location wizard.
    How to create crystal reports using MSDE 2000?
    Is it due to crystal report 8.5 verison problem? I also have crystal report 11 licensed copy.
    Please give me the good solution as early as possible
    RegardsS. Muhilan

    To use the inproc RAS SDK with CR.NET, you'd have to purchase either (1) Crystal Reports XI Release 2 Developer edition, and apply Service Pack 2 or above, or (2) Crystal Reports 2008 (not Crystal Reports Basic that comes with Visual Studio 2008).
    Sincerely,
    Ted Ueda

  • How to tell that Crystal Report 13.0 for VS 2010 installed on target mach

    Hi,
    I developed Windows application that has Crystal Report functionality.
    The final step is distribution application development.
    I am using Install Shield 2011 to build Basic MSI project. 
    What is the best registry key value I can use to identify the right version of Crystal Report redistributable has been already installed on target machine?
    I think I am going to use one of the key values that located under HKEY_CLASSES_ROOT\CrystalReports13.
    But which one?
    Also where can I get the minimum requirements when it comes to windows operating systems that supports Crystall Report 13.0 redistributable?
    Thank you.

    I installed CRRuntime_32bit_13.msi on Windows XP SP 3 machine, which is my testing production machine.
    1. Under Add and Remove programs there is only one entry
    -SAP Crystal Reports runtime engine for .NET Framework 4(32-bit)
    -SAP Crystal Reports, version for Visual Studio 2010 has not been installed because I think there is no Visual Studio 2010 installed on the target machine.
    2. During the installation registry keys have been created
    HKLM\SOFTWARE\SAP Business Objects\Crystal Reports for .NET Framework 4.0
    These key has another 9 sub keys I am not going to list here.
    3. After I manually uninstall runtime all registry keys have been deleted except:
    HKLM\SOFTWARE\SAP Business Objects\Crystal Reports for .NET Framework 4.0\Report Application Server
    All assemblies from GAC have been uninstalled
    win32_x86 folder has been uninstalled from
    C:\Program Files\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0
    I hope this info will help to safe your development time.
    Happy programming

  • Crystal Reports, version for Visual Studio 2010 Problem

    Dear all,
    I encounter a problem after installed the crystal report version for Visual Studio 2010. Once I call                              
                           ReportDocument.PrintToPrinter(1,False, 0, 0)
    The error message prompt:
    Report is unavailable(Index was out of range. Must be non-negative and less than the size of the collection. Parameter name:index)
    If I try
                             ReportDocument.PrintToPrinter(1,False, 1, 1)
    It can print the 1st page of the report.
    I also try to create a simple report. It works.
    After installed this version, my reports also encounter the same problem in Visual Studio 2008.
    My report has sub-reports. My PC is Windows XP.
    Anybody has idea on this issue!?

    Now you can set the various printer options using the PrintOutputController. I'm using a UI box to select the printer but your developer should be able to figure this out. If not you can include him in the e-mail, it would be fine to go direct. Of course you will stay in the thread:
         private void btnSetPrinter_Click(object sender, System.EventArgs e)
              System.Drawing.Printing.PrintDocument pDoc = new System.Drawing.Printing.PrintDocument();
                CrystalDecisions.ReportAppServer.Controllers.PrintReportOptions rasPROpts = new CrystalDecisions.ReportAppServer.Controllers.PrintReportOptionsClass();
              // Use the next line if you need to, you'll ahve to test. Depends on how the reports were saved.
                //CrystalDecisions.CrystalReports.Engine.PrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                //CrystalDecisions.ReportAppServer.ReportDefModel.ISCRPrintOptions.DissociatePageSizeAndPrinterPaperSize = true;
                //pDoc.DefaultPageSettings = pgSettings;
                PrintDialog dlg = new PrintDialog();
                dlg.Document = pDoc;
                if (dlg.ShowDialog() == DialogResult.Cancel)
                    MessageBox.Show("Cancel Button clicked", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                else
                    CrystalDecisions.ReportAppServer.ReportDefModel.PrintOptions MYPRTOpts = new PrintOptionsClass();
                    if (rdoCurrent.Checked)
                        pDoc.PrinterSettings.PrinterName = cboCurrentPrinters.Text;
                   // the next 3 lines may not be necessary.
                        MYPRTOpts.PrinterName = cboCurrentPrinters.Text;
                        MYPRTOpts.PaperSize = (CrPaperSizeEnum)
                            pDoc.PrinterSettings.PaperSizes[cboCurrentPaperSizes.SelectedIndex].Kind;
                        MYPRTOpts.PaperSource = (CrPaperSourceEnum)
                            pDoc.PrinterSettings.PaperSources[cboCurrentPaperTrays.SelectedIndex].Kind;
                        MYPRTOpts.PaperOrientation = CrPaperOrientationEnum.crPaperOrientationLandscape;
                        //MYPRTOpts.PageMargins.Bottom = .1;
                        //MYPRTOpts.PageMargins.Top = .1;
                        //MYPRTOpts.PageMargins.Left = .1;
                        //MYPRTOpts.PageMargins.Right = .1;
                    else
                        pDoc.PrinterSettings.PrinterName = cboDefaultPrinters.Text;
                        MYPRTOpts.PrinterName = cboDefaultPrinters.Text;
                        MYPRTOpts.PaperSize = (CrPaperSizeEnum)
                            pDoc.PrinterSettings.PaperSizes[cboDefaultPaperSizes.SelectedIndex].Kind;
                        MYPRTOpts.PaperSource = (CrPaperSourceEnum)
                            pDoc.PrinterSettings.PaperSources[cboDefaultPaperTrays.SelectedIndex].Kind;
                    rptClientDoc.PrintOutputController.ModifyPrintOptions(MYPRTOpts);
                    //MessageBox.Show("Printer set.", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    rptClientDoc.PrintOutputController.PrintReport(rasPROpts);
                    //MessageBox.Show("Printing report.", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
    Thank you
    Don

  • Error While creating new database connection from HFM workspace

    Hi,
    We have recently installed HFM and was trying to create database connection from database connection manager in HFM workspace.
    I am getting below error:
    "Error connecting to database connection : no HssJNIDriver950 in java.library.path" initially and later
    "Error connecting to database connection : com/hyperion/ap/adm/HssConn".
    Any information in this direction would helpful.
    Thanks,
    Bhargav
    Edited by: bhargavr on Jan 24, 2011 6:55 PM

    Hi bhargavr,
    We came accross the same issue. Try the following solution below for this 'KNOWN ISSUE' and let me know how you get on. Drop me a note if you have any questions regarding this post.
    Error: *"Error connecting to database connection: com/hyperion/ap/adm/HssConn" While Creating a Financial Management Database Connection* [ID 1102697.1]
    Modified 04-JAN-2011 Type PROBLEM Status PUBLISHED
    Applies to:
    Hyperion BI+ - Version: 11.1.2.0.00 and later [Release: 11.1 and later ]
    Microsoft Windows x64 (64-bit)
    Symptoms:
    You are running the Financial Reporting Web Server on a 64-bit server.
    When you try to create a new Financial Management (HFM) database connection using the Database Connection Manager in Workspace you receive the following message:
    “Error connecting to database connection <connection_name>: com/hyperion/ap/adm/HssConn”
    You can create a database connection in Financial Reporting Studio. When you refresh a report with a Financial Management database connection, you receive one of the following messages:
    “1001: Error connecting to database connection <DATABASE_CONNECTION_NAME>: com/hyperion/ap/adm/HssConn”
    or
    “1001: Error connecting to database connection <DATABASE_CONNECTION_NAME>: no HssJNIDriver950 in java.library.path”
    Cause:
    The issue is documented in unpublished bug 9537050, and in Known Issues in the 11.1.2 Reporting and Analysis Readme. Cross-reference unpublished bug 9707353.
    Solution:
    In the Windows registry, take the following steps:
    Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\HyperionSolutions\FinancialReporting0\HyS9FRReports.
    For each of the following entries, prefix the contents with text in the blue box: Env2, JVMOption13, and JVMOption17 (note that the JVMOption numbers might be slightly different in your environment).
    C:\Oracle\Middleware\EPMSystem11R1\common\ADM\11.1.2.0\bin-64
    If your EPM_ORACLE_HOME is not located at C:\Oracle\Middleware\EPMSystem11R1, replace that location with your location.
    Restart the server.
    G'Luck,
    -David

  • Steps to change universe database connection from SQL server to Oracle 10

    Hi,
    we are moving from sql server to Oracle 10.Please let me know the steps and various parameters I should consider while changing universe database connection from SQL server to Oracle 10.
    Following are the steps which I assumed :
    1.     create a new Oracle database connection or edit the existing connection to point to Oracle server
    2.     Need to check sql for each object, having integrity check for universe will solve the purpose of parsing each object
    3.     Exporting the universe after integrity check
    4.     Report data testing
    Let me know if I miss on any steps.Also what all factors I need to consider while moving to Oracle for eg: what @ custom sql,what @ table names,what @ LOV etc.
    Kindly reply

    Thanks Abhijeet and Shreyash,
    I will follow the steps you have suggested.
    Actually I was searching for this on net and got to know that with Oracle database connection,theres lot of stuff needs to take care of in terms of custom sql and LOV and in our case,we have lot of custom sql for each object in the universe so just wanted to confirm.
    I will do the changes and let you guys know in case theres any isuue specifically to Oracle.

  • Problem in getting the database connection from a connection pool

    Hai All,
    I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
    I am using the Oracle database 8.1.7.
    I have configured my connection pool, datasource and JNDI in weblogic.
    In my java program i have the following code to retrieve the connection.
    import java.sql.*;    
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    class jdbcshp1 {
        public static void main(String[] args) {
         Connection connection = null;
         try {
               Hashtable ht = new Hashtable();
               ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");  // Wanna get rid of this.
               ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
               // Get a context for the JNDI look up
               Context ctx = new InitialContext(ht);
            javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
              //Create a connection object
              connection = ds.getConnection();
         The above code is working fine but, the two ht.put statements are creating problem.
    The problem is, after converting the application into WAR file it can be deployed
    on any machine or different port on same machine. My application fails if its deployed on
    weglogicserver which is at different port.
    Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
    any help is appreciated.
    Thanks in advance
    Pooja.

    Hai All,
    Firstly, thanks for ur reply.
    Even i have seen some code which uses context constructor with out any parameter and works fine.
    i dont understand why its not working for my code.
    When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
    Context ctx = new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
    connection = ds.getConnection();The error is as follows:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
    I appreciate all ur valuable help.
    Thanks once again.
    Pooja.

  • 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

  • Upgarding Crystal Reports for VB6 to C# 2010

    I am faced with upgrading crystal reports written for VB6 to be used by C# in VS2010 (Crystal Reports 13)
    Please provide me with links to good working practise in making this upgrade. The back-end database is SQL Server 2005 and is accssed by stored procedures and a data layer. The data layer which was previously written in ADO/VB6 is now being re-written to ADO.NET/C#.

    Hi Clive,
    If you open those sample applications it will answer a lot of your questions for upgrading and how to open reports.
    When you open a project created in VS .NET and upgrade CR .NET assemblies VS will simply prompt you if you want to upgrade the runtime. All assembly versions in .NET will show for example 13.0.2000.0, these never change, just the file version itself will change with patches. No rebuild required, although recommended just in case.
    As for how to open a report it's pretty much the same as the RDC:
    using System;
    using System.IO;
    using System.Xml;
    using System.Drawing;
    using System.Collections;
    using System.ComponentModel;
    using System.Windows.Forms;
    using System.Data;
    using System.Threading;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.Shared;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ReportDefModel;
    using CrystalDecisions.ReportAppServer.CommonControls;
    using CrystalDecisions.ReportAppServer.CommLayer;
    using CrystalDecisions.ReportAppServer.CommonObjectModel;
    using CrystalDecisions.ReportAppServer.ObjectFactory;
    using System.Data.OleDb;
    using CrystalDecisions.ReportAppServer.DataSetConversion;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    using CrystalDecisions.ReportSource;
    using CrystalDecisions.Windows.Forms;
    using System.Data.SqlClient;
    using System.Runtime.InteropServices;
    namespace Unmanaged_RAS10_CSharp_Printers
         /// <summary>
         /// Summary description for Form1.
         /// </summary>
         public class frmMain : System.Windows.Forms.Form
            CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
            CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument rptClientDoc;
    RPT is the Engine and can do basic API's and ISCDReportClientDocument is RAS and has all functionality available in API's, or as much as documented in the Help files.
    This uses A dialog box to open reports:
              private void btnOpenReport_Click(object sender, System.EventArgs e)
                rptClientDoc = new CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocument();
                openFileDialog.Filter = "Crystal Reports (*.rpt)|*.rpt|Crystal Reports Secure (*.rptr)|*.rptr";
                //openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
                openFileDialog.FilterIndex = 1;
                //rptClientDoc.MinorVersion();
                   if (openFileDialog.ShowDialog() == DialogResult.OK)
                        btnOpenReport.Enabled = false;
                        btnSaveRptAs.Enabled = false;
                    btnCloserpt.Enabled = false;
                        object rptName = openFileDialog.FileName;
                    try
                        rpt.Load(rptName.ToString(), OpenReportMethod.OpenReportByTempCopy);
    Don

  • Problem with crystal report that comes with VStudio 2008 Database edition

    Hello,
    I'm using crystal reports that comes with Visual Studio 2008 Database edition. But I'm having a problem these days. When there are more than 4 pages in the report, the summary field in the pagefooter(usually sum of data in the Details section) show 0 in the first page.It will be displaying in all other pages. I couldnt sort out the problem.I'm binding data to the report from an SQL Server 2005 table.
    Thanks in advance.I really appreciate if some one can sort out the problem quickly.

    Have not heard of the issue, but download SP1 and see if that helps:
    https://smpdl.sap-ag.de/~sapidp/012002523100009351512008E/crbasic2008sp1.exe
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup

  • Crystal Report Print Preview presenting users with Database Login

    Issue
    A user amended a crystal report form, on doing so has now made that Form unavailable to the majority of users to Print or Preview this is in 8.8 PL10. All other users on Previewing are presented with a window  Database Login, but this only presents the server name, Database name is blank and greyed out and then there is only Login ID and Password available. If you enter in the database password a message appears stating failed login.
    We have access to the SAP server and logged in and get the same message! but on the users machine who amended the Form they can print? any suggestions greatly appreciated

    Hi Roger,
    The problem sounds similar to what I've had recently, it was resolved by changing the database connection type to SAP Business One in Crystal Reports 2008, I can confirm that using OLE DB or other will still cause the login issue on other machines off the SQL server, the SAP Business one connection solves the issue.
    I was fighting with this for hours, hope this helps you all.

  • Crystal Report VS2005 - Table fields missing in Database Expert

    Hi,
    I am having a problem with the Crystal Report comes with Visual Studio 2005. I am trying to develop a customized report for SAP Business One. When I try to add two tables using the Database Expert, there are certain fields missing in the LINK page. This is a big problem for me because I need to link that field with another table. Oddly, it doesn't seems that there are anything wrongs with the missing fields. If I click OK and check at the Field Explorer, the missing fields are there!!!
    In other words, it is missing only at the Database Expert --> Link Tab. Anyone having the same problem? Is this a known issue or any patch that I can apply to resolve this issue?
    Thanks in advance for your help.
    Regards,
    Harianto

    Try this link to resolve your issue:
    Full Outer Join option for SQL Query and BW Query grayed out
    Thank you
    Don

  • Advantages and features of crystal report 13.0.2000.0

    Hi..
    i was using crystal report10.5 with visual studio 2008(c#)..
    recently we migrated to vs2010 and sap crystal reports..
    what are the advantages of sap crystal reports13.0.2000.0 when compare to crystal report10.5 ?...
    is there any new features added to sap crystal reports13.0.2000.0...

    Check the what's new article:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d01d0431-6928-2d10-1683-a2256fc6bd0d
    Cheers
    Fritz

  • CRVS 2010 beta - Crystal Reports Beta 2 for VS 2010 fails to start

    Right after I install it. I try to add a Crystal Reports item to my project and get an error indicating that the temporary report (.rpt) file can not be oppened. When I click OK I get a seccond error message "invalid key".
    I tried reinstalling Crystal Reports and then Visual Studio with out success. This was working on the same laptop when using Vista, now I have Windows 7. But on my Windows 7 PC works ok.
    Please help
    Formated subject to meet the rules
    Edited by: Don Williams on Oct 2, 2010 11:06 AM

    Have you search forums for possible solutions before posting?
    Typically this is caused by not setting/using the 4.0 framework ( not the client version ) or instlaling with DEP and UAC disabled.
    Make the changes to security and then do a repair install.
    Thank you
    Don

Maybe you are looking for

  • HT4356 How can i disable AirPrint from an iphone or ipad?

    I have a kid she is printing 1000 pgs per day... I want her to be able to still use wifi. Thanks..

  • Deployment error while running the application

    Hi Every body, I am new to JEE though an old pro at JDK.I have also worked on tomcat. I have got Sun Java System Application Server 9.1 installed with NetBeans 6.1 on winXP. I am trying to create a EJB app-client module.I even tried to run the sample

  • Airport Express not working with Comcast

    I used to have AT&T and had my airport working well. Yesterday i changed to Comcast and my airport is not working the light stays yellow.. I tried resetting it but it didn't work.. I use it with my old Cisco router and its working. Whats wrong with m

  • ODI not picking the file generated through calcscript

    Hi John, We have used samba and mapped the folder from linux to windows.We named the drive and specified the path. Now i ran the interface which invokes the calcscript for data extraction and the script ran well.I t generated the file. But the file i

  • Error while cube deployment in Essbase Studio

    Hi All, I created the hierarchies,however when I am facing below error during cube dployement. Member load for dimension H0-Releases started at: Mon Apr 18 15:21:25 GMT+05:30 2011. Member load elapsed time: 3 Seconds. Failed to deploy Essbase cube. C