Telerik Forums
Reporting Forum
3 answers
197 views
Hello,

Before to buy Telerik Reporting i try to make a report programmatically with the trial version.

My first problem was in Silverlight you must quote this ligne :
WebRequest.RegisterPrefix("http://", WebRequestCreator.ClientHttp);
Else you have a message like below :
"Report is unavailable or session has expired."

My second problem unsolve is when I build my report programmatically I have got a NullReference Exception in the report Viewver.
I dont understand this Exception, but it throw only when I build the details.

Anyone has got an idea what is wrong in my source code?



My report :

public class MedialogSimpleTableReport : Telerik.Reporting.Report
{
    #region Fields
    Telerik.Reporting.DetailSection _detail;
    ObjectDataSource _objectDataSource;
    Table _table_arrivee;
    PageFooterSection _pageFooterSection;
    TextBox _tb_footer_page;
    PageHeaderSection _pageHeaderSection;
    TextBox _tbTitle_page;
    ReportFooterSection _reportFooterSection;
    Panel _panel_ReportBottom;
    TextBox _tb_end_report2;
    TextBox _tb_Pages;
    TextBox _tb_End_report;
    System.ComponentModel.ComponentResourceManager _resources;
 
    PictureBox _pictureBox_Logo;
    TextBox _tb_Report_header;
 
    TableGroup _tableGroupDetail;
    TableGroup _tableGroupRows;
 
    List<TableGroup> _tableGroupsTitle;
    List<TextBox> _titlesTextBoxes;
    List<TextBox> _datasTextBoxes;
    List<TextBox> _totalTextBoxes;
    #endregion
 
    public double WidthPage
    {
        get { return 27D; }
    }
 
    public MedialogSimpleTableReport()
    {
        Initialize();
    }
 
    public void Initialize()
    {
        this._detail = new Telerik.Reporting.DetailSection();
        this._table_arrivee = new Telerik.Reporting.Table();
        this._objectDataSource = new Telerik.Reporting.ObjectDataSource();
        this._pageFooterSection = new Telerik.Reporting.PageFooterSection();
        this._tb_footer_page = new Telerik.Reporting.TextBox();
        this._pictureBox_Logo = new Telerik.Reporting.PictureBox();
        this._pageHeaderSection = new Telerik.Reporting.PageHeaderSection();
        this._tbTitle_page = new Telerik.Reporting.TextBox();
        this._tb_Pages = new Telerik.Reporting.TextBox();
        this._tb_Report_header = new Telerik.Reporting.TextBox();
        this._reportFooterSection = new Telerik.Reporting.ReportFooterSection();
        this._panel_ReportBottom = new Telerik.Reporting.Panel();
        this._tb_end_report2 = new Telerik.Reporting.TextBox();
        this._tb_End_report = new Telerik.Reporting.TextBox();
        this._resources = new System.ComponentModel.ComponentResourceManager(typeof(MedialogSimpleTableReport));
        BuildPageHeader();
        BuildDataSource();
        BuildReportFooter();
        BuildPageFooter();
        BuildDetail();
        BuildPage();
    }
 
    void BuildDataSource()
    {
        this._objectDataSource.DataSource = typeof(Telerik.Reporting.Examples.CSharp.Test.ArriveesPrevues);
        this._objectDataSource.Name = "_objectDataSource";
    }
 
    void BuildPageHeader()
    {
        // _pageHeaderSection
        //
        this._pageHeaderSection.Height = new Telerik.Reporting.Drawing.Unit(1.6998001337051392D, Telerik.Reporting.Drawing.UnitType.Cm);
        this._pageHeaderSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        this._tbTitle_page,
        this._tb_Pages,
        this._tb_Report_header});
        this._pageHeaderSection.Name = "_pageHeaderSection";
        //
        // _tbTitle_page
        //
        this._tbTitle_page.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.0037841796875D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(0.00377655029296875D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tbTitle_page.Name = "_tbTitle_page";
        this._tbTitle_page.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(897.55096435546875D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(22.677162170410156D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tbTitle_page.Style.Font.Bold = true;
        this._tbTitle_page.Value = "BLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLABLA";
 
        //
        // _tb_Pages
        //
        this._tb_Pages.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(897.56231689453125D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(0.003780364990234375D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tb_Pages.Name = "_tb_Pages";
        this._tb_Pages.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(122.9063720703125D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(22.677162170410156D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tb_Pages.Style.Font.Bold = true;
        this._tb_Pages.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Right;
        this._tb_Pages.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
        this._tb_Pages.Value = "=\'Page \' + PageNumber + \' / \' + PageCount";
 
    }
 
    void ReportHeader()
    {
        this._tb_Report_header.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(22.688491821289062D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tb_Report_header.Name = "_tb_Report_header";
        this._tb_Report_header.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1020.4647827148438D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(22.665840148925781D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tb_Report_header.Style.Font.Bold = true;
        this._tb_Report_header.Value = "=\'.......................................... \' + NOW()";
    }
 
    void BuildDetail()
    {
        _tableGroupDetail = new Telerik.Reporting.TableGroup();
        _tableGroupRows = new Telerik.Reporting.TableGroup();
 
        var headerDatas = new ArriveeDatas();
        _tableGroupsTitle = new List<TableGroup>();
        _titlesTextBoxes = new List<TextBox>();
        _datasTextBoxes = new List<TextBox>();
        _totalTextBoxes = new List<TextBox>();
 
        this._detail.Height = new Telerik.Reporting.Drawing.Unit(1.4000000953674316D, Telerik.Reporting.Drawing.UnitType.Cm);
        this._detail.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        this._table_arrivee});
        this._detail.Name = "_detail";
        this._detail.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
 
 
        for (int i = 0; i < headerDatas.Headers.Count; i++)
            _tableGroupsTitle.Add(new TableGroup());
 
        for (int i = 0; i < headerDatas.Headers.Count; i++)
            _titlesTextBoxes.Add(new TextBox());
        for (int i = 0; i < headerDatas.Headers.Count; i++)
            _datasTextBoxes.Add(new TextBox());
        for (int i = 0; i < headerDatas.Headers.Count; i++)
            _totalTextBoxes.Add(new TextBox());
 
 
        for (int i = 0; i < _titlesTextBoxes.Count; i++)
        {
            _titlesTextBoxes[i].Dock = System.Windows.Forms.DockStyle.Fill;
            _titlesTextBoxes[i].CanShrink = true;
            //_titlesTextBoxes[i].Name = headerDatas.Headers[i].TitleValue;
            _titlesTextBoxes[i].Style.TextAlign = headerDatas.Headers[i].HorizontalAlignTitle;
            _titlesTextBoxes[i].Style.VerticalAlign = headerDatas.Headers[i].VerticalAlignTitle;
            _titlesTextBoxes[i].Value = headerDatas.Headers[i].TitleValue;
            _titlesTextBoxes[i].Style.BackgroundColor = headerDatas.Headers[i].BackgroundTitleColor;
        }
        for (int i = 0; i < _datasTextBoxes.Count; i++)
        {
            _datasTextBoxes[i].Dock = System.Windows.Forms.DockStyle.Fill;
            _datasTextBoxes[i].CanShrink = true;
            _datasTextBoxes[i].Name = "_tb_" + headerDatas.Headers[i].TitleValue + "_data";
            _datasTextBoxes[i].Style.TextAlign = headerDatas.Headers[i].HorizontalAlignData;
            _datasTextBoxes[i].Style.VerticalAlign = headerDatas.Headers[i].VerticalAlignData;
            //_datasTextBoxes[i].Value = headerDatas.Headers[i].DataValue;
        }
 
        for (int i = 0; i < _totalTextBoxes.Count; i++)
        {
            _totalTextBoxes[i].Dock = System.Windows.Forms.DockStyle.Fill;
            _totalTextBoxes[i].CanShrink = true;
            _totalTextBoxes[i].Name = "_tb_" + headerDatas.Headers[i].TitleValue + "_total";
            _totalTextBoxes[i].Style.TextAlign = headerDatas.Headers[i].HorizontalAlignTotal;
            _totalTextBoxes[i].Style.VerticalAlign = headerDatas.Headers[i].VerticalAlignTotal;
            //_totalTextBoxes[i].Value = headerDatas.Headers[i].TotalValue;
        }
 
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(1.8500000238418579D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(4.7000007629394531D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(3.7999999523162842D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Columns.Add(new Telerik.Reporting.TableBodyColumn(new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(0.699999988079071D, Telerik.Reporting.Drawing.UnitType.Cm)));
        this._table_arrivee.Body.Rows.Add(new Telerik.Reporting.TableBodyRow(new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm)));
 
 
        for (int i = 0; i < _titlesTextBoxes.Count; i++)
            this._table_arrivee.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { _titlesTextBoxes[i] });
        for (int i = 0; i < _datasTextBoxes.Count; i++)
            this._table_arrivee.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { _datasTextBoxes[i] });
        for (int i = 0; i < _totalTextBoxes.Count; i++)
            this._table_arrivee.Items.AddRange(new Telerik.Reporting.ReportItemBase[] { _totalTextBoxes[i] });
        for (int i = 0; i < _titlesTextBoxes.Count; i++)
        {
            this._table_arrivee.Body.SetCellContent(0, i, _titlesTextBoxes[i]);
            _tableGroupsTitle[i].ReportItem = _titlesTextBoxes[i];
        }
 
        for (int i = 0; i < _datasTextBoxes.Count; i++)
        {
            this._table_arrivee.Body.SetCellContent(1, i, _datasTextBoxes[i]);
        }
        for (int i = 0; i < _tableGroupsTitle.Count; i++)
            this._table_arrivee.ColumnGroups.Add(_tableGroupsTitle[i]);
 
 
 
        this._table_arrivee.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._table_arrivee.Name = "_table_arrivee";
        _tableGroupDetail.Grouping.AddRange(new Telerik.Reporting.Data.Grouping[] { new Telerik.Reporting.Data.Grouping("") });
        _tableGroupDetail.Name = "_tableGroupDetail";
        _tableGroupRows.Name = "_tableGroupRows";
 
        this._table_arrivee.RowGroups.Add(_tableGroupDetail);
        this._table_arrivee.RowGroups.Add(_tableGroupRows);
        this._table_arrivee.RowHeadersPrintOnEveryPage = true;
        this._table_arrivee.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(26.55000114440918D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(2.4000000953674316D, Telerik.Reporting.Drawing.UnitType.Cm));
        this._table_arrivee.Style.Font.Size = new Telerik.Reporting.Drawing.Unit(8D, Telerik.Reporting.Drawing.UnitType.Point);
        this._table_arrivee.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
        this._table_arrivee.Style.VerticalAlign = Telerik.Reporting.Drawing.VerticalAlign.Middle;
    }
 
    void BuildReportFooter()
    {
        _reportFooterSection.Height = new Telerik.Reporting.Drawing.Unit(2.2000000476837158D, Telerik.Reporting.Drawing.UnitType.Cm);
        _reportFooterSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        _panel_ReportBottom});
        _reportFooterSection.Name = "_reportFooterSection";
        _reportFooterSection.PageBreak = Telerik.Reporting.PageBreak.None;
        //
        // _panel_ReportBottom
        //
        _panel_ReportBottom.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        _tb_end_report2,
        _tb_End_report});
        _panel_ReportBottom.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.89999997615814209D, Telerik.Reporting.Drawing.UnitType.Cm));
        _panel_ReportBottom.Name = "_panel_ReportBottom";
        _panel_ReportBottom.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(WidthPage, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(1.3000001907348633D, Telerik.Reporting.Drawing.UnitType.Cm));
        //
        // _tb_end_report2
        //
        _tb_end_report2.Dock = System.Windows.Forms.DockStyle.Bottom;
        _tb_end_report2.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0.70000046491622925D, Telerik.Reporting.Drawing.UnitType.Cm));
        _tb_end_report2.Name = "_tb_end_report2";
        _tb_end_report2.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(WidthPage, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(22.677154541015625D, Telerik.Reporting.Drawing.UnitType.Pixel));
        _tb_end_report2.Style.Color = System.Drawing.SystemColors.GrayText;
        _tb_end_report2.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
        _tb_end_report2.Value = "...................................";
        //
        // _tb_End_report
        //
        _tb_End_report.Dock = System.Windows.Forms.DockStyle.Top;
        _tb_End_report.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(0D, Telerik.Reporting.Drawing.UnitType.Cm));
        _tb_End_report.Name = "_tb_End_report";
        _tb_End_report.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(WidthPage, Telerik.Reporting.Drawing.UnitType.Cm), new Telerik.Reporting.Drawing.Unit(26.456680297851562D, Telerik.Reporting.Drawing.UnitType.Pixel));
        _tb_End_report.Style.Color = System.Drawing.SystemColors.GrayText;
        _tb_End_report.Style.Padding.Top = new Telerik.Reporting.Drawing.Unit(0.20000000298023224D, Telerik.Reporting.Drawing.UnitType.Cm);
        _tb_End_report.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
        _tb_End_report.Value = "BLABLABLA..................";
    }
 
    void BuildPageFooter()
    {
        this._pageFooterSection.Height = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
        this._pageFooterSection.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        this._tb_footer_page,
        this._pictureBox_Logo});
        this._pageFooterSection.Name = "_pageFooterSection";
 
        this._tb_footer_page.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
        this._tb_footer_page.CanShrink = false;
        this._tb_footer_page.Location = new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0.0037841796875D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(0.39999988675117493D, Telerik.Reporting.Drawing.UnitType.Cm));
        this._tb_footer_page.Name = "_tb_footer_page";
        this._tb_footer_page.Size = new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(1020.4647216796875D, Telerik.Reporting.Drawing.UnitType.Pixel), new Telerik.Reporting.Drawing.Unit(22.677154541015625D, Telerik.Reporting.Drawing.UnitType.Pixel));
        this._tb_footer_page.Style.TextAlign = Telerik.Reporting.Drawing.HorizontalAlign.Center;
        this._tb_footer_page.Value = "Medialog - Informatique  Hôtelière";
    }
 
    void BuildPage()
    {
        this.Culture = new System.Globalization.CultureInfo("");
        this.Items.AddRange(new Telerik.Reporting.ReportItemBase[] {
        this._pageHeaderSection,
        this._detail,
        this._pageFooterSection,
        this._reportFooterSection});
        this.PageNumberingStyle = Telerik.Reporting.PageNumberingStyle.Continue;
        this.PageSettings.Landscape = true;
        this.PageSettings.Margins.Bottom = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
        this.PageSettings.Margins.Left = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
        this.PageSettings.Margins.Right = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
        this.PageSettings.Margins.Top = new Telerik.Reporting.Drawing.Unit(1D, Telerik.Reporting.Drawing.UnitType.Cm);
        this.PageSettings.PaperKind = System.Drawing.Printing.PaperKind.A4;
        this.Style.BackgroundColor = System.Drawing.Color.White;
        this.UnitOfMeasure = Telerik.Reporting.Drawing.UnitType.Cm;
        this.Width = new Telerik.Reporting.Drawing.Unit(WidthPage, Telerik.Reporting.Drawing.UnitType.Cm);
    }
 
}


My DataSource :

public class ArriveesPrevues : System.Collections.Generic.List<ArriveePrevu>
{
    public ArriveesPrevues()
    {
        for (int i = 0; i < 50; i++)
        {
            Add(new ArriveePrevu()
            {
                Date = new StayDateRange
                {
                    DateEnd = DateTime.Now.AddDays(2),
                    DateStart = DateTime.Now
                },
                Nbr = 1,
                Noms = "Coucou",
                Pays = "France",
                Produit = "None",
                Memo = "Un loooooooooooooooog mémo",
                RoomNumber = "105",
                Type = "DOUBLE",
                Prix = 10,
                Solde = 10,
                Arrhes = 0
            });
             
        }
         
    }
}
 
 
public class ArriveePrevu
{
    public string RoomNumber { get; set; }
    public string Type { get; set; }
    public string Noms { get; set; }
    public StayDateRange Date { get; set; }
    public int Nbr { get; set; }
    public string Produit { get; set; }
    public string Memo { get; set; }
    public int Prix { get; set; }
    public int Arrhes { get; set; }
    public int Solde { get; set; }
    public string Pays { get; set; }
}
 
public class StayDateRange : INotifyPropertyChanged
{
    private DateTime _dateStart;
    private DateTime _dateEnd;
 
    public event PropertyChangedEventHandler PropertyChanged;
 
    /// <summary>
    /// Obtient ou définit la date de début de la période
    /// </summary>
    public DateTime DateStart
    {
        get
        {
            return _dateStart;
        }
        set
        {
            _dateStart = value;
            NotifyPropertyChanged("DateStart");
            NotifyPropertyChanged("Duration");
        }
    }
    /// <summary>
    /// Obtient ou définit la date de fin de la période
    /// </summary>
    public DateTime DateEnd
    {
        get
        {
            return _dateEnd;
        }
        set
        {
            _dateEnd = value;
            NotifyPropertyChanged("DateEnd");
            NotifyPropertyChanged("Duration");
        }
    }
    /// <summary>
    /// Renvoit la duré de la période en nb de jours
    /// </summary>
    public int Duration
    {
        get
        {
            return DateEnd.Subtract(DateStart).Days;
        }
    }
 
    /// <summary>
    /// Renvoit la durée de la période en terme hôtelier
    /// CaD : du 24 au 24, renvoit 1
    /// </summary>
    public int DurationForHotelStay
    {
        get
        {
            return DateEnd.AddDays(1).Subtract(DateStart).Days;
        }
    }
 
    protected void NotifyPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }
 
}


Thanks by Advance.

Jérôme Giacomini.

P.S : Excuse me for my bad english.
medialog
Top achievements
Rank 2
 answered on 19 Oct 2010
3 answers
194 views
Hi,

Keeping in mind with the scalability we have decided to use SessionState mode to SQLServer.Unfortunately, telerik reports fail to display any data. The odd thing is it was working and it works when SessionState mode is "InProc".

As everyone knows, I have modified SessionState in web.config. Please advise me.

Many thanks.

MG

 
Peter
Telerik team
 answered on 19 Oct 2010
3 answers
128 views
Hi,
I'm new to Telerik Reporting. I've a report running alright. Now I'm trying to add a report parameter to it. I've setup a parameter but my report doesn't filter the record I can see my parameter on the report. but report data isn't affected at all. Is there any walkthrough for setting up basic parameter functionality?

e.g I have a employee table ... and I've set up a multivalued parameter for the First Name. it shows a dropdown with that data. but should it also filter my data? or do I need to add a filter further? because when I try to add a filter my parameter dropdown doesn't get any data.

Can someone plz guide me here.
 
thanks
Steve
Telerik team
 answered on 19 Oct 2010
0 answers
55 views
I am trying to use the Telerik Silverlight Reportviewer in a Silverlight Business Application.  I am using VS2010 and Silverlight 4.  When the viewer runs rather than the report, I get a message in the report area that says "No Report".  In trying to resolve this I built a basic Silverlight app and used exactly the same procedures and the report renders as it should.  Is there something different I should be doing to get the reportviewer to render a report when using a Silverlight Business Application?  Any help would be appreciated.
Thank you  
carl
Top achievements
Rank 1
 asked on 19 Oct 2010
1 answer
175 views
I am building a report generator based on metadata from our database (there will be to many varied reports to generate them with the designer).  The reports are dynamically generated and passed to the report viewer.  In the web forms report viewer, they come up blank.  I have an external windows console utility that reads the same metadata definitions (using the same class as the web form version) and then exports them to .pdf files.  The pdf files generate fine, but the web form viewer is blank.   I am using a real simple template which uses no data source and contains one text box in the details section with the message "hello world". 

Any suggestions on how to diagnose this further?

Thanks
Richard
Top achievements
Rank 1
 answered on 19 Oct 2010
4 answers
512 views
Hello,

I'm new to Telerik reporting and I was wondering if it's possible to change the series item label vertical positioning with a pie chart? Or even being able to move the labels Positioin.X and Y values would work.
I tried setting intelligentLabelsEnabled = true but with a lot of series items the labels are too hard to follow.

I tried somthing like,

ChartSeriesItem

 

item = new ChartSeriesItem();

 

item.YValue = 10;

 

item.Label.TextBlock.Text =

"Ben 10";

 

item.Label.Appearance.Position.Auto =

false;

 

item.Label.Appearance.Position.AlignedPosition = Telerik.Reporting.Charting.Styles.

AlignedPositions.None;

 

item.Label.Appearance.Position.X = 10;

item.Label.Appearance.Position.Y = 10;

 

chartDrill.Series[0].Items.Add(item);

Any ideas?
Thanks in advance,
~Boots

pradeep tamanar
Top achievements
Rank 1
 answered on 19 Oct 2010
5 answers
146 views
I recently upgraded a report class library using the upgrade wizard.  At first I was getting parameter errors: Warning 2 '@PolicyNum' is not a valid ReportParameter name. C:\WebSites\ClassLibraryLR\ClassLibraryLR\InsuredName.Designer.vb 127 0 

On advice from another post on a different upgrading problem, I uninstalled and reinstalled the Q2 2010 reporting, but that didn't do anything.  So I tried deleting and re-adding the Telerik.Reporting reference.  I added some additional Reporting references (Telerik.Reporting.Service, Telerik.ReportViewer.WebForms and Telerik.ReportViewer.Wpf), and now have this error:

Warning 2 The designer could not be shown for this file because none of the classes within it can be designed.  The designer inspected the following classes in the file:

 LRSummary --- The base class 'Object' could not be loaded.  Ensure the assembly has been referenced and that all projects have been built.  0 0 


The parameter error is also happening on some of the other reports.  Any ideas on how to fix this?
Terry Webster
Top achievements
Rank 1
 answered on 18 Oct 2010
1 answer
59 views
Hi,

I already used RadChart for silverlight to create a chart. Can I integrate this xaml file into my report so that I don't need to draw the chart again in report?

Thanks
Peter
Telerik team
 answered on 18 Oct 2010
1 answer
211 views
Hi,

When I have a table which spans more than one page, additional pages keep appearing either at the top or within the table.  For example, the table will start halfway down page 1 (as expected), page 2 will be blank, the table continues on page 4, pages 5 and 6 will be blank and then the table continues on page 7.  I have set KeepTogether = false on the table and the groups and it is just a simple talbe connecting to a Sql DataSource.  Is there something I am missing?

Thanks,
Rob
Peter
Telerik team
 answered on 18 Oct 2010
0 answers
77 views
Hey Guys,

I have a set of fields that are supposed to be displayed in specific places in a template, that's gonna be printed with some fixed content located in that template
What's your recommendations?
1. Should i display the image as report background?
2. Should i just layout the fields on a blank report and put a copy of the paper and fix the positioning of the fields?
3. Should i use a PDF template and send the report to overwrite that PDF template?

Thanks a lot
Mike
Mike_T
Top achievements
Rank 1
 asked on 16 Oct 2010
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?