0
votes

I need to create exactly like this report format shown from the image. Is there any tutorial on how to create this kind of report? My report need to be 11 rows x 4 column. So maximum is 44 data in 1 page.

Right now my report generate 44 pages instead of 1 page.

Here is my code:

if (rptModel.Details.FirstOrDefault() != null)
 {
  foreach (var item in rptModel.Details)
  {
    var rpt = new ProductLabelReport();
    rpt.DataSource = rptModel;

    rpt.ReportParameters["Location"].Value = string.IsNullOrEmpty(item.Location) ? string.Empty : item.Location;
    rpt.ReportParameters["Part"].Value = string.IsNullOrEmpty(item.SKU) ? string.Empty : item.SKU;
    rpt.ReportParameters["CartonID"].Value = string.IsNullOrEmpty(item.CartonID) ? string.Empty : item.CartonID;

    string[] formats = { "dd/MM/yyyy hh:mm:ss tt", "dd/MM/yyyy hh:mm:ss", "d/M/yyyy hh:mm:ss tt", "d/M/yyyy h:mm:ss tt" };
    DateTime expectedDate;
    if (DateTime.TryParseExact(item.ActDate, formats, new System.Globalization.CultureInfo("en-US"),
        System.Globalization.DateTimeStyles.None, out expectedDate))
    {
      rpt.ReportParameters["StockIn"].Value = expectedDate.ToString("dd/MM/yyyy");
    }
    else
    {
      rpt.ReportParameters["StockIn"].Value = "";
    }

    rptBook.Reports.Add(rpt);
   }
 }
RptDoc = rptBook;

I'm using Telerik Reporting Q2 2015 - 9.1.15.624 and WPF Visual Studio 2015.

Please help.

enter image description here

1

1 Answers

0
votes

Just solve the issue..

In Properties => Page Setting (expand it) => ColumnCount (here set how many columns you want).

The code also need to change to:

if (rptModel.Details.FirstOrDefault() != null)
 {
    var rpt = new ProductLabelReport();
    rpt.DataSource = rptModel.Details;
    rptBook.Reports.Add(rpt);
 }
RptDoc = rptBook;

without no foreach as before code have it.

The foreach is been used when inserting data for rptModel.Details