Telerik Forums
Reporting Forum
2 answers
712 views
Can someone give me instructions on how to do a page break?  I see other posts referring to PageBreak.Before, After, and none but I can't find anything in the standalone report designer Q2 2014.

I have one group that I would like a page break before the header when the 2nd grouping begins to show.

Any help would be appreciated. 
Hinata
Top achievements
Rank 1
 answered on 15 Oct 2014
1 answer
274 views
I'm working on the HTML5 Telerik Report Viewer and I'm running into issues with my parameterized datasource. In the report I have a stored procedure that takes a parameter that is bound to a report parameter. This works perfectly in the report designer; however, when I view the report through the HTML5 viewer, I get the following error:

An error has occurred while processing Graph 'stkdChart': Procedure or function 'rptSproc' expects parameter '@TargetDate', which was not supplied.

However, I am passing the report parameter TargetDate with the report. I can see the report parameter in a text box. I'm assuming that the stored procedure's parameter isn't linked to the report parameter from the HTML viewer for some reason.  I'm setting up my report parameters like so

$('#reportViewer1').telerik_ReportViewer({
    serviceUrl: siteRoot + "api/Reports/",
    templateUrl: siteRoot + "ReportViewer/templates/telerikReportViewerTemplate-8.1.14.804.html",
    reportSource: {
        report: "Snapshot.trdx", "parameters": {
            TargetDate: "\/Date(1413224249612)\/"
        }
    },
    viewMode: "INTERACTIVE",
    scaleMode: "SPECIFIC",
    scale: 1,
    persistSession: false,
    printMode: "AUTO_SELECT"
});

So, could someone point to a way to bind the stored procedure's parameter to the report parameter with the HTML5 viewer? Do I need a custom Resolver, instead of the default ReportFileResolver?
Stef
Telerik team
 answered on 14 Oct 2014
2 answers
65 views
Hi, I have create a function

        public static double CallAge(string _status, string _sDate, string _eDate, string _last_update, string _report_datetime, string _total_holiday, string _total_hour)
        {
            if (_status == "6" || _status == "5" || _status == "4")
            {
                double Dys = 0, SatDys = 0, SunDys = 0;
                DateTime d1, d2, dateLastUpdate;
                TimeSpan timesp;
                d2 = Convert.ToDateTime(_eDate);
                d1 = Convert.ToDateTime(_report_datetime);
                dateLastUpdate = Convert.ToDateTime(_last_update);
                if (d2 < dateLastUpdate)
                {
                    timesp = (d2 - d1);
                    Dys = timesp.Seconds;
                    SatDys = findWeekCount(d1, d2, DayOfWeek.Saturday);
                    SunDys = findWeekCount(d1, d2, DayOfWeek.Sunday);
                    if (Dys > 0)
                    {
                        Dys = Dys - (checkHoliday(_total_holiday) + SatDys + SunDys) * 86400;
                        Dys = Dys - (timesp.Days - SatDys - SunDys - checkHoliday(_total_holiday) * Convert.ToDouble(_total_hour));
                        Math.Abs(Dys);
                        return Dys;
                    }
                    else
                    {
                        return 0;
                    }
                }
                else
                {
                    d2 = Convert.ToDateTime(_last_update);
                    d1 = Convert.ToDateTime(_report_datetime);
                    timesp = (d2 - d1);
                    Dys = timesp.Seconds;
                    SatDys = findWeekCount(d1, d2, DayOfWeek.Saturday);
                    SunDys = findWeekCount(d1, d2, DayOfWeek.Sunday);
                    if (Dys > 0)
                    {
                        Dys = ((checkHoliday(_total_holiday) + SatDys + SunDys) * 86400) - Dys;
                        Dys = Dys - ((timesp.Days - SatDys - SunDys - checkHoliday(_total_holiday) * Convert.ToDouble(_total_hour)));
                        Math.Abs(Dys);
                        return Dys;
                    }
                    else
                    {
                        return 0;
                    }
                }
            }
            else
            {
                return 0;
            }
        }


How to get field from store procedure?
I try like this on Expression Editor :

=TicketAge(Fields.STATUS,Parameters.sDate.Value,Parameters.eDate.Value,Fields.LAST_UPDATE,Fields.REPORT_DATETIME,Fields.TOTAL_HOLIDAY,Fields.TOTAL_HOUR)

But it display error : An error has occurred while processing TextBox 'textBox25': The expression contains undefined function call TicketAge().






Mashran
Top achievements
Rank 1
 answered on 14 Oct 2014
5 answers
139 views
Hi
  I am not use Telerik Reporting in website,but it show error like this why ?
Could not load file or assembly 'Telerik.Reporting, Version=8.1.14.618, Culture=neutral, PublicKeyToken=a9d7983dfcc261be' or one of its dependencies. The system cannot find the file specified.

I am use telerik controls in asp.net expect Report,then why this show?

Note: I all website this show error,after my laptop restart automatically.i am use windows 8.

Regards
  Aravind
KS
Top achievements
Rank 1
 answered on 13 Oct 2014
4 answers
90 views
Hi,

we have a problem with the localization of reports.
It works fine when we use the Silverlight ReportViewer. Then we can set the current culture and the report is displayed in that language.
(System.Threading.Thread.CurrentThread.CurrentCulture = cultureInfo)

Now we want to use the report engine directly to generate an pdf document.
So we use:
var serviceClient = new ReportServiceClient(new Uri(App.Current.Host.Source, "../Reports/ReportService.svc"));
               serviceClient.RenderAsync("PDF",
                   PROP_ReportViewer_MCred,
                   deviceInfo,
                   parameters);
               serviceClient.RenderCompleted += new EventHandler<RenderEventArgs>(serviceClient_RenderCompleted);
with that the current culture settings are ignored and the report is always in the default language.
What is the way to go here?
Btw. we are using Report Q2 2012 because of SL4.

Kind regards
Juergen
Top achievements
Rank 1
 answered on 13 Oct 2014
1 answer
162 views
Hi, 

I have a subreport where I need to draw 6 records in the detail section. Always 6 records, not more, not less. If there are no records, I need to draw  6 empty spaces. Or if I have 4 record, I need to draw 4 records and 2 empty spaces.

I limit the maximun number of row to six by setting SELECT TOP 6...

Is there any propperty or method in order to draw in the detail the minimun number of rows needed?

Thanks in advance. Best regards, 
Hinata
Top achievements
Rank 1
 answered on 13 Oct 2014
1 answer
333 views
Below is the sample code (I’M generating reports programmatically
from JSON data)



public static void Export(Telerik.Reporting.ReportBook reportToExport, string type, string cType)

        {

 

            var reportProcessor = new
Telerik.Reporting.Processing.ReportProcessor();

           

            var instanceReportSource = new
Telerik.Reporting.InstanceReportSource();

            instanceReportSource.ReportDocument
= reportToExport;

           

           

              

            if (type.ToLower().Equals("print"))

            {

                 //
Obtain the settings of the default printer.

                PrinterSettings printerSettings
= new
PrinterSettings();

 

                //printerSettings.PrinterName
= " HP Deskjet 3510 series";

                //
Print the report using the printer settings.

               
reportProcessor.PrintReport(reportToExport, printerSettings);

            }

            else

            {

               
Telerik.Reporting.Processing.RenderingResult result =
reportProcessor.RenderReport(type,

                    instanceReportSource, null);

 

 

 

 

                string fileName = "Viewr_" + cType + "_report." + result.Extension;

 

                HttpContext.Current.Response.Clear();

               
HttpContext.Current.Response.ContentType = result.MimeType;

               
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Private);

                HttpContext.Current.Response.Expires
= -1;

               
HttpContext.Current.Response.Buffer = true;

               
HttpContext.Current.Response.AddHeader("Content-Disposition",

                                 string.Format("{0};FileName=\"{1}\"",

                                               "attachment",

                                              
fileName));

               
HttpContext.Current.Response.BinaryWrite(result.DocumentBytes);

               
HttpContext.Current.Response.End();

            }

          

          

 

              

           

           

        }
Stef
Telerik team
 answered on 10 Oct 2014
8 answers
891 views
Hi,

Can you reduce the export options?  I.e. I only wnat PDF on the dropdownlist, thus removing/hiding the other options of "Tiff", "Rich Text","excel" etc..

Updated : From what I have found it appears that you can configure this on the webconfig, but this restricts all reports, can this not be done on the reportviewer itself?

thanks,

JK
Stef
Telerik team
 answered on 10 Oct 2014
2 answers
275 views
Hello,

I'm designing an application that will produce a number of different reports.  There are three pages for each report and a number of different possible configurations for each page.  There are also completely custom configurations for two of the pages.  I'm storing the name of each custom report in a database and have been able to initialize and display a single report.

var typeSource = new TypeReportSource();
typeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportName);
typeSource.Parameters.Add("id", _id);

this.rvMainView.ReportSource = typeSource;
...
...


I've also been able to display multiple pages of the standard templates by using a reportbook:

var rbBookSource = new ReportBook();

var pageOne = new ReportPageOneType();
pageOne.Parameters.Clear();
pageOne.Parameters.Add("id", ReportParameterType.Integer, _id);
rbBookSource.Reports.Add(pageOne);

var pageTwo = new ReportPageTwoType();
pageTwo.Parameters.Clear();
pageTwo.Parameters.Add("id", ReportParameterType.Integer, _id);
rbBookSource.Reports.Add(pageOne);

this.rvMainView.ReportSource = rbBookSource;
...

What I cannot figure out how to do is to merge/combine these two pieces of functionality:

var rbTypeBook = new ReportBook();

var p1TypeSource = new TypeReportSource();
p1TypeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportPageOneName);
p1TypeSource.Parameters.Add("id", _id);
rbTypeBook.Reports.Add(p1TypeSource);

var p2TypeSource = new TypeReportSource();
p2TypeSource.TypeName = string.Format("Application.ReportLibrary.Custom.{0}, Application.ReportLibrary", myDataObject.CustomReportPageTwoName);
p2TypeSource.Parameters.Add("id", _id);
rbTypeBook.Reports.Add(p2TypeSource);

this.rvMainView.ReportSource = rbBookSource;
...

Is this possible in any way?

Thanks.
Jonathan
Top achievements
Rank 1
 answered on 10 Oct 2014
1 answer
233 views
Hi, 

I'm not able to filter data in my subreport. I'm trying to add filters to a report and a subreport with the following code. As you can see, I define a filter for the report according to the value selected in a ASP.NET dropdown control. Filters works fine in report (using fillters.addrange method), but it's impossible for subreport.

    Protected Sub Search()
        Try
            Dim rs As InstanceReportSource = DirectCast(Me.rviewer.ReportSource, InstanceReportSource)
            Dim filters As New Telerik.Reporting.FilterCollection
            Dim filterApoyo As New Filter()
            filterApoyo.Expression = "=Fields.IdApoyo"
            filterApoyo.Operator = FilterOperator.Equal
            filterApoyo.Value = "='" + ddlApoyos.SelectedValue + "'"
            filters.Add(filterApoyo)
 
            Dim repProt As ReportProtocolo = DirectCast(rs.ReportDocument, ReportProtocolo)
            repProt.Filters.AddRange(filters)
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

(Note I have not added code for subreport filtering, because I tried a lot of different options and didn't work.) 

Is there any example to add filters programatically to a subreport, please? I can only see examples for reports... 

Thanks in advance. Best regards, 
Hinata
Top achievements
Rank 1
 answered on 10 Oct 2014
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?