Home > Software engineering >  The problem that the crystal reports, always appear duplicate records, repeated N times article N.
The problem that the crystal reports, always appear duplicate records, repeated N times article N.

Time:10-29

Dim crApp As New CRAXDRT. Application
Dim crRpt As New CRAXDRT. Report
Dim nd As String
Nd=Text1. Text
Dim conn1 As ADODB. Connection
Dim rs1 As New ADODB. You
Dim sql1 As String
The Set conn1=CreateObject (" adodb. Connection ")
Conn1. Open the Provider="Microsoft. Jet. The OLEDB. 4.0; Data Source="& amp; App. The Path + "\ development zone financial revenue and expenditure management of primary and secondary schools. MDB. Persist Security Info=False "
Sql1="select Distinct * from table showing the financial revenues and expenditures of primary and secondary schools of the development zone where school name='" & amp; Combo2 & amp; "' and annual=" & amp; Nd & amp; "' order by ID asc"
Rs1. CursorLocation=adUseClient
Rs1. Open sql1, conn1, adOpenStatic adLockReadOnly, adCmdText

Set crRpt=crApp. OpenReport (App) Path + "\ financial statements. RPT")
CrRpt. DiscardSavedData
CrRpt. Database. SetDataSource rs1, 3, 1
CrRpt. Database. SetDataSource rs1, 3, 2
CrRpt. EnableParameterPrompting=False

CrRpt. SQLQueryString sql1=
CRViewer91. ReportSource=crRpt
CRViewer91. DisplayBackgroundEdge=False
CRViewer91. DisplayGroupTree=False
CRViewer91. Refresh
CRViewer91. ViewReport

CodePudding user response:

Sql1="select Distinct * from table showing the financial revenues and expenditures of primary and secondary schools of the development zone where school name='" & amp; Combo2 & amp; "' and annual=" & amp; Nd & amp; "' order by ID asc"


Development of primary and secondary school table showing the financial revenues and expenditures
You have a look at the table of raw data, should be a view, may be related to write wrong

CodePudding user response:

 'call twice, why? '
CrRpt. Database. SetDataSource rs1, 3, 1
CrRpt. Database. SetDataSource rs1, 3, 2
  • Related