cancel
Showing results for 
Search instead for 
Did you mean: 

change crystal report data source dynamically failed with multi tables report

Former Member
0 Kudos
209

hello all

i have many reports created by someone else on his own machine using same database file i use

my application use Visual studio 2013 win form with crystal report pack 9

i use rpt files provided to me

connect database use OLEDB

to show form i use below code

SQLstr = " select what ever  from  table "                      ' defined as Public

reportName = rpt file path & report name

showReport()

public sub showReport()

reportTable.clear()                                                       ' defined as Public

DBAdapter = new oleDpdataAdapter(SQLstr,DBconnection)

DBAdapter.fill(reportTable)

dim rptDoc as new Crystaldesicin.crystalreports.Engine.ReportDocument

rptDoc.load(reportName)

rptDoc.setdatasource(reportTable)

formRpt.RptViewer.reportsource = rptDoc

formRpt.showdialog()

now

when i use one table report with (select from one table) >>>>> works perfectly

but when i use report retrieve data from 2 tables and group   data like using

SQLstr = " select 'table'.'coulumn', 'table2'.'column' ....... etc

from 'table1'

INNER JOIN 'table2' ON 'table'.'coulumn' = 'table2'.'column'

it's not working and formrpt shown but asking for database login

I noted that in database login window : server name refer to ORIGINAL DATABASE USED BY Report Creator not to my local database

================================================

i tried to set

rptDoc.datasourceconnection.item(0).setconnection("","databse file path and name", False)

rptDoc.datasourceconnection.item(0).setlogin("admin","")

but the same

using dataset instead of reportTable the same error

================================================

what i missed in this type of reports?

( apologize about long take and poor English )

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi

Please have a look at the wiki Troubleshooting Issues with VS .NET Datasets and Crystal Reports.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Many Thanks Mr. Ludek

Tutorial 2 – Using a single DataSet and Multiple Tables on page 11 solved my issue

Answers (0)