473,796 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Crystal Reports

Dear NG,

I am just learning object orientated programing in general and C# in
particular.
My first real project is an inventory application using a SQL database. I
have
an item master editor working fine now and it is time to write some paper
reports
from data stored in SQL. I decided to give Crystal Reports a try.

By using the Wizard I have CrystalReport1. rpt sitting as a tab in my
project.
The book that I bought, Using Crystal Reports 10, gives an example in VB:

Dim Report As New ReportDocument
Report.Load("C: \My Reports\Sales.r pt")

What is the equivalent C# execution? I assume that I am going to need a
using statement. The VB Dim statement is probably the C# instantiation.
If I am going to have a path in C# I am probably going to need
double \\ as in: "C:\\My Reports\\Sales. rpt" Am I on the right track or
way off base?

Thinking now about this issue on a higher level, is Crystal Reports the best
way to go? I am an old dude and can code COBOL style reports from scratch.
What about generating text files and just printing them. What is the
procedure
for loading a general Windows printing object? Since reports are likely to
be long, I wish not to display the report on the screen, but generate the
report to a file and then have the user go to the File menu and select
Print File to begin this process.

In this posting I am looking for both direction and some specific C#
statements.

Thanks in advance,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com
Nov 16 '05 #1
7 7682

hi,

don't compare syntatical resemblence. I will explain what is happening
over here.

that vb.net code block try to load a report file to reportdocument object.

I will explaine how it happening in C#.

First you have to riht click your project folder to add an
CrystalReport1. rpt file.
Once you add this .rpt file to your solution it will give a wizard that will
help you out to set the table or dataset(tables) .

After successful completion of this (that is adding one .rpt file) you have
to use
crystalReportVi ewer1 to view the report. This much thing you can achive by
using the .NET IDE or programmaticall y.
Nov 16 '05 #2
Hi Sreejith,

Thank you for the information. I am having a little trouble understanding
your answer. Here is my current status:

1/ I have the CrystalReport1. rpt file in my solution.
2/ Unsuccessful in using the CrystalReportVi ewer as it is "grayed out" in
the Toolbox under Web Forms.
3/ Can not call anything from my code to execute the report. I would think
that there should be a namespace for CR objects and there might be an object
containing a method for viewing the report.
4/ Is CR the best way to write reports?

Cheers,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com

"Sreejith S S Nair" <Sr************ @discussions.mi crosoft.com> wrote in
message news:B0******** *************** ***********@mic rosoft.com...

hi,

don't compare syntatical resemblence. I will explain what is happening
over here.

that vb.net code block try to load a report file to reportdocument object.

I will explaine how it happening in C#.

First you have to riht click your project folder to add an
CrystalReport1. rpt file.
Once you add this .rpt file to your solution it will give a wizard that will help you out to set the table or dataset(tables) .

After successful completion of this (that is adding one .rpt file) you have to use
crystalReportVi ewer1 to view the report. This much thing you can achive by
using the .NET IDE or programmaticall y.

Nov 16 '05 #3
Hi Robert,

take a look at http://www.crystalreportsbook.com/Default.asp it's a FREE
book about using CR with .net

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Robert Schuldenfrei" <bo*@s-i-inc.com> wrote in message
news:ljKQc.2179 50$IQ4.217278@a ttbi_s02...
Dear NG,

I am just learning object orientated programing in general and C# in
particular.
My first real project is an inventory application using a SQL database. I
have
an item master editor working fine now and it is time to write some paper
reports
from data stored in SQL. I decided to give Crystal Reports a try.

By using the Wizard I have CrystalReport1. rpt sitting as a tab in my
project.
The book that I bought, Using Crystal Reports 10, gives an example in VB:

Dim Report As New ReportDocument
Report.Load("C: \My Reports\Sales.r pt")

What is the equivalent C# execution? I assume that I am going to need a
using statement. The VB Dim statement is probably the C# instantiation.
If I am going to have a path in C# I am probably going to need
double \\ as in: "C:\\My Reports\\Sales. rpt" Am I on the right track or
way off base?

Thinking now about this issue on a higher level, is Crystal Reports the best way to go? I am an old dude and can code COBOL style reports from scratch. What about generating text files and just printing them. What is the
procedure
for loading a general Windows printing object? Since reports are likely to be long, I wish not to display the report on the screen, but generate the
report to a file and then have the user go to the File menu and select
Print File to begin this process.

In this posting I am looking for both direction and some specific C#
statements.

Thanks in advance,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com

Nov 16 '05 #4
Hi again robert,

in addition to the link I sent you I want to let you know that you dont have
to load a report in the code, by default CR create a class derived from
ReportDocument named like your report, you just create an instance of this
report.

Dim Report As New ReportDocument
Report.Load("C: \My Reports\Sales.r pt")

What is the equivalent C# execution? I assume that I am going to need a
using statement. The VB Dim statement is probably the C# instantiation.
If I am going to have a path in C# I am probably going to need
double \\ as in: "C:\\My Reports\\Sales. rpt" Am I on the right track or
way off base?

Thinking now about this issue on a higher level, is Crystal Reports the best way to go? I am an old dude and can code COBOL style reports from scratch. What about generating text files and just printing them. What is the
procedure


CR is the way to ge with no doubt, especially in win apps. learn it and it
will make your work a lot more easy.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 16 '05 #5
To reply to the part the others did not:

"Robert Schuldenfrei" wrote:
Dim Report As New ReportDocument
Report.Load("C: \My Reports\Sales.r pt")

What is the equivalent C# execution?


ReportDocument Report = new ReportDocument( );
Report.Load("C: \\My Reports\\Sales. rpt");

Note: Dim Report As NewReportDocume nt would not work in VB.NET. Anytime you
call a constructor you need open and close parenthesis, even for the default
constructor.

Some good resources for C#:
http://www.c-sharpcorner.com
http://msdn.microsoft.com

Tons of other sites are available, just go to http://www.google.com and type
in C# + .net and you'll get a few thousand results. If you're serious about
learning C# I suggest getting a book to reference.

HTH
Nov 16 '05 #6
Dear NG,

Thanks for all of your help. I got my first CR report to execute. I now
have to sit down and learn this system. Here is the code that did it:

private void btnCrystal_Clic k(object sender, System.EventArg s e)
{
ReportDocument report = new ReportDocument( );

report.Load("C: \\database\\MCS-3-SQL\\MCS-3inC#\\ItemMast er\\ItemMaster\ \Cry
stalReport1.rpt ");

report.ExportTo Disk(CrystalDec isions.Shared.E xportFormatType .RichText,"C:\\ t
mp\\CrystalOut. rtf");
MessageBox.Show ("Crystal");
}

Cheers,

Bob

"Robert Schuldenfrei" <bo*@s-i-inc.com> wrote in message
news:ljKQc.2179 50$IQ4.217278@a ttbi_s02...
Dear NG,

I am just learning object orientated programing in general and C# in
particular.
My first real project is an inventory application using a SQL database. I
have
an item master editor working fine now and it is time to write some paper
reports
from data stored in SQL. I decided to give Crystal Reports a try.

By using the Wizard I have CrystalReport1. rpt sitting as a tab in my
project.
The book that I bought, Using Crystal Reports 10, gives an example in VB:

Dim Report As New ReportDocument
Report.Load("C: \My Reports\Sales.r pt")

What is the equivalent C# execution? I assume that I am going to need a
using statement. The VB Dim statement is probably the C# instantiation.
If I am going to have a path in C# I am probably going to need
double \\ as in: "C:\\My Reports\\Sales. rpt" Am I on the right track or
way off base?

Thinking now about this issue on a higher level, is Crystal Reports the best way to go? I am an old dude and can code COBOL style reports from scratch. What about generating text files and just printing them. What is the
procedure
for loading a general Windows printing object? Since reports are likely to be long, I wish not to display the report on the screen, but generate the
report to a file and then have the user go to the File menu and select
Print File to begin this process.

In this posting I am looking for both direction and some specific C#
statements.

Thanks in advance,

Bob

Robert Schuldenfrei
bo*@s-i-inc.com

Nov 16 '05 #7
Hi,

ReportDocument Report = new ReportDocument( );
Report.Load("C: \\My Reports\\Sales. rpt");


I strongly recommend not to use this construction, unless that the report
change dynamically, you would have to deal with an extra file on your
instalation as well as make sure that the path is correct,etc

It's MUCH safer to use the class that is created by the CR designer.
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
19187
by: Stephan | last post by:
Hi, I'm using Visual Studio 2003 (C#) with the integrated Crystal Report software and have the following question: How can I assign a value (string) to an unbound (string) field in Crystal Report at runtime? Example: private void button1_Click(object sender,
5
3028
by: BStorm | last post by:
I have a transaction log file where the DataSet table's Description column is actually delimited into "subcolumns" based upon the transaction id. I would like to parse these into separate fields for reporting purposes and am wondering if anyone knows if this is easily accomplished using the .NET version of Crystal Reports? For example, the description column may be reporting on a dataentry error as follows: TXNCODE: 1010001
3
6917
by: Gheaci Maschl | last post by:
Hi all! I would like to have your opinion about my problem and my proposal how to solve it: Ingredients: - BTriev database - Crystal Reports - maybe MS Access - Liinos6 (small ERP software)
7
5027
by: p | last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also have Crystal 9 pro on my development machine. The web app runs fine on my dev machine but am having problems deploying. I created the websetup and built the MSI, have the bundled version. Copied to webserver and ran Websetup.msi. Said I had to remove old version, which I did, then reran WebSetup.msi and keeps giving me this error. "The installer was interrupted...
0
2351
by: Robert Warnestam | last post by:
Hello, I have some problems deploying Crystal Reports. I'm using Visual Studio 2005 Beta 1. In this version Crystal Reports (9.7.3500.0) is included. I created a small test application (ASP.NET) that shows a simple report. It work fine with on my local computer. Now I'm trying to deploy this sample application on our web server but I really need some help.
3
8924
by: VMI | last post by:
I know this may not be the best NG for this, but I feel you guys know more about this than any of the other NGs. I need to build several simple reports (over 50 of them and they get their data from sql server) and I was wondering whish of these is the better tool .. We're still not sure if they'll be loaded from an existing VB6 application or if I'll have to make a separate module for them (in .Net). In general, which is the better tool?...
1
4318
by: Lyners | last post by:
Hello all, I have created an ASP.NET website that uses Crystal Reports that works on the localhost (my PC), but when I copy it to the server it does not. The problem is ExcelUseConstantColumnWidth = False. On my PC when exporting a report, it works - columns are varible width to fit the field, from the server it does not - I get constant width columns. I suspect it is a DLL issue, but so far all my comparisons are coming out the same.
2
446
by: =?Utf-8?B?Um9zcyBNYXNvbg==?= | last post by:
Hi I am interested in using crystal reports for the first time but have a few questions that someone maybe able to help with before I get started. The background to my query is that a client is interested in using crystal reports as a web based reporting tool to get data out of a sql server database and we have always created our own bespoke reporting tools but this particular client wishes to go down the crystal reports route. 1) We...
3
3827
by: Miro | last post by:
Hi, Just wondering what a good book is on visual studios 2008 ( or 2005 if no 2008 ) that teaches you how to properly use crystal reports with it. Or im assuming that as long as I can create a dataset and link it to a reportviewer than any Crystal Report book will do. I use vb.net but im assuming most books would show you vb and c
1
8147
by: =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?= | last post by:
On reflection, you could possibly make the app a self extracting zip file which extracts the EXE and a settings file and then starts the app, then when you app closes, it can repack the settings file and itself into the exe. You would probably want a tool for this bit which could be in the zip too. So the app isnt single exe when running but when not running, it is. Just an idea for you to think about. Another option would possibly be to...
0
9527
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10453
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10172
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.