Skip to Content
0

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

Oct 12, 2017 at 08:23 AM

36

avatar image
Former Member

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!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Don Williams
Oct 13, 2017 at 08:50 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded