cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report: Subreport without database require logon to server 'NewDataSet'

Former Member
0 Kudos

I use Crystal Reports 13 with C# Visual Studio 2017. I am trying to create a simple report with subreport. There is no connection to databse. There is tow business-object:

public class Master
    {
            public int Id { get; set; }
            public string Name { get; set; }
    }

    public class Detail
    {
            public int Id { get; set; }
            public int MasterId { get; set; }
            public string Name { get; set; }
    }

Main report binding to Matser business-object in Database expert. Subreport binding to Detail business-object. I try to send datasource to the report by this code:

var report = new MainReport();
    report.SetDataSource(new Collection<Master> { new Master { Id=1, Name="Master1"} });
    report.Subreports[0].SetDataSource(new Collection<Detail> { new Detail{ Id=1, Name="Detail1"}, new Detail{ Id=2, Name="Detail2"} });
    report.Refresh()
    CristalViewer1.ViewerCore.ReportSource = report;

After start application appears logon promt to 'NewDataSet' server. Separately bouth Main report and subreport work fine.

What's wrong?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I changed the Tag to CR for VS.

See if this sample app works for you and answers your questions:

Main download page:

https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

Sample to get:

https://blogs.sap.com/2016/02/17/how-to-parameters-in-crystal-reports-for-visual-studio-net/

Don

Answers (0)