incrementing Number in Crystal Report - vb.net

When I Click the button there should be a incrementing number in the report so i can track how many transaction did i print.
Dim dt As New DataTable
dt = Me.grvData.DataSource
Dim Cr As New VoucherExpense
Cr.SetDataSource(dt)
Dim r As New ReportForm
r.CrystalReportViewer1.ReportSource = Cr
r.ShowDialog()

If you want to have a count of your records then that is a summary field and very easy to do. Rather than try to tell you where to click in the UI you can look at a video https://youtu.be/-i2p5KPDl48?t=1m32s
BUT if you want to have a number for each record given by crystal you can also use rownum which is one of the special fields of crystal (other special fields are page number or print date etc). You can make a formula and just put rownum).

Crystal Reports (and any other reports) are used to display/print data. You can format it or do calculations on the data given e.g. a count of the records in that report or a sum to show totals BUT once the report is closed it will not "remember" anything. So to get the number of times a transaction was printed you have to increment and save it in your database. So the number of times it was printed is one database field on that row and your button should to an update/increment of that database value right before you show the report. If you want to store the actual "Print" to the printer and not just preview of the report on the screen then you can put your database increment logic on the event handler of the print button of the crystal reports viewer

Related

VB.Net & RDLC reports: Display dataset records as fixed fields

I'm developing a rdlc report, that uses the data from a dataset, programmatically filled (from VB.Net). I need to display the data of the dataset as in the linked photo, so not in a classic "table" way, but each page of the report will concerne only one record of the dataset. Any cells of first page will be filled with the data of the first row of the dataset, the second with the second and so on.
Is it possible to display the report in this way with rdlc?
Further to my comment, I believe it's possible to do what you want using the table, with a bit of work on the layout.
Start by adding a table in the normal way, and get that basically working ie so that it shows all the data across one row. Then work on re-arranging the cells so that they are in vertical columns. Do this by right-clicking in the shaded area to the left of the rows, and select 'Insert Row'
Finally create a group around the whole thing, and group by Item Number or w/e is appropriate for your data. Then in the 'Row Groups' window at the bottom of the designer, right click your new group and select 'Group Properties > Page Breaks > Between each instance of a Group.
This should get you pretty close to your required layout.

How to program crystal report to lookup a record in a table

i Have a Table with Fields
Material Number
Order Code
Supplier Code
Description
I have a crystal reports rpt file that i manually enter all the information to generate labels.
I am trying to program this using the built in formula editor, so when i enter the Material Number (which is a unique code) it will automatically display other 3 relevant fields.
I have tried few formulas in the formula editor without any luck.
can anyone help?
relliK
UPDATE
#Siva - I have added the table for clarification
i simply want a lable printed with only one user input being the Material Number, and then the code/fomula in crystal reports to fetch the other data based on the Materila number and produce the label.
thank you for you interest in this issue.
UPDATE
#Siva - I have added a sample label, i would only want to enter 20506871 as Material and the other data fields to be pulled from excel
not sure if i can use parameter fields and/or i would like some help on programming the parameter fields

Using CR subreports for displaying two distinct reports in one blank main report

I have written a sql query for a view that return some information but when grouping in a CR report some data gets mixed and exact data is lost. what i did is to create two reports when testing, each report return the data i want ( one report for canceling fees and other for earnings ). I then had the idea to create two subreports for each correct report and display both of them in a main report. both report use a SQL view and have formula fied which filter some dates.
When i try to display those subreport in a report all i get is a blank report with no data. i tried to link those subreport with a field but eventough. no data was shown.
Could someone point me some track for getting this work ?
Thank you in advance

Report Viewer using multiple reports

Within vb.net we've got a report that works great it has it's header/footer details then then a table in the middle which repeats data and all of that is fine.
But what the client wants now is for another button named 'Print Individual' and this will print the same report but instead of the repeated data within the table for each of those rows to be a single row on a page with the same header/footer.
So for example on the first report if there is one page with 5 rows of details the 'Print Individual' report will print the same but have 5 pages and 1 row per report. If that makes sense :-)
Obviously if I can do it where we use the same report instead of maintaing two reports would be good, as the report has a lot of information on it. Any ideas?
I ended up creating a new report and using the list box tool.

Images in Crystal Reports

I am working on Windows Forms Projects.
I am creating a report for customers.
The report data is pulled from a "CustomerDetails" table.
A field in the table is called "CustPhotoName", this holds a string which relates to an image file.
I Currently have a report set up which runs for a single customer by passing in a customer ID. Then using the passed in ID to populate a Dataset with an ImageRow and then a sub report with the image from the dataset.
I am wanting to set up this report where I can pass in an array of customer IDs and produce the reports (1 page per customer with image (if CustPhotoName has value))
Please can someone let me know how is the best way to do this for the multiple customers.
Add a CustomerID parameter to the report. Type Number. Set it to allow multiple values. In the report's record-selection formula, add the following:
AND {table.customer_id} IN {?CustomerID}
You probably want to group the report by {CustomerID} as well. In the group's footer, select Section Expert and check New Page After. This way each customer will start on a new page.