Creating Reports using Crystal Reports for Visual Studio .NET

Hi i am trying to create a crystal report using C# coding but instead of creating a web application under new project i decided to choose create an website with C#. The problem is i get:-

The report you requested requires further information.

Server name:   
Database name:   
User name:   

All data is present except my password when i enter it, it works fine and the report works too with no problems. How do i remove this prompt. There is a property called "DatabaseLogonPrompt" but if i set it to false. The report will no show up telling me the parameters are incorrect. So the password has to be entered in the code but where i dont know.

Build the report method:

The crystal report i built in this manner.

1) Added Crystal Report from add new item
2) Followed the instructions
3) Chose to create a new connection
5) OLEDB provider for SQL Server
6) Input servername,id, password and database name from combo

this created the report

I installed IIS on my local pc having win xp sp2. Also have Sql express 2005 on the same machine.

So i need to find a way to remove the prompt. Found codes but it was either windows applicaiton with C# or web application in vb. I want code for C# web application or website in C#. I relatively new to as i finished my .net at the end of last month

Please HELP!!!


Hey guys please Help Me :(
7/1/2007 10:31:24 PM 7043 articles. 0 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 54
Get it on Google Play
Get it on Apple App Store

 I'm afraid I don't know C# syntax, so I can't tell you exactly how to do it. But here's an example in VB that shouldn't be all that different from what you want (just translate the syntax to C#):


If (Session("forepipeq4") Is Nothing) Then
            forepipeq4 = New ReportDocument()
            'load the report document
            forepipeq4.Load("D:\IIS Web Roots\Crystal\reports\Fore-Pipe-Q4\Fore_Pipe-Q4.rpt") 'web server
            'forepipeq4.Load("C:/Documents and Settings/cfry/Desktop/Web_Reports/Fore-Pipe-Q4/Fore_Pipe-Q4.rpt") 'local

            'authenticate to the database
            reportDB = forepipeq4.Database 'get the database
            reportTables = reportDB.Tables 'get the tables 
            'iterate through all of the tables, setting the correct login information for all of them
            For Each reportTable In reportTables
                reportLogOnInfo = reportTable.LogOnInfo 'get the LogOnInfo object
                'reportLogOnInfo.ConnectionInfo.ServerName = "server" 'specify the server
                'reportLogOnInfo.ConnectionInfo.DatabaseName = "database" 'specify the database
                'reportLogOnInfo.ConnectionInfo.UserID = "username" 'specify the user name
                reportLogOnInfo.ConnectionInfo.Password = "password" 'specify the password
                reportTable.ApplyLogOnInfo(reportLogOnInfo) 'save the changes
            Next reportTable


For security reasons, Crystal will -not- store the password with the Report, so you must set that. I have the other lines in there (for database, username, etc.), should I want to set the other pieces of the authentication information, but they are commented out because they weren't necessary for me in this case. A couple of other things to be aware of: if you are planning to deploy your report to a different machine than the one you are creating it on, expect to have some trouble (it's a pain...). Make sure that any ODBC connection you use when creating the report is replicated -identically- on the server you deploy to because Crystal stores the name, etc. and will start doing weird things if circumstances aren't the same. Well, that's getting a bit off-topic, but hope this helps with the authentication part at least....


7/2/2007 7:42:12 PM

The code may work with vb but desperately need C# language

Hey guys please Help Me :(
7/2/2007 10:01:52 PM
Hello please help
Hey guys please Help Me :(
7/6/2007 11:53:07 AM

Use this code, Hope it resolves ur issue...

Here is the code for that in VB.NET:


On the page load or button click or whatever you want to run the report on you need to add the following: configureCRYSTALREPORT()

Private Sub configureCRYSTALREPORT()
    Dim myConnectionInfo As New ConnectionInfo()

    myConnectionInfo.DatabaseName = "DatabserName"
    myConnectionInfo.UserID = "UID"
    myConnectionInfo.Password = "PWD"
End Sub

Private Sub setDBLOGONforREPORT(ByVal myconnectioninfo As ConnectionInfo)
    Dim mytableloginfos As New TableLogOnInfos()
    mytableloginfos = CrystalReportViewer1.LogOnInfo
    For Each myTableLogOnInfo As TableLogOnInfo In mytableloginfos
        myTableLogOnInfo.ConnectionInfo = myconnectioninfo

End Sub


Here is the code for that in C#:


    private void setDBLOGONforREPORT(ConnectionInfo myconnectioninfo)
        TableLogOnInfos mytableloginfos = new TableLogOnInfos();
        mytableloginfos = CrystalReportViewer1.LogOnInfo;
        foreach (TableLogOnInfo myTableLogOnInfo in mytableloginfos)
            myTableLogOnInfo.ConnectionInfo = myconnectioninfo;


In Page Load....
        ConnectionInfo myConnectionInfo = new ConnectionInfo();

        myConnectionInfo.ServerName = "serverName";
        myConnectionInfo.DatabaseName = "DatabaseName";
        myConnectionInfo.UserID = "sa";
        myConnectionInfo.Password = "pwd";




Don’t forget to 'mark this as answer' if this post helps you.

www.mReach.Net ...for Online Live TV Channels, Radio's and WebCams Live

Online Live TV Channels, Radio's and WebCams
7/11/2007 10:42:40 AM

Similar Artilces:

Converting Crystal Reports 9 report to Crystal Reports .NET report
I have a web page that is supposed to display a crystal report.  The report is fully written and functional in crystal 9 (non-.Net)  .  Is there a way to convert my .rpt so that I can just include it in the new web site? why you don't try to compile project with .net and include your report. then if crystal report is power tool will suggests you with conversation tool    My blog is here.Please remember to 'Mark as Answer' if this post answered your question! Wow it really was that easy!  I just added the old crystal report into my .NET proj...

crystal reports .net -> crystal reports .net 2003
recently converted a project from .net to .net 2003. The 2 crystal reports I had in the project do not load when executing the application. The project itself within 2003 will allow me to multiplat the crystal reports, however when it comes to execution time I get the error: Invalid Data Source. If this isn't the right forum please point me to the right one as this is really the only website I know of with a large reader base. >to multiplat the crystal reports To what the crystal reports? Do you have the same database connections established and verified in your 2003 s...

creating reports in Visual studio 2005 using Crystal report
hi: i was trying to create a report using crystal report in visual studio 2005 and i was unable to link my database to the report.rpt can anyone please tell me the steps how to connect my database to the crystal report or any link that may help me.     very ugently. thank you for your support...

Is there a way to dynamically generate crystal reports using embedded crystal report viewer in visual studio ide?
I have to generate the crystal report during runtime.Can  u tell me the procedure how to do?Code is appreciated. Yes, its a little tricky but I posted here on it:  You lay out the report how you want but the data is supplied dynamically.   Eric Is there a way to generate report without using layout report before hand? Not that I'm aware of with CR.  Its not really a full SDK to develop with.  There are 3rd party reporting programs that can do this though I believe. Can u tell me some third party reporting programs a...

Can we generate crystal reports programmatically using embedded crystal reports designer in visual studio ide?
I have a requirement like i have to generate crystal report based on the user's requirements during runtime?Can u suggest me how to do?...

How to create Report Letter with multiple pages in C# and Crystal Report.Net using VS2008
Hi experts, I’d like to have some helps from you guys. I need to create an app with C# and Crystal Report.Net using VS 2008 for a Landscape & Nursery company.  The company will send out coupon letters to some customers who purchased something from the company within past 12 months. Users will get customers’ info from database using zip code. I have a drop-down control to populate all the eligible zip codes. The following 8 data fields will be retrieved from database; FirstName, LastName, Address1, Address2, City, State, ZipCode, and PreviousPurchased. I have a pre-defined Crystal R...

How do I incorporate a crystal report other than the crystal report provided by Visual Studio?
I'm working with the CrystalDecision version of the crystal report. How do I incorporate this into my development?...

View report from the crystal report server using .NET
Hi,I am first time dealing with crystal report and I having problem with it. I need to use to link to the crystal report server and view the report, but don't know how? Is there a way to do that? or is there any better way to using .net and view report from the crystal report server?Thanks....

How to use Crystal Reports.Net with Visual Studio 2005?
Hi. I am new user of visual 2005 and crystal I will appriciate if someone can answer my question. 1. Can I use Crystal Report.Net came with Visual Studio 2005 to deploy web application? 2. Can someone provide simple sample code 2.0 application in VB to implement crystal report (using pubs table in sql 2000 or sql 2005). That is, to show crystal report page of "select top 20 * from employee (pubs db)" 3. Do I have to have report designer to develop crystal report page? 4. Can I use crystal for production use? (licensing) 5. Is it limited or unlim...

integration of Crystal Report with .NET ; crystal report viewer not displaying in Toolbox
Hi I m new to Visual Web Developer 2005 Express Edition. I want to integrate Crystal Report with .NET. In my Toolbox , Crystal Report Viewer is not displaying. How to make it possible? + How to call my report from 2.0. Need source code plz.*Share Knowledge Every TIME Crystal Reports for .NET does not come with VWD Express.  It only comes with VS 2005 Professional (I'm not sure about the Standard edition).If you have Crystal Reports 10 or XI, you can installed the .NET libraries for Crystal and then use them within VWD Express, noting that you have to build your reports ...

Cassini, VS.Net and Crystal Reports
Hi,I am working with Win XP home, Cassini and VS.Net.I would like to play with some Crystal Reports.I create the report in VS as CrystalReport1.I put a CrystalReportViewer on my web form. It does not get recognized as a defined object type but there are no build errors.When I run the app I get an error: Type 'CrystalReport1' is not defined.I have googled on this and see several things people have suggested/tried to correct this. Most I have already tried or the suggestions are not very clear to me. Then I came across a msg that instructed me to set up virtual directories for IIS for CrystalR...

VS .net 2005 Crystal reports ok to run on Crystal Reports XI?
I am getting mixed messages from the website hosting providers - some say they do not support Crystal Reports due to a $25,000 per cpu licensing fee, others say all I need to do is install Crystal Reports XI (about $500) on a dedicated server and it will run fine. Will Reports developed with the embeded Crystal Reports in VS 2005 run in a Crystal Reports XI environment? Thanks....

Reporting (Crystal Reports vs. Custom .NET)
Ok, so I have to confess, I have never tried Crystal Reports. I just recently started working for a marketing company now and reporting is VERY important to them.  I am currently migrating a lot of the applications they use from VB5 and VB6 to web based .NET 3.5 apps.   The whole company is running off ACCESS databases if you can believe that.  They sometimes have up to a few hundred agents taking sales on incoming calls and chat sessions and they are all getting streamed to FLAT file records (completely un-normalized database).  I am in the process of developing a c...

Crystal Report.NET and nested sub reports
I have a report where i need to have several nested subreports... A parent may have childs and childs may have other childs and so on... CrystalReport.NET and VS2005 seems to support one level of subreport (a report could have a nested subreport but this nested subreport can't have another nested subreport). I really need to handle multiple levels of nested subreports in order to complete my report. What is the solution ???   Thanks   Eviral     I'm not positive if this works but its worth a shot.  Create the subreports as se...

Web resources about - Creating Reports using Crystal Reports for Visual Studio .NET -

Wikipedia:Creating a bot - Wikipedia, the free encyclopedia
It is often far simpler to request a bot job from an existing bot. If you have only periodic requests or are uncomfortable with programming languages, ...

U.K. Woman Faces 20 Months For Creating Fake Facebook Accounts, Sending Herself Abusive Messages
A woman in Cornwall in the U.K. came up with a creative way to use Facebook to accelerate a family spat, and it earned her 20 months in prison. ...

Sandi Krakowski’s Tips for Creating Great Content
Quick tips to help you create great content for your business.

Bug - Creating a Video.Watches Action stopped working - Facebook-Entwickler
Since today executing a POST on a me/video.wacthes endpoints no longer works, it was working around 10 hours ago since then the call always returns ...

Facebook simplifies process for creating repeat events
Facebook introduced a new feature for events this week that allows users to quickly create a similar event as one they previously hosted or attended. ...

The Obama campaign won by creating their own Facebook, with unique features for political campaigns.
... seen as too dangerous to nominate someone who is so thoroughly narcissistic, arrogant and dishonest. The Obama campaign won basically by creating ...

Creating A Road Map To Market Your Startup
Spreading the word can be challenging when you’re new to an industry, don’t have a big budget, and have little helpbut it’s possible.You’ll need ...

Dance Machine - The Fun Video Editor for Creating Music Videos to share on Instagram, Facebook, Vine ...
Get Dance Machine - The Fun Video Editor for Creating Music Videos to share on Instagram, Facebook, Vine, and Twitter on the App Store. See screenshots ...

Creating Economic Dynamism: Joseph E. Stiglitz
DAVOS/SWITZERLAND, 25JAN13 - Joseph E. Stiglitz, Professor, Columbia University, USA talks during the session 'Creating Economic Dynamism' at ...

YouTube - Super Human Abilities: Tila Tequila Creating Energy Balls & Electricity Out of Thin Air!
Veröffentlicht am 24.04.2013 Hey Guys! For a long time now I have been able to do some pretty supernatural things that most would consider "SUPER ...

Resources last updated: 12/24/2015 9:45:29 PM