previewing and printing a report in ASP 2.0 with Crystal Reports and VS 2005

Crying [:'(]
Please i need some help.
i have several days trying to print a report in ASP with VS 2005 and crystal reports.
I have 2 pages, in the first page I have only de crystalreportViewer, in the other page I fill the dataset with then data from dataBase.
I heve been reading some examples but this are from VS 2003, and i have some problems.
1 - I try to create an instance of report but VS 2005 dont recognize it.
2 - if I put the code in the "page_init" i can see the report, but if there is a post back it desapear.( due to it, y put de Viewer in a separate page)
3 - the report dont show the data that i send it in the dataset.

in few words i need to print a report (sending: a dataset and several formulaFields) the same page or separate page.

thank you.

Sebastian Greco
Software Developer
5/12/2006 5:54:11 AM 7760 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 56

now i know how to do all the thing that i was describing before.

lets see any sample code...

 if anybody has a question. feel free to write to


    Imports CrystalDecisions.Web.Design
    Imports CrystalDecisions.ReportSource
    Imports CrystalDecisions.Shared
    Imports CrystalDecisions.CrystalReports.Engine

if you have formula fields on your report an need to pass some data you must declare it

    Dim crFormula As FormulaFieldDefinition

same for textobjects

    Dim txt As TextObject 

you need to add a crystal report viewer (crVisor) to the page and an crystal reportSource(RepoteFuente)

on page init you must to specifi to the viewer what is the report source that it must load on every post back

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Me.crVisor.ReportSource = Me.RepoteFuente
    End Sub

 in this case i have created a datasource to bind the report.

go to (fiel explorer tab - database fiel - database expert)

and create a new OLE DB(ADO) Conection

choose sql native client and then its create a command where you can add the query that is gonna bind the report fields


now do anything like that in your print button_click

the report source must load the expecific reports from the file in the proyect (in this case is into a folder called "Reportes") 

                Me.RepoteFuente.Report.FileName = "Reportes\rptResultados.rpt"

then we pass to the report the dataset whit the real data that we whant to show in the report, this dataset must have the same fields that the query we created in datasource of report


if we whant to pass data to a formula fied

                crFormula = Me.RepoteFuente.ReportDocument.DataDefinition.FormulaFields("Edad")
                crFormula.Text = "'" & strEdad & "'"

to hide a text object or a section

                    Me.RepoteFuente.ReportDocument.ReportDefinition.ReportObjects("txtNeg").ObjectFormat.EnableSuppress = True
                    Me.RepoteFuente.ReportDocument.ReportDefinition.Sections("secAnormalidades").SectionFormat.EnableSuppress = False

expecify the print options

                Me.RepoteFuente.ReportDocument.PrintOptions.PaperOrientation = PaperOrientation.Portrait
                Me.RepoteFuente.ReportDocument.PrintOptions.PaperSize = PaperSize.PaperLetter

and lest see it

                Me.crVisor.ReportSource = Me.RepoteFuente
                Me.crVisor.Visible = True

i hope that it will help to anybody to want to do a report in cr with vs2005



Sebastian Greco
Software Developer
10/16/2006 6:43:02 AM

Similar Artilces:

comparing Cystal Report 10.2.3(provided by VS 2005) and Crystal Report 10.0.3(provdied by Crystal reports 10
 hi all, i was just wondering what u guys think about the two version (10.2.3 - by VS2005) and (10.0.3 - by Crystal reports 10).it seems like the Coding syntax is abit diff for the two version. (10.2.3 dont even need to mappath) i was wondering if i write the web application using 10.2.3, would i encounter problems when displaying report written by 10.0.3. opinions need, thanks! regards,martin ...

SQL Server Reporting Services for SQL SERVER 2000 AND Visual Studio.NET 2005 .NET 2.0
Hi, Which version of SQl Server Reporting Services will work with SQL SERVER 2000 in pararrel with ASP.NET 2.0 (.NET 2.0 framework)?  Thanks, Azam HighOnCodingWanna get high! Hi, Okay I got the answer. Yes, we can use the SQL SERVER 2005 Reporting Services with SQL SERVER 2000. HighOnCodingWanna get high! ...

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

Visual Studio 2005 vs. Visual Studio 2005 BETA 2
In terms of functionality and features, I was wondering whether there any major differences between Visual Studio 2005 and Visual Studio 2005 Beta2. Thanks From the C# Windows Apps & Web Apps - pecadillos more than anything.  I have several sizeable projects in bothe.g. MDI child/parent Mensu/toolstrips no longer automergesome complaints about rafting property that no longer exists in Windows forms controlsIf it was easy, everybody would be doing it. The primary difference was mainly a lot of bug fixes.  Two areas that we enhanced were website projects and ...

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

Printing crystall report 2005
 Hi All! I used Crystall report of 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...

Converting VS 2003 Crystal reports to VS 2005 crystal reports
Hello,     I have converted a VS 2003 project that has few Crstalreports in it to VS 2005. All the dlls got converted good except the Crystalreports part. I have a sub routine called ExportReport() in a page called GenerateReport.aspx page in VS 2003 which generates the report in a word or excel etc... based on what user selects.   Tthe first line I have is Dim myReport as new CrystalReport1 and this works perfect in VS 2003. But when I converted the entire project to VS 2005 it CrystalReport is not recognised by the IDE and I see a blue line underneath. ...

Sql Server 2005 Reporting Service + Visual Studio.NET 2005
Hi, Iam new 2 sql server 2005 reporting services, I created a report server project with few reports and deployed in reportserver. Everything is working fine but i want to integrate these reports to my 2005 web appliction. Through the interface i have to pass the perameters to my reports. Iam looking for help thxs in advance PradeepPradeep Reddy Take a look over here for a working example :   HTH,Suprotim Agarwal ----- Grid With Excel Capabilities | 27 GridView Tips & Tricks |...

How to design SQL Server 2005 Reporting Services Reports in VS.NET 2005 web applications
Hi,   Can we design SQL Server 2005 Reporting Services Reports in VS.NET 2005 web applications. If so how they can be designed. Plz help me if any one know the solution. Thanx in advance, Vidya     Are you asking if you can use VS.Net 2005 to design reports, yes, both client and server reports are built using VS.Net. If you are asking if you can use a web application to build a report, well yes you could, but you would have you design it.  All sql server reports are is an xml file, so if you can build a front end that will generate the xml in the proper ...

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

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

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

Missing Crystal Reports keycode in Visual Studio .NET 2005 Beta1
Hi everybody, I need to deploy an ASP.NET 2.0 application that contains a Crystal Reports control to my web server. I can do that in 2 ways: adding the required merge modules to a web setup project, or using the Crystal Reports server install on my server machine. But either way I need the Crystal Reports keycode to complete the installation. The Crystal Reports documentation ( states that the keycode is listed in the Help->About Visual Studio menu, next to the Crystal Reports product name. The...

Crystal Report Viewer Export & Print buttons are not working in VS 2005 #2
Dear Sir, I have used Crystal Report Viewer for showing reports in my application(,c#). after deploy in server All the buttons of the toolbar are working. but not visible, and export & print button's on Crystal Report Toolbar are not working . Cixking on to that they will show a exclamation marked yellow coloured triangle box written as " Done but errors on page." in status bar. Clicking on to that yellow triangle it will show "Object doesn't support this action" . if i browse from system having .net 2.0 (installed)  only that pictures and all vis...

Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Stu
Why Visual Studio 2005 ask me to convert a solution already got converted Somebody did the conversion of a solution from .net 1.1 to .net 2.0 by using the automatic conversion wizard of Visual Studio 2005. Then, he changed to another company. Now, I take over his job. Unfortunately, when I attempted to open that solution, Visual Studio 2005 prompted me the conversion wizard again to forced me to perform a conversion on the solution. Does someone know why?--Harish Patel Hi, How many projects are in the solution, does it have UNLOADE...

Web resources about - previewing and printing a report in ASP 2.0 with Crystal Reports and VS 2005 -

Facebook IOS App Update Adds Previewing Of Draft Posts, Post Creation With Poor Or No Connections
... iOS application Wednesday, and new features included the ability to create posts with weak or nonexistent connections, and the option of previewing ...

Previewing the President's trip to Israel, The West Bank and Jordan - YouTube
Deputy National Security Adviser Ben Rhodes previews the President's trip to Israel, The West Bank and Jordan

YouTube - Previewing the President's trip to Israel, The West Bank and Jordan
Veröffentlicht am 15.03.2013 Deputy National Security Adviser, Ben Rhodes, previews the President's trip to Israel, The West Bank and Jordan. ...

Ranked list: Previewing the new Snoop Dogg weed strains
The Leafs by Snoop brand, touting eight signature strains of cannabis, is now available in Colorado. Our pot critic checks out the Snoop Dogg ...

Google Drive revamped for iOS with improved previewing, file sorting, searching
... and iPhone, and iPod touch to appear more in-line with the designs of the company’s other apps on iOS. The new design focuses on improved previewing ...

And Boom Goes The (Nuclear) Dynamite: Previewing The Derptastic Sound Bytes You’re About To Hear
Senator Harry Reid finally invokes the so-called "nuclear option" to get President Obama's nominees on the D.C. Circuit. Here comes the combative ...

GeForce + Radeon: Previewing DirectX 12 Multi-Adapter with Ashes of the Singularity
Today we'll be taking an initial look into the unorthodox multi-GPU capabilities of DirectX 12. Developer Oxide Games, who is responsible for ...

Themer updated, makes browsing and previewing themes easier
Themer, which set the launcher craze into overdrive, has seen its first major update since launch. With the refresh, Themer promises easier navigation ...

Chalk Talk: Previewing Florida with Alligator Army
Chalk Talk: Previewing Florida with Alligator Army And the Valley Shook There just aren't that many battle-tested players on this team, which ...

Previewing McCain and Obama on geek issues
The Obama and McCain camps expound on their stances relating to net neutrality …

Resources last updated: 12/9/2015 2:34:30 PM