Dynamically Calling Crystal Report from .net 2005 with no crystal login

Most of us develop .net applications and will try to integrate the
crystal reports with the applications.  I tried all possbile options,
and succesfully implemented them. I would like share some of them with
you all. 

Environment

Visual Studio 2005 and Crystal Report XI.

1. Create a Crystal Report as usual in Visual studio 2005 .net
   using ODBC connection. In this example "CrystalReport.rpt"
  
2. Create a aspx web form to display the report.  This form will
   be a place holder for crystal report.

3. In design mode, drag and drop Crystal Report viewer control and
   don't configure anything.
  
4. Open code behind .aspx.vb

    'Declare public variable
   
    Private myReportDocument As ReportDocument

    'Note: This is Page Init event not Page Load event
  
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Dim myConnectionInfo As ConnectionInfo = New ConnectionInfo()
       
        ' Note: This is your local ODBC Name NOT SQL SERVER NAME
       
        myConnectionInfo.ServerName = "PUBSODBCNAME"
       
        ' If your ODBC connection defaulted to your application database,
        ' you can remove the following line.
       
        myConnectionInfo.DatabaseName = "Pubs"
        myConnectionInfo.UserID = "userid"
        myConnectionInfo.Password = "password"
       
        myReportDocument = New ReportDocument()
        'If your crystal report is in some other folder, give proper path
        ' In this example, .rpt file in the same folder as .aspx file
        Dim reportPath As String = Server.MapPath("CrystalReport.rpt")
        myReportDocument.Load(reportPath)
        SetDBLogonForReport(myConnectionInfo, myReportDocument)
        CrystalReportViewer1.ReportSource = myReportDocument
        ' You can customize the Crystal Reports toolbar.
        ' like the following.  I have disabled the business object logo
        ' in the tool bar.
     
        CrystalReportViewer1.HasCrystalLogo = False

    End Sub
   
    'This Sub is necessary for Crystal report database connection
   
    Private Sub SetDBLogonForReport(ByVal myConnectionInfo As ConnectionInfo, ByVal myReportDocument As ReportDocument)
        Dim myTables As Tables = myReportDocument.Database.Tables
        For Each myTable As CrystalDecisions.CrystalReports.Engine.Table In myTables
            Dim myTableLogonInfo As TableLogOnInfo = myTable.LogOnInfo
            myTableLogonInfo.ConnectionInfo = myConnectionInfo
            myTable.ApplyLogOnInfo(myTableLogonInfo)
        Next
5. Now run the .aspx page. You will see the report or the crystal report parameter
   form. It will not ask you DB login information.

You can customize this .aspx file to display your banner etc. and call it from other .aspx file.
Try it and give me your suggestion.
And, Next week custom paramter form to replace Crystal parameter form.
See you then.

SujiRavi


Suji Ravi. M
MCAD
0
SujaRavi
3/5/2007 1:37:15 AM
asp.net.tips-tricks 851 articles. 0 followers. Follow

3 Replies
1044 Views

Similar Articles

[PageSpeed] 38

It works.  Can you post Crystal custom parameter form code soon?  I have urgent requirement for that.

0
sandrew
3/6/2007 2:52:32 PM

how to do it in C#

will u plz guide me

thnx in advance

regards

Maria Uppal

0
mariauppal
7/20/2007 5:46:04 AM
0
boltonss
7/20/2008 8:36:06 AM
Reply:

Similar Artilces:

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 solution?If my post is your answer, please mark it as the answer. It will bring good karma.Crystal AllianceMy BlogFlorist Blogs all the C# code is interacting with the database fine. when I mean manipulate the crystal forms I mean move things around in the designer. But when I "play" the application, execute the code, when I try to bring up the report I get said error. ...

VS .net 2005 Crystal reports ok to run on Crystal Reports XI?
I am getting mixed messages from the asp.net 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....

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...

Errors with all my reports after upgrade from Bundeled Crystal.NET (VS2003) to Crystal XI Developer for .NET
All my Crystal reports were developed using the bundled Crystal in VS 2003.  I just installed the Crystal XI for .NET Developer version that we purchased and now I get an error when running my reports.  (I am running them in debug mode on my development machine). I have tested it on several different reports.  I did not change the code, this worked fine in the previous version. First I reference my report (AccountList is the AccountList.rpt report that is in my project): Dim myReport As New AccountList Then I start rolling through the report's tables to update the log...

How to call crystal report 11 in visual studio . net 2005 with vb ?
I generated a report using crystal report 11  . I want to know how to call this report using my visual studio . net 2005 with vb . I want to coding or any article ....

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 asp.net 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...

Crystal Reports in .NET 2005?
What happened to crystal reports for .NET 2005?  I upgraded from beta to the final release and I now no longer have the merge modules, I'm getting 'argument not found' exceptions on previously working reports that haven't been touched, and when the reports do run correctly, no data is displayed (despite the fact that they have data in them.. only the header and footer is displayed).  Has anyone else experienced anything like this? Sounds like you have 2 issues: 1)  Where are the merge modules for the RTM release? 2)  Getting an "Argument not found" exception.  ...

Crystal Report in VS.NET 2005
Can somebody tell me how i can instantiate a CrystalReport in ASP.NET page. Acutally in 2003 version each crystal report has its .cs file but in 2005 .cs file is missing. ReportClass oRpt; oRpt = new Reports.rptCrystal Report ( ); oRpt.Load(); oRpt.SetDataSource(dataset); rptViewer.ReportSource = oRpt; It was working fine but i have converted this into VS.NET 2005 version its is throwing exception "Unable to find the report in the given manifest , build the project and try again like this ". Can somebody tell me how i can instantiate the crystal report in VS.NET 2005 as i did  in...

Printing crystall report vs.net 2005
 Hi All! I used Crystall report of vs.net 2005, it's fine but when i print with big data is error! Details: "a error occurred on the server. Printing will be stoped. Wold you like to view the error information?" Chose "Yes" or "No" don't print.  Please, help me! Thanks!   AnyOne, phease help me! I'm very verry ...urgent VinhNT...

How to export subreports of a crystal report in .Net 2005.
 When I export subreports in crystal report programmetically the main report gets exported not the subreport. I want the subreport of the crystal report to be exported. The subreports are opened on demand.  I used the following code to export.CrystalDecisions.CrystalReports.Engine.ReportDocument objRptDoc = null;objRptDoc.ExportToDisk(objType, fileName);objRptDoc.ExportToHttpResponse(objType, Response, true, fileName);Please help me to export the subreport which is currently loaded in the report  I think On demand reports are never exported. The only way is to uncheck on-dem...

Crystal Reports Licensing and VS.Net 2005
I have been researching licensing information for Crystal Reports, and I have come across contradicting answers.   We currently have Visual Studio 2005, which comes with Crystal Reports.  I read that this version can have only 5 concurrent users viewing reports.  I am currently developing a internal ASP website that our 75+ employees will be using.  The reports will be part of the project and stored in something like ~reports/ folder. My question is when the project gets deployed (remember internal only) do we need to buy licensing for Crystal reports, or are we...

.net 2005 Crystal report has no .cs file
In .net 2005, when I add a Crystal report (add new item) to my project I do not get the class (.cs) file for the report.  In .net 2003 this was happening automatically - is 2005 different?  I see the "place code in seperate file" checkbox at create-time, but it is dimmed and not checkable.My driver class needs to instantiate my report but can't - plus, I don't see how it could without an associated class.  Does someone have any sugggestions?Thanks,Jay hi. I am crystal report. in visual studio 2008, when i add a crytal report to my project don't accura crytal report ....

crystal report merge moudle for .net 2005
Hi, I have deployed my application but crystal report is not working  i need to download cyrstal report merge module i try to found the files but i din't get that please help me where i can download crystal report merge module for .net 2005 very urgentRegards,Kannandesikan...

upgrading vb.net to vb.net 2003 crystal report viewer problem.
I have a vb.net web. app that has several pages each with a different crystal report on it. It works perfectly under vb.net. I've since installed vb.net 2003. After I open the solution in 2003 & it does its upgrade, all of the crystal report viewer controls are corrupted. If I try to run it as is I get the following error: "The base class includes the field 'myname' but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control(CrystalDecisions.Web.CrystalReportViewer). So I tried deleting the control and adding back on. & when I ru...

How to use Crystal Reports.Net with Visual Studio 2005?
Hi. I am new user of visual 2005 and crystal report.net. 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 asp.net 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 report.net for production use? (licensing) 5. Is it limited or unlim...

Dynamic Image in Crystal reports with ADO.NET XML
Hi I have an Image in sql server and I am creating a report from a dataset and set the datasource of the report to the dataset. All work fine but I need a dynamic image as a header in the report. Is there a way I can add the image to the dataset and then stream the image to the report.I am using CR 9.0 for the crystal reports. Also before generating the reports I set the datatsource to an xml file for the schema in the dataset for the reports.. Can any body help me with the dynamic generation of the image in crystal report. Thanks....

Error in using crystal reports in vb.net (2005)
I am using visual studio 2005, I need to use crystal reports XI objects in my project. I dont need to view the reports, just to access the objects of crystal reports to load the reports and print the reports directly in printer. I used the CrystalReports11_5_NET_2005.msm merge modules and add reference to the below dlls. CrystalDecisions.CrystalReports.Engine.dllCrystalDecisions.ReportSource.dllCrystalDecisions.Shared.dllCrystalDecisions.Windows.Forms.dll But still i got the error "The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an excep...

How to write a print button for crystal report from .net 2005
I am having problem of loading my project into our local server which it does not support all the feature from Crystal Report. When I run the program, it does not show the CR tool bar correctly so I can't print.  I am writing my own tool bar that has page navigation (first page ... last page). But I can't find much information about printing and exporting to PDF files. need help !!System: win xp pro, Visual Studio 2005 Enterprise Edition (w/ Crystal Report) JayWeb Developer...

How to create dynamic crystal reports at runtime in vb.net?
 Hai All, I want to create crystal reports dynamically, I don't know the columns i will take it from database at runtime, im getting all data into one dataset and im convrting dataset into xml schama, then im using that xml schama in crystal reports,there i drag n drop all fields in xml schama to crystal report, up to here its working fine, but when ever i changed fields in database i have to change in crystal report also Is there any way to update crystal report dynamically.....?(it shoulld display newly added columns in database also, Is it possible????) Thanks, Aswath. you try to create crystal report from sql string http://vb.net-informations.com/crystal-report/dynamic_crystal_report_from_sql_query_string.htm  http://vb.net-informations.com/crystal-report/vb.net_crystal_report_load_dynamically.htm   i tried these links, it works well .        HI, Thanks for replay,I generated report dynamically using formula fields and parameter fields...... Thanks,Aswath.   how to use formula field in crystal report useing vb.net at run time Hi, In CR goto Field explorer -----Formula fields--Rightclick---New-------------give some name In codebehind(vb.net) pass the value like this   rptDocument.DataDefinition.FormulaFields(0).Text = "'" + CStr(Trim(dt.Rows(0).Item("company_name"))) + "'"  ...

VS.Net 2005 does not create the .vb class for Crystal Report
In Visual Studio 2005, when I try to add a new Crystal Report file to my project, VS does not generate the .vb file, so I cannot instantiate a report object from the class. We are 2 in the same situation, and we tried to uninstall / reinstall VS.Net 2005 but that didn't helped. I tried the same thing in VS.Net 2003 and it's working... I have the same problem, this code is working fine with VS2003 but Not with vs2005; and the error is the class is not recognized by vs2005. and this error:error  BC30560: 'CrystalReportViewer' is ambiguous in the namespace 'CrystalDecisions.Web'. I hope some one can provide a solution the this problem. Imports System Imports System.Data Imports System.Data.OracleClient Imports CrystalDecisions Imports CrystalDecisions.CrystalReports Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Imports CrystalDecisions.ReportSource Imports CrystalDecisions.Web Imports System.ComponentModel Partial Class EmplSchedule Inherits System.Web.UI.Page Protected CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer Public crReportDocumnet As EmplScheduleRpt = New EmplScheduleRpt    Private Sub page_load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load showReport() End Sub Private Sub showReport() Dim connectionString As String connectionString = System.Configuration.ConfigurationManager.AppSettings("appsss") Dim objConnection = New OracleConnec...

Why Crystal Report Help is Not Included in Visual Studio.Net 2005
 Hi,1.  Why Crystal Report Help is Not Included in Visual Studio.Net 2005 2. I Have Written a Formula For Count in Reports i.  My Formula intializes in report Header ii. Then as My Condition is Working in Detail  alsoiii. Then i am Showing The Result in Footer  But I Want To Display The Result in Header is That Possible Thanks ...

Can somebody help
I Seem to be going nuts ! I know it has to be simple but I am missing the link. I haven't used crystal reports with asp.net before. So pardom me if my problem sounds silly. My requirement is very simple actually. I am using asp.net 1.1 with vb.net in vs.net 2003 with the inbuilt crystal reports control. I have to connect to a sql server 2000 database to extract rows from a stored procedure which accepts a parameter and the report has to be in Mail label format. I referred various books and web sites and according to that , added a crystal reports file to the project and selected the store...

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 - Dynamically Calling Crystal Report from .net 2005 with no crystal login - asp.net.tips-tricks

Placebase team at Apple file “Schematic Maps” patent dynamically detailing important data
In a report from Computerworld way back in 2009, we learned that Apple had quietly acquired Maps API company Placebase. Then, founder of Placebase ...

Apple's Lightning port dynamically assigns pins to allow for reversible use
... a closer look at how Apple's new Lightning connector works, and has come to the conclusion that the 8 pins on each side of the plug are dynamically ...

In a dynamically typed language, is it a bad idea to return different data types?
In some cases, returning different types from a single function works.

Urlbox Launches Screenshots-as-a-Service Platform to Dynamically Update Galleries
... changes. Launched yesterday, Urlbox allows anyone with a gallery displaying website screenshots to automate the process and keep them dynamically ...

Everything.me launcher dynamically adapts to what you’re doing right now
... phone according to what you’re doing. Perform a search for ‘football’ and your background will change to the NFL logo. A launcher that dynamically ...


A YouTube Experiment Resizes the Player Dynamically
There's a new YouTube experiment that changes the video player's size, depending on the browser window's size. When resizing Chrome's window, ...

Apple Granted “Dynamically Changing Cursor for User Interface” Patent, Originally Filed in 2003
... a utility patent that covers the use of the mouse cursor that changes according to the context of the task it is engaged in. Called a “Dynamically ...

Atmel's FPSLIC II Dynamically Reconfigurable SoC Supports "Silicon-Sharing" For Peripherals & Interfaces ...
Silicon-Sharing Fits 200K Gate Design into 40K Gate FPSLIC II's, Cuts Power Drain by 97%

Everything.me Launcher Wants to Dynamically Change Phones Based on Location, Interests, and Mental State ...
What if your phone’s launcher dynamically changed based upon interests, your location, or topics you had in mind at a specific moment? A new ...

Resources last updated: 3/22/2016 12:24:58 PM