Load stimulsoft report

Stimulsoft Reports.UWP discussion
Locked
Softbyte
Posts: 2
Joined: Mon Nov 02, 2015 8:43 am

Load stimulsoft report

Post by Softbyte »

am new to stimulsoft am using stimulsoft as report tool in c# ,i have class and below are codes under class

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SaccoClassLibrary1;
using Class1;
using Stimulsoft.Report;

namespace Sacco
{
     
    class SaccoReport
    {
        private Saccomembers Svcclient = new Saccomembers();
        public class Vehiclelist
        {
            private List<VehicleType> tvehicles = new List<VehicleType>();
            private List<CompanyType> company = new List<CompanyType>();
            public List<VehicleType> vehicle
            {
                get { return tvehicles; }
                set { tvehicles = value; }
            }
            
            public Vehiclelist(List<VehicleType> VEHICLE)
            {
                vehicle = VEHICLE;
              
            }
        }
    }
}
and below are my codes under button click event

Code: Select all

 List<VehicleType> tvehicles = new List<VehicleType>();
            List<SavingType> saves = new List<SavingType>();
            
            tvehicles = svclient.Getvehicles();
            if (tvehicles.Count > 0)
            {
                StiReport report = new StiReport();
                report.Load(Application.StartupPath + "\\vehicle.mrt");
                report.ReportAuthor = "Cyrus";
                report.ReportDescription = "Vehicles";
                report.RegBusinessObject("Stocksales", new SaccoReport.Vehiclelist(tvehicles));
                //report.RegBusinessObject("Sacco", svclient.Getvehicles());
                report.Show(true);

            }

when i load my report i get a blank report kindly help me
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Load stimulsoft report

Post by HighAley »

Hello.

If you use Business objects instead of Data Sources, you should set the BusinessObjectGuid property of the data band but not the DataSourceName.

Code: Select all

stireport.RegBusinessObject("DataSet", set);
stireport.Dictionary.SynchronizeBusinessObjects(3);

...

var dataBand = new StiDataBand
{
BusinessObjectGuid = stireport.Dictionary.BusinessObjects["DataSet"].Guid,
Height = 0.5,
Name = "DataBand",
};
Thank you.
Softbyte
Posts: 2
Joined: Mon Nov 02, 2015 8:43 am

Re: Load stimulsoft report

Post by Softbyte »

will you kindly correct my codes ,kindly pliz
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Load stimulsoft report

Post by HighAley »

Hello.

Sorry, to help you we need to see your report template.
Please, send it to support@stimulsoft.com.

Thank you.
Locked