Hi everyone ....

I have problem with printing the invoice as follows and I hope you can help ....

I have a table selling wholesale (material constant), such as ::: PC - Laptops - Router .... Etc.
When the arrival of a customer the invoice will be as :

Laptop : 9
computer : 8
Router : 0

And now I want print an invoice with only the first and second columns, because the third field (value of 0, and is not the logical to print it in the invoice)

I use CrystalReport and my code that I used in the print button:

Try
            Dim rep As New CrystalReport14
            Dim d As New DataTable
            d = DBDataSet.mat

            rep.SetDataSource(d)
            Form2.CrystalReportViewer1.ReportSource = rep
            Form2.Show()
        Catch ex As Exception

        End Try

With this code I was able to print all values (including zero) and this did not achieve the desired ...

Thank you ...

Recommended Answers

All 2 Replies

before rep.SetDataSource(d) have only those rows for which value is not 0. If your using any database you can do it in query or else you can remove the rows using dataview.rowfilter option.

My friend ...
thank you for your advice ...
First , I did this way in datagrid to hide (0's values columns) ...
Second , My problem solved as following :::
1. Right-click on field.
2. Select "Format Field".
3. Click the "Customize" button.
4. suppress if zero

Anyway thank you very much for your help ....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.