crystal report and avery 5160 in vb - vb.net

I created a avery 5160 report in Crystal Reports through the wizard. When I pass my values to Crystal it is only showing 1 label in the report viewer.
Do I have to tell Crystal I want 30 of these to print on one page in code?
Is there a way to check my settings after the wizard completes?
Here is my report code:
Dim report As New Avery5160()
Dim ds As DataSet = New DataSet
Dim dt = New CrystalDS.DataTable1DataTable()
ds.Tables.Add(dt)
report.SetDataSource(ds)
dt.Rows.Add(bmpBytes)
report.SetParameterValue(0, Desc)
report.SetParameterValue(1, WriteUPC)
CrystalReportViewer1.ReportSource = report
CrystalReportViewer1.Refresh()

I was able to figure it out by creating a loop to add the item 30 times to the report.
For i = 0 To 29
dt.Rows.Add(bmpBytes)
report.SetParameterValue(0, Desc)
report.SetParameterValue(1, WriteUPC)
Next

Related

display two items data in Ms Chart Control VB.Net

I'm new to MS Chart control. I want to display sql conditional result in chart control. This is my codes
Dim strQry As String = "SELECT format(sDate, 'MMMM-YYYY') AS [Month], iCode as [Item], Sum(iQty) AS [Total Qty] FROM Sales WHERE iCode ='DJ100106' OR iCode='DJ100107' GROUP BY format(sDate, 'MMMM-YYYY'), icode ORDER BY cDate(format(sDate, 'MMMM-YYYY'))"
Dim dt As New DataTable
Dim da As New OleDbDataAdapter(sqlQry, Conn)
da.Fill(dt)
Chart1.Series(0).Color = Color.YellowGreen
Chart1.Series(0).XValueMember = "Month"
Chart1.Series(0).YValueMembers = "Total Qty"
Chart1.Series(0).IsValueShownAsLabel = True
Chart1.DataSource = dt
For one condition in WHERE clause, chart control displays the bars correctly. If I add more condition such as "OR iCode = 'DJ100107'", chart control displays inappropriate bars and values in X axis.
I want to compare these two items (DJ100106 and DJ100107) sold in every month in chart. Grid control displays the exact result what I want. But the chart control doesn't. (As shown in the attached image). I am using VB.Net 2012, MS Access Database 2007
Can anyone help me how to solve this?
Thank you

How to bind and display multi line chart to form?

I am using VB2017 and have data returned from Stored Procedure and I have filled a DataTable with data. The data in Datatable sample is
Date Bill Fred Jack
Date1 25 115 33
Date2 88 15 24
Date3 41 31 162
I have set UltraChart datasource to the datatable and then Bind data
Dim datTab As New DataTable
Using da As New SqlDataAdapter(cmd)
da.Fill(datTab)
End Using
ugResolved.Data.SwapRowsAndColumns = True
ugResolved.Data.DataSource = datTab
ugResolved.Data.DataBind()
When I run The chart isn't displayed. Get Box with the following text in it. Data Not Available. Please call Ultrachart.Data.DataBind() after setting valid Data.DataSource.
I have set the dataSource. What I am missing. Just starting using these controls. I have gotten the UltraGrid and UltraChart StackColumnChart working. Can anyone advise what I am missing.
I posted to Infragistics forums but still waiting couple of days later.
I would like a line for each name with line going from day to using the numbers as their path for each date

when I choose a value from the first compbox is the value of the remaining compbox is changed

I have 3 compobboxes I have created an import code from a SQL table
The problem when I choose a value from the first compbox
the values of other compbox is changed to be like my choice
I made a separate code for each compbox
But I find it impractical because my project has 90 compoboxes
It needs time to run
Is there a more practical solution?
this is my code...
Dim com As New SqlCommand("select Distinct Name1 from TB_dr", Con)
Dim RD As SqlDataReader = com.ExecuteReader
Dim DT As DataTable = New DataTable
DT.Load(RD)
ComboBox1.DisplayMember = "Name1"
ComboBox1.DataSource = DT
ComboBox2.DisplayMember = "Name1"
ComboBox2.DataSource = DT
ComboBox3.DisplayMember = "Name1"
ComboBox3.DataSource = DT
Only populate a combobox on its dropdown event.
That will make your app faster cause your client may not use them all and if he uses one combobox he would populate a small amount of data only.
And no data is populated on load.
As i look at what you are trying to do which is same data for all comboboxes, you can simply put all your comboboxes in a group, and go through your group to populate them all at once.
like for each cb in that group, cb.datasource = dt.
call the datatable once

how to set numbers of copies to print in crystal reports

I need to print 2 invoice copies; one for the customer and one for the counter. I'm using Crystal Report 8 with Vb.Net 2005. Can anyone give me a direction for this?
I have tried this, but nothing happens. DT is my datatable
Dim x As New crptInvoice
x.SetDataSource(DT)
x.PrintToPrinter(2, True, 1, 2)
crptViewer.ReportSource = x
crptViewer.Refresh()
Use PrinttoPrinter to specify N Copies of report to print
rptDoc.PrintToPrinter(2, True, 1, 1)
which reads as:
2 = nCopies as integer
True = collated as Boolean
1 = StartpageN as integer
1 = EndpageN as Integer
also, your line
crptViewer.ReportSource = x
crptViewer.Refresh()
is used if you want your report to be viewed using a reportViewer hence the name crptViewer
while PrinttoPrinter automatically sends your report to the print queue

Hide column in datagrid (Framework 2.0)

I'm building an app for Win CE 5.0 in VB.net framwork 2.0. I have a DataGrid (note: no DataGridView! :-)) with a DataTable as source.
In this case I want the last column to be hidden. I still want this value in this column if i call for it, but I want it invisible for the user. How can i do that..?
Edit: This is what i have
Dim Table As DataTable = New DataTable("myTable")
' Filling my table ... '
MyDataGrid.DataSource = Table
I have tried this before setting the datasource, but no luck (i try with index 0 just to test)
Dim Table As DataTable = New DataTable("myTable")
' Filling my table ... '
Table.Columns(0).ColumnMapping = MappingType.Hidden
MyDataGrid.DataSource = Table
But no column is hidden.