printing bill in the preprinted paper using crystal report - c#

I am working on the desktop application which needs to print the bill.I am currently using Visual Studio 10 and sql express as database.
I need to print the bill in the pre printed paper which has majority of the content.
I just need to add the customer name, some customer details and content of the bill which is saved in the database.
The pre printed bill has logo along with some basic information of the company....
so i need to fill the bill with name and search the data using stored procedure.
i will be grateful if anyone helped me in any way possible

Try scanning the hard copy paper into an image file, and setting that image file as the background on the report.
From there, just put a couple of the fields onto the report where it looks like they should go. Remove/hide the background and print a test page to find the offset. It should be pretty evident if the fields are generally a centimeter higher on the page than they should be. Then just adjust the fields accordingly.
I know it seems like a daunting task at first, but after the first one or two reports you will get the hang of it.
[Edit]
In the report itself, hide the header and footer and set the detail height to 7.5 (or whatever the full page height is, taking into account margins). Pass the report exactly one record with the values that need to be printed.
You may also consider using SQL Server Reporting Services (SSRS) instead of Crystal Reports. Crystal can be tricky to deploy with desktop applications. SSRS Express is free. You will just need to install SQL Server Express with Advanced Services.

Related

(Change Datasource) Prompt for Server and SQL Server database within Crystal Reports Viewer, Visual Studio (C#)

I'm using SAP Crystal Reports 2016 with the Visual Studio plugin, along with Visual Studio 2015.
What I've done is created a simple MDI application using C# which contains multiple Crystal Reports Viewer forms which open an embedded report in a child window when the menu item is clicked. This application will sit on our development server and be used to run reports against client databases that get sent to us with problems.
Here's the issue. We've got multiple instances (and versions) of SQL Server running and we are getting multiple test databases daily which of course will be named differently. The reports are looking for a specific database only.
What I would like to do, is either on form load or via a button click, be able to have a box prompt the user for server and database name. For example:
SQLServer\SuperCoolInstance
My_Cool_Database
The report would then connect to that database and display relevant information.
Any idea on how I could accomplish this? Second best scenario would be to have something like an XML file that contains the server and database and the program looks at that when launching. Even though we'd have to edit the XML whenever we wanted to change datasources it would be something! I wouldn't know how to pursue that avenue either though.
I would think that this must be possible because at a previous company that I worked for, they actually sent compiled Crystal Reports (in exe format) to clients to run on THEIR systems and it looked to an already existing XML file.
Thanks very much in advance for any ideas or guidance.
Cheers.
EDIT - I thought I should point out that all the SQL Server databases that this would run on would have identical schema but different data obviously. Not that this probably matters for this particular question, but just in case. :)

Crystal Report Viewer Failed to Open Connection

I am attempting to create a simple Crystal Reports Viewer so we can view already built reports on multiple machines without needing crystal installed.
We are using Sage 100 Contractor which utilizes the .dbf format for its database.
I understand the basics of loading a report in the viewer, however the issues I am running into come from the fact that the data isn't always embedded in the reports. For certain ones I need to allow the users to select the database to run the report off of.
Example database location
C:\MB7\Sample Company
I have tried multiple different things, but I am sadly just not correctly understanding how to properly set the DataSource location before I load the report in the crystalReportViewer module.
I can give snip-its of my code, but that won't really show anything as nothing I've tried has correctly set the DataSource.
My guess is that your code didn't succeed to set the database connection. Are you able to run the report on your development machine ? If yes then, the problem is related to the ODBC DSN on the other machines. If you are not able to run it even on your machine then check if you are able to run the report form the designer. It will help if you share the code, which is setting the connection.
There are cheap tools on the market , which will be able to do what you are looking for a fraction of the development price. Here is a link to a tool , which you can use for free:
http://www.r-tag.com/Pages/FreeCrystalReportsViewer.aspx
Even if you decide to continue with the development of your tool you can check if the one above is able to handle the report. This will be an easy way to find if the problem is in your code or it is related to the DSN.

How do i make use of .rdlc reports created using the VS 2008 Report Wizard?

I have a c# project where i created a dataset, then when through the steps of creating 3 reports via the Report Wizard. The rdlc files are now in my project and i have a reportviewer control in my Winforms project. The question is, after going through the process of setting up the dataset and reports, how do i get any of them to display in the reportviewer? When i try to set the ReportEmbeddedResource to be one of the rdlc files, i get a message in the viewer saying the source of the data has not been set. I did that when i created the data set and the report.
Any ideas?
Here is a detailed tutorial on how to use Local Reports : http://msdn.microsoft.com/en-us/library/ms252075%28v=vs.90%29
I had to do this last year, Local Reports are kind of a headache. The problem is .rdlc files do not fill their data sets (they ignore all the <Query tags. So, what I had to do is write a custom .ascx that would parse the <Query> tags in the .rdlc, fill the DataSets, and pass the new file to the ReportViewer control.
Basic steps:
1. Build a set of input fields based on the QueryParameters inside any <Query> tags. This usually involved cascading comboboxes since parameters can be dependent.
2. When the user submits the form, fill the DataSet associated with each <Query>.
If you look at the way you input parameters in VS 2008 when you test an RDL, the control you will make does exactly that.
All of this had to be done because of a client request to not have to authenticate when running the report...ugh. The fun thing is, I never found a complete schema for RLD/RDLC XML so I had to look at a lot of report files to figure out all the variations.
EDIT: I missed the part where you said WINFORMS. My scenario was for Webforms, though it might still apply I've never used the ReportViewer control in Winforms.

Reporting tool which print the control which we pass on that

What is the best reporting tool other than crystal report using with c# and mysql because crystal report has to be downloaded in user machine ? So what is the other alternative of the crystal report for using c# with mysql and should be less in size and user will not have to need to download more.And it should be with good features. (All open source and with paying charge.)
EDIT: I have need of printing only control on the form dynamically, like if user want to print third party control then also it should be printed, but it should not be printed like image of the treeview like if user wants to print the treeview on the window form but treeview is collapsed by user so here if user prints this treeview then it should not be printed collapsed treeview and but it should be printed whole the treeview(expanded).
Not a reporting tool at all, but if you're most interested with simply having a PDF output I recommend iTextSharp. You can then fill the report with place holders to be replaced with variables as you would any software - prior to the user downloading it.
Not the best method I agree, but it all depends on what you're looking for.
Two options for you to use
SQL Reporting Services - this has a requirement that you install a Microsoft SQL server with SRS but your reports themselves can connect to other databases, including MySQL (via ODBC) and you can then use the ReportViewer component in your C# applications to render it. There is no additional downloads for the user as the processing happens server side, plus it is easy to embed into web apps, SharePoint etc...
Visual Studio 2010 does ship with fantastic reporting controls which can use any data source. If you on 2008 you can use the out of band release of these same controls. In all cases these are just code so it's a few extra assemblies to deploy. You can see samples of these in: http://code.msdn.microsoft.com/mschart

Reporting Services 2005 Report with Disclaimers page after each section

Details:
I am using Reporting Services 2005 in a C# Application with Visual Studio 2008 to generate reports based on a SQL Server 2005 database. The application views the report locally using the .net report viewer and no report server is used. There is a page break in the report after each person. I am currently using just one report table for the .rdlc file to generate the report.
Question:
My client wants to put a disclaimers page after the grouping has ended for each person listed on the report. The client wants to be able to adjust the disclaimer page on the fly through the user interface, before running the report. Please offer suggestions on how I can accomplish this.
Any help is appreciated.
Thanks,
Jeremy
An alternative solution would be to create another report for the sole purpose of rendering the Disclaimer content. The Disclaimer report can then be embedded (via a subreport: see http://msdn.microsoft.com/en-us/library/ms160348.aspx) into your existing reports thereby allowing you to dynamically modify the content of the Disclaimer separately.
You could store the actual Disclaimer content within a SQL Server Database table and update it via any number of the typical simple standard .NET controls that are at your disposal.
This has the advantage of no character restrictions as per the prior recommendation.
Do you mean they want to adjust it on the fly PRIOR to executing the report or after?
If before, could you not use a parameter, with the disclaimer template as the default value and submit it to the report when they are done? You could then put the parameter in the group footer.
If after then...good luck :) The report is rendered into whatever format chosen. If you are retrieving the report in html and have the rendered file perhaps custom parsing could be done but seems a bit naff. Been a while with SRS, hopefully the param could work for you.

Categories