on 10-12-2017 9:23 AM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.