473,698 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the best way to create and print reports?

Hi,
I'm writing a program that helps manging a store. i have one form that deals
with products selling, in this form the user enters the customers details and
the products which he bought. after the user payed for these products, i want
to print a invoice, and now i don't know which way is the best one? one
option i know, is to draw the invoice by myself (using drawlines and etc.),
second way is using crystal reports, i'm not sure which way is better, and if
there any other ways.. so if any one can help me, i will appreciate it.

Thanks,
Gidi.
Nov 17 '05 #1
4 4696
Hi,

Between the two options that you mention I thnk that CR is the best, you set
the ReportDocument. SetDataSource() to a dataset containing the invoice data
you want and that's all

making & printing a report manually is a big pain..... you have to deal
with page break, margins, printers, etc
cheers,

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

"Gidi" <sh*****@hotmai l.com.dontspam> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
Hi,
I'm writing a program that helps manging a store. i have one form that
deals
with products selling, in this form the user enters the customers details
and
the products which he bought. after the user payed for these products, i
want
to print a invoice, and now i don't know which way is the best one? one
option i know, is to draw the invoice by myself (using drawlines and
etc.),
second way is using crystal reports, i'm not sure which way is better, and
if
there any other ways.. so if any one can help me, i will appreciate it.

Thanks,
Gidi.

Nov 17 '05 #2
Actually you write your own printable components and alignment panels
that know how to print themselves, slide and print across page
borders... so you just drag, drop and print :)

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
If I were you I would use Crystal Reports.

That said, there are two ways to use CR. One is the way that Ignacio
mentioned: the "push" model. Put your data in a DataSet, and push your
DataSet at CR by calling ReportDocument. SetDataSource() . The other way
is to write your invoice to a database (which maybe you were going to
do anyway) and then write a Crystal report that knows how to get the
invoice information back out of the database and report it.

We do things the first way (the way that Ignacio suggested). It's a bit
tricky, but once you get it figured out it works OK.

However, if you're using a database, the second way may be superior.
It's the more "usual" way of using CR, and CR tends to behave better
when used as a "pull" reporting tool rather than accepting a "push". As
well, it serves as a confirmation that you have, in fact, committed the
invoice information to the database. No commit, no report.

Either way, it's not terribly difficult, and CR gives you the
flexibility to easily change the look of your invoices, or even have
multiple invoice formats that you can switch between depending upon the
situation.

CR also gives you export-to-PDF and other nifty features for free. Why
reinvent the wheel? CR isn't the best reporting package out there, but
it beats anything you can do yourself.

Nov 17 '05 #4

"Bruce Wood" <br*******@cana da.com> wrote in message
news:11******** *************@g 43g2000cwa.goog legroups.com...
If I were you I would use Crystal Reports.

That said, there are two ways to use CR. One is the way that Ignacio
mentioned: the "push" model. Put your data in a DataSet, and push your
DataSet at CR by calling ReportDocument. SetDataSource() . The other way
is to write your invoice to a database (which maybe you were going to
do anyway) and then write a Crystal report that knows how to get the
invoice information back out of the database and report it.

We do things the first way (the way that Ignacio suggested). It's a bit
tricky, but once you get it figured out it works OK.

However, if you're using a database, the second way may be superior.
It's the more "usual" way of using CR, and CR tends to behave better
when used as a "pull" reporting tool rather than accepting a "push". As
well, it serves as a confirmation that you have, in fact, committed the
invoice information to the database. No commit, no report.


Hi,

Regarding accesing the DB directly you should always set the connection info
using code, put the DB info in the config file and use the code below to
make sure you don't get a nasty popup ( or an Exception) asking for the
connection info. Notice that you need to set this info to all the tables of
the report:
TableLogOnInfos crTableLogonInf os = new TableLogOnInfos ();
ReportDocument reportDocument1 = new OpenRecords(); //this is the
report

ConnectionInfo crConnectionInf o = new ConnectionInfo( );
crConnectionInf o.ServerName =
System.Configur ation.Configura tionSettings.Ap pSettings["Server"];
crConnectionInf o.DatabaseName =
System.Configur ation.Configura tionSettings.Ap pSettings["DataBase"] ;
crConnectionInf o.UserID =
System.Configur ation.Configura tionSettings.Ap pSettings["User"] ;
crConnectionInf o.Password =
System.Configur ation.Configura tionSettings.Ap pSettings["Password"] ;

foreach (CrystalDecisio ns.CrystalRepor ts.Engine.Table table in
reportDocument1 .Database.Table s)
{
TableLogOnInfo crTableLogonInf o = new TableLogOnInfo( );
crTableLogonInf o.TableName = table.Name;
crTableLogonInf o.ConnectionInf o = crConnectionInf o;
crTableLogonInf os.Add( crTableLogonInf o);
table.ApplyLogO nInfo( crTableLogonInf o);

}
CrystalReportVi ewer1.LogOnInfo = crTableLogonInf os;
CrystalReportVi ewer1.ReportSou rce = reportDocument1 ;
cheers,

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

Nov 17 '05 #5

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

Similar topics

2
2314
by: Luis Serrano | last post by:
Hi all, I'm trying to generate labels to print in several different formats, all of them with their own height,width and page margins. We've got this done in MS Access 2000, using a designed report that fits with each label type, and reads a table dinamically generated. But the problem is page margins. Does Access store page margins and information of that kind within de report? Is there any kind of association between printer...
0
3258
by: banderas | last post by:
Just wondering if it is possible to use access to create grpahs and even print reports? Is it possible to link excell with access so one can be the date base and when graphs and analytical reports are needed, I can call excell?
0
2259
by: Ian | last post by:
(Sorry if I have repeated this, it did not appear the first time) I have the following code on a button. The idea is that when this button is clicked it prints several reports automatically then loops through several other reports and prints them. These reports are not sent to a printer but sent to a program called Fine Print PDF Factory which turns them into a PDF file (set as the default printer) This all works perfectly unless any...
0
1802
by: Ann | last post by:
I have a C# application that uses PrintDocument and PrintPage to draw reports. Now I need to integrate a tax form printing from a legacy VC++ DLL into the C# application. One of the important requirements is that the printing of the reports (implemented by C#) and the tax form (implemented by VC++) to be on the same print job. For example, if there are 10 clients we need to print the reports and tax form for, then 10 print jobs will be...
8
3156
by: Midnight Java Junkie | last post by:
Dear Colleagues: I feel that the dumbest questions are those that are never asked. I have been given the opportunity to get into .NET. Our organization has a subscription with Microsoft that basically entitled to us to just about every .Net development tool you can imagine. I cant even begin to mention them. To begin with, my background is not that of a programmer, but a systems engineer and the closest I have come to "programming"...
3
1874
by: Przemo | last post by:
Hi, I have an ASP.NET 2.0 application. I need to generate some documents (reports) like invoices, orders, etc. Users need them to preview and print. Which of methods is the best for doing it: 1. Creating HTML page containing data (problems with rendering and unexpected behavior when dynamic text is too long), 2. Creating invoice as a XML and then transforming it into ready document using XSLT 3. Rendering document as a GIF just writing...
2
1321
by: Hexman | last post by:
Hello All, I'm now getting into the reporting phase of my application development. I need to print not only continuous page reports from a datasource (database, datagridview, listboxes, etc), but also some single page reports which the content is derived from calculated variables, constants, etc. I'm using VB.net Pro so CR seems like the answer, at least for the reports from the datasources. How about for the reports using internal...
2
6686
by: Thall | last post by:
Hey Gurus - I've seen a few solutions to this problem, but none of which I can do without a little help. Here's the situation The following code loops thru a sales report, using the sales rep ID as a filter so that multiple reports are created. This is now generating a PDF report, but I need to change it to RTF documents. My question is, since I can't create an RTF using open report, is there a way to use the strFilter with the OutputTo...
3
18708
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however, working with complex reports is tricky Assumption: Reader of this article have basic knowledge of creating data reports. Creating a Parent-Child Command and create a DataReport Suppose we have a database called company with two tables ...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9170
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
9031
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
8902
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,...
1
6528
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
4623
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2339
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
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.