Telerik Forums
Reporting Forum
5 answers
321 views

Hello,

I have a question regarding ReportBook. I send a request like that in JS after a click on a button : 

.telerik_ReportViewer({
    serviceUrl: apiUrl,
    templateUrl: reportUrl,
    reportSource: {
        report: "Reports.Controlling.Controlling, Reports",
        parameters: params
    }
});

 

In an standard report I can access parameters with this line : 

var report = (Report)sender;
var parameter1 = Convert.ToInt32(((object[]) (report.Parameters[BusConstants.ParamOfferId].Value))[0]);

Now I want to do the same with a reportBook. For example, get the paramters and do that : 

if(parameter1)
    Reports.Add(new RegionRevenue(parameter1));
else
{
    Reports.Add(new ProductPartCosts(parameter2));
    Reports.Add(new ServicePerformanceCostReport());
     
}
 

Is it possible (to get parameters the same way and use them to instanciate books) ? Cause I've seen this thread and I think that's not possible : http://www.telerik.com/forums/reports-with-document-map-excel-sheet

Thank you for your help.

Mathieu

Stef
Telerik team
 answered on 21 Oct 2015
1 answer
318 views

Hello,

 

I haven't found an answer to my problem although I don't think it is too hard to achieve what I want.

 I don't know how to show the Telerik.Reporting.GroupHeaderSection just once on every page. I don't want it to be shown after every break header if that is not a new page.

 I hope you can help me.

 

Thanks!

Nasko
Telerik team
 answered on 21 Oct 2015
1 answer
281 views

Hi,

I need to Open document automatically using COM components once Export to excel or PDF is completed using Silverlight Report viewer's Export functionality.

It is allowing me to browse folder where I want to export file. Once Export is completed, I need that Export File name and Path. So I can work on open file related functionality.

Can you guide me which event and code, I should use to achieve it?

 

Thanks in Advance,

Shimoli Shah.

Stef
Telerik team
 answered on 21 Oct 2015
1 answer
160 views

Hi

I've created a simple report with the standalone designer and using a ReportViewer on a webpage, I'm able to view the report in the browser. Additionally, I've created an external assembly and I'm able to source data from it using an object data source (works fine in the browser too).

The problem comes in when I try to use a static method in the external assembly. I can see it and works fine in the standalone designer but I get the following error in the web page:

An error has occurred while processing TextBox 'textBox32': The expression contains object 'ReportDataSource' that is not defined in the current context.

 

The text box has the expression:

= ReportDataSource.MyReports.FormatCurrency(Fields.Currency, Fields.Amount, 2)

I've been through the article http://www.telerik.com/support/kb/reporting/report-designer/details/deploying-trdx-(xml-report-definition)-that-uses-external-assembly and made the recommended config changes in the web.config file but I still get the error. It appears this article is specific to desktop and not web applications.

How do I get my method visible in a web environment?

Thanks

Stef
Telerik team
 answered on 21 Oct 2015
1 answer
247 views

i have ReportViewer1 in Report1.aspx with uri= Report1.trdx wich have int parameter "si"

in code page of Report1.aspx.cs i write :

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            //Telerik.Reporting.UriReportSource uriReportSource =  new Telerik.Reporting.UriReportSource();
            //uriReportSource.Uri = "Report1.trdx";
            //Int32 ss = (int)(Session["u_id"]);
            //uriReportSource.Parameters.Add(new Telerik.Reporting.Parameter("si", ss.ToString()));  

            Telerik.Reporting.TypeReportSource typeReportSource = new Telerik.Reporting.TypeReportSource();
            typeReportSource.TypeName = typeof(Report1).AssemblyQualifiedName;
            Int32 ss = (int)(Session["u_id"]);
            typeReportSource.Parameters.Add(new Telerik.Reporting.Parameter("si", ss));
        }
    }
 but not working , helpe me please

Stef
Telerik team
 answered on 21 Oct 2015
1 answer
398 views

Hello,

I need help to get a report done as the image attached. I have 2 reports and I need to show them together in the same report. The first report will be shown always and the second will appear as many times as a parameter says. I don't know what is the best way to do it. Shall I create another report with 2 subreports? The thing is that the report 2 will have be added programmatically.

 WPF( C#) + Telerik.

I'd appreciate any light.

Thanks

Stef
Telerik team
 answered on 21 Oct 2015
3 answers
587 views
Hi, we're rendering a report in PDF format that contains a BMP image. We want the rendering to use the "Flate" algorithm so that the image is not compressed. We need to do that to keep as much detail as possible from the original image.

The image is contained in a PictureBox. We tried to set the PDF Dpi values to 600 dpi without any change in the rendered image quality.

Here's a sample code thta we use:

Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
Telerik.Reporting.Processing.RenderingResult result = reportProcessor.RenderReport("pdf", instanceReportSource, null);

Is there a parameter that we can set to modify the Telerik PDF rendering so that it does not use the default color image compression ?



 
Stef
Telerik team
 answered on 20 Oct 2015
5 answers
560 views

Hello together

I have the issue, when MultiLine is set to true and having a text with line breaks in it, this gives additional rows in excel which makes it unusable for use for serial letters.
When having MultiLine set to false on the other side and having a text with line breaks in it, it gives an unknown character (�) which isn't cool either.

Any advice? Feature / bug request?

Thx & Regards

Stef
Telerik team
 answered on 20 Oct 2015
1 answer
303 views

Hi,

 I've ​currently trialling the 2015 Q3 Reporting HTML5 viewer in an MVC application.

 I've successfully created a custom parameter editor for the DateTimeEditor using the code below:

Code block to load report:

 

01.<div class="full-height-content full-height-content-scrollable">
02.    <div class="full-height-content-body">
03.        @(Html.TelerikReporting().ReportViewer()
04.              .Id("telerikReportViewer")
05.              .ServiceUrl(Url.Content("~/api/reports/"))
06.              .TemplateUrl(Url.Content("~/ReportViewer/templates/telerikReportViewerTemplate-9.2.15.930.html"))
07.              .ReportSource(@Model.TypeReportSource)
08.              .ViewMode(ViewMode.Interactive)
09.              .ScaleMode(ScaleMode.FitPageWidth)
10.              .PersistSession(false)
11.              .PrintMode(PrintMode.AutoSelect)
12.              .Deferred()
13.              .ParametersAreaVisible(true)
14.              .ParameterEditors(
15.                 editors => editors
16.                      .DateTimeEditor("createDateTimeEditor"))                            
17.              )
18.    </div>
19.</div>

Code block to define DateTime Picker:

01.function createDateTimeEditor(placeholder, options) {
02.    $(placeholder).html('<input type="datetime"/>');
03.    var dateTimePicker = $(placeholder),
04.        parameter,
05.        valueChangedCallback = options.parameterChanged,
06.        dropDownList;
07. 
08. 
09.    function onChange() {
10.        var dtv = this.value();
11.        if (null !== dtv) {
12.            dtv = myadjustTimezone(dtv);
13.        }
14.        valueChangedCallback(parameter, dtv);
15.    }
16. 
17.    return {
18.        beginEdit: function(param) {
19.            parameter = param;
20. 
21.            var dt = null;
22.            try {
23.                if (param.value) {
24.                    dt = myunadjustTimezone(param.value);
25.                }
26.            } catch (e) {
27.                dt = null;
28.            }
29. 
30.            $(dateTimePicker).find("input").kendoDateTimePicker({
31.                format: "dd/MM/yyyy HH:mm",
32.                parseFormats: ["MM/dd/yyyy HH:mm"],
33.                change: onChange,
34.                value: dt
35.            });
36. 
37.            dropDownList = $(dateTimePicker).find("input").data("kendoDateTimePicker");
38. 
39.        }
40. 
41.    };
42.}

The above works great and creates a DateTime Picker, but I want to be able to add another parameter that only allows for Date Entry without the Time component.

 Looking at the Parameter Types and Kendo Controls there's only an option for DateTime (kendoDateTimePicker) and not for Date.  Is it possible to create two parameters for a report, one for DateTime and one for Date?

 Adam

Stef
Telerik team
 answered on 20 Oct 2015
1 answer
110 views
{"message":"","exceptionMessage":"Report instance with ID '062519-c7a8' not found.","exceptionType":"Telerik.Reporting.Services.Engine.InvalidInstanceException","stackTrace":"   at Telerik.Reporting.Services.Engine.ReportEngine.GetDocument(String clientID, String instanceID, String documentID)\r\n   at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocument(String clientID, String instanceID, String documentID)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"}
Stef
Telerik team
 answered on 19 Oct 2015
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?