Click here to Skip to main content
15,915,019 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Crystal Report Always ask login when vb.net extrated exe installed and run on client pc. I used vb.net with access database.
The Code is given below . Please help to correct it.


Public Class barcode
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

Dim stringFormula As String

CrystalReportViewer1.ReportSource = Application.StartupPath + "\CRbarcode1.rpt"
If CheckBox1.Checked = True Then
If Not String.IsNullOrEmpty(Me.txtSearch.Text) Then
stringFormula = "{Book.BookTitle} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Author} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.JointAuthors} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Subject} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Keyword} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Publisher} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.PublishingYear} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.SupplierName} Like '*" & txtSearch.Text.ToString() & "*'"

Else
stringFormula = ""
End If
Else
stringFormula = "{Book.EntryDate} >= #" & Me.DateTimePicker1.Value.ToShortDateString & "#"
stringFormula &= "And {Book.EntryDate} <= #" & Me.DateTimePicker2.Value.ToShortDateString & "#"
End If
CrystalReportViewer1.SelectionFormula = stringFormula
CrystalReportViewer1.Refresh()
CrystalReportViewer1.RefreshReport()
End Sub

What I have tried:

Crystal Report Always ask login when vb.net extrated exe installed and run on client pc
The Code is given below . Please help to correct it


Public Class barcode
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click

Dim stringFormula As String

CrystalReportViewer1.ReportSource = Application.StartupPath + "\CRbarcode1.rpt"
If CheckBox1.Checked = True Then
If Not String.IsNullOrEmpty(Me.txtSearch.Text) Then
stringFormula = "{Book.BookTitle} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Author} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.JointAuthors} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Subject} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Keyword} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.Publisher} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.PublishingYear} Like '*" & txtSearch.Text.ToString() & "*'"
stringFormula &= " Or {Book.SupplierName} Like '*" & txtSearch.Text.ToString() & "*'"

Else
stringFormula = ""
End If
Else
stringFormula = "{Book.EntryDate} >= #" & Me.DateTimePicker1.Value.ToShortDateString & "#"
stringFormula &= "And {Book.EntryDate} <= #" & Me.DateTimePicker2.Value.ToShortDateString & "#"
End If
CrystalReportViewer1.SelectionFormula = stringFormula
CrystalReportViewer1.Refresh()
CrystalReportViewer1.RefreshReport()
End Sub
Posted
Updated 24-May-20 23:55pm

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900