Click here to Skip to main content
15,877,591 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i m using a sub-report where i need the parent data to be displayed then one field of the parent data i need to send it to a stored procedure for some processing the return a table for the child data

i m using sql datasource to provide the data to the report - i faced a lot of problems to send parameter from parent to child datasources

i found the solution but i dont know if it is correct or no - so i attached a simillar one like what i need depending on northwind database (sql 2000) so that any one can try to downlload and help me plz

i am using CrystalReportSource
then i add CrystalReportSource1 to the page and go to properties of CrystalReportSource1

and then Report
and then add the datasources for the main report and the sub
and then add the parameters

all these properties in the CrystalReportSource1 properties

ALL is going ok but
AFTER prompting for logon
THEN i write the password

THEN the report display data in the right way

SO what am i wrong with this
can anyone take a look on my crystal reports[^]
and could u plz help me investigate this strange problem

taking into consideration
that when i try to run a report with no
sub report and no sub data
it goes right
without any prompt

thank u in advance
BIBASWAN 22-Mar-16 10:49am    
i am facing the same problem.if you solve the issue then please let me know

1 solution

I think you have not passing database login information to the sub reports.

have you written the below code, if not try it.

crpt=report variable.

For i As Integer = 0 To crpt.Subreports.Count - 1
For Each MyTable In crpt.Subreports(i).Database.Tables
myLogin = MyTable.LogOnInfo
myLogin.ConnectionInfo.ServerName = Server
myLogin.ConnectionInfo.DatabaseName = Database
myLogin.ConnectionInfo.UserID = user
myLogin.ConnectionInfo.Password = password

Hope i have understood your query correctly.
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