Telerik Forums
Reporting Forum
3 answers
816 views
I have all of my reports in a class library. This is the first report I have created using an object data source class to pull data from three different data sources into one report. (Note: This information is all joined into 1 record, not a sub report type data.)

My object data source looks like:

[DataObject]
class DailyInvoicing{   
    [DataObjectMethod(DataObjectMethodType.Select)]   
    public IList<DailyInvoice> GetDailyInvoices(DateTime dateEntered)   
    {
        // Build data set here
    }
}

Then built the report. That all seemed to work well. When go to preview the report, I get the following error: 

An error has occurred while processing Report 'DailyInvoicingReport': An error occurred while invoking data retrieval method. Try restarting Visual Studio.
------------- InnerException -------------
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
Could not load file or assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I have restarted VS and even tried a second computer. The reference is in the project AND it is in the bin folder after compiling. I am not sure what might be going on. To add to the strangeness, I thought maybe if I ran it through the rest of my project it might work. Instead I was greeted with the following error:

An error has occurred while processing Report 'DailyInvoicingReport': An error occurred while invoking data retrieval method.
------------- InnerException -------------
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
Unable to load the specified metadata resource.


Any ideas on what I might be missing?
Sunil
Top achievements
Rank 1
 answered on 19 Dec 2014
4 answers
297 views
From what I've read there is currently no way to do a page break in a table even at the group level.  Are there any plans to add this ability in the future?  I build reports dynamically in tables via code so it would not really be possible to do something outside of tables.
Stef
Telerik team
 answered on 18 Dec 2014
4 answers
869 views
I trying show report in asp.net mvc.

Telerik Report v8.0.14.225

Procedur , javascript , report desing screenshot attached
Hinata
Top achievements
Rank 1
 answered on 17 Dec 2014
3 answers
1.6K+ views
Hi,

With respect to the this link http://www.telerik.com/forums/report-viewer-is-not-working-on-mvc-need-your-advise!

I had gone through again and found that I had given the entry on root web.config instead of Views\Web.config file. Now this issue is resolved, but we have another issue that we are when ever we are trying to run the report, from jquery we are getting error that:

----
TypeError: jQuery(...).telerik_ReportViewer is not a function<script>
 
                jQuery(function(){
                   

jQuery('#reportViewer1').telerik_ReportViewer({"serviceUrl":"/api/reports/","templateUrl":"/ReportViewer/templates/telerikReportViewerTemplate.html","reportSource":{"report":"~/Views/TransactionSummary/Report1.trdx","parameters":{}},"viewMode":"INTERACTIVE","scaleMode":"SPECIFIC","scale":1,"persistSession":false,"printMode":"AUTO_SELECT","disabledButtonClass":null,"checkedButtonClass":null});
                });
</script>
----

As matter of urgent, can you please give some input's why we are getting this error? Since I was able to fix the problem, I have not raised separate support ticket for this as suggested in above link.

Along with this issue, I have question which I'll add into new thread.

Hope to hear from you soon.

Regards!
Venkat
Top achievements
Rank 1
 answered on 17 Dec 2014
2 answers
279 views
I have a report in the designer I have the column name as "COLUMN ABC". When generating the report I am passing an int parameter, if the parameter = 1, I want the column name to be "COLUMN 123". How do I do this? I can set the report title based on the parameter in the code behind but I cannot seem to change the column name. Looks like an easy task but cannot see a way to do it. 

P/S: I've tried setting (Telerik.Reporting.TextBox)table1.ColumnGroups[4].ReportItem.Value but that does not change it when the report is generated.
Hinata
Top achievements
Rank 1
 answered on 16 Dec 2014
1 answer
339 views
Hello,

I am having difficulty writing a method that will render my report as a PDf so that I can attach it to an e-mail. Here is my code:

[HttpPost]
[Route("api/supportingreports/email/{reportName}")]
public bool SendReportViaEmail(string reportName)
{
    // TODO verify user access to report
    try
    {
        var reportProcessor = new ReportProcessor();
        var report = new Report {DocumentName = HttpContext.Current.Server.MapPath(string.Format("{0}{1}.trdx", FileUtility.ReportPath, reportName))};
 
        var instanceReportSource = new InstanceReportSource {ReportDocument = report};
        instanceReportSource.Parameters.Add(new Parameter("userId", 3));
        instanceReportSource.Parameters.Add(new Parameter("eventId", 0));
        instanceReportSource.Parameters.Add(new Parameter("exceptionId", 14));
        instanceReportSource.Parameters.Add(new Parameter("employeeId", 3860));
 
        var result = reportProcessor.RenderReport("PDF", instanceReportSource, new Hashtable());
 
        var fileName = report.Name + "." + result.Extension;
        var path = Path.GetTempPath();
        var filePath = Path.Combine(path, fileName);
 
        var mailMessage = new MailMessage {From = new MailAddress(ConfigurationManager.AppSettings["fromAddress"])};
 
        using (var fs = new FileStream(filePath, FileMode.Create))
        {
            fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
            fs.Seek(0, SeekOrigin.Begin);
            var a = new Attachment(fs, report.Name + "." + result.Extension);
            mailMessage.Attachments.Add(a);
 
            mailMessage.To.Add(new MailAddress("cbohatka@aztekweb.com"));
            mailMessage.Subject = "TEST";
 
            var smtpClient = new SmtpClient();
            smtpClient.Send(mailMessage);
        }
    }
    catch (Exception ex)
    {
        Debug.WriteLine(ex.Message);
        throw;
    }
 
    return true; // dummy return
}

I am receiving a PDF attached to my e-mail but it is smaller than expected and display an error message.

Thanks in advance!
Nasko
Telerik team
 answered on 16 Dec 2014
3 answers
192 views
Hi!

We are using the Telerik reports and Kendo charts as part of our project. Though we have successfully able to use Kendo charts in our project, we have some issues with respect to using Telerik Report Viewer on MVC application.

With respect to the same one of my colleague has created an thread earlier some time back for support. Since he has used his own account to get the suggestions Telerik had requested him to use 'valid support subscription' account.

Here is his link:

http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=877256


Due to we're busy with other things we could not reply to you earlier.

As it's mention in that thread, we had followed the same steps to get the Report Viewer to enable on MVC, but we could not. Right now I am trying to attach isolated project files as zip file with 167 kb size file, since only image type files are allowed to attach, I am not able to send the code. May I know any other way to send you the files?

Hope for the positive response from you at the earliest!

Thanks!



Venkat
Top achievements
Rank 1
 answered on 16 Dec 2014
4 answers
534 views
Hi Telerik, I am currently creating a report that will be generated using a Web Service. I am loading the XML Data through entering its path (can come from local machine / HTTP source) through xml.Load("path"). It returns the XML file as String (I'm not sure if this is good or bad). Now, how am I going to connect a Telerik 
Report to the XML file that was returned by the method that I have created on the Web Service? This is my first time creating a Web Service. I'm using VB as my programming language. Hope someone can help me thanks!
Lea
Top achievements
Rank 1
 answered on 15 Dec 2014
2 answers
74 views
Hi all,

I am trying to put together a report where my objects has child collections, then those child collection objects have child collections and so on. Many levels of depth.

The problem I am having is not being able to insert a page break where I want it.

The object structure is:

Sites
---- SiteFunctions
-------- Actions
-------- Procedures
-------- Recoveries

So:
1. The data source for the report is set to Sites
2. From there I was using a List control in the page detail bound to SiteFunctions
3. From there I was using Table controls to list out Actions, Procedures & Recoveries

My problem is I am unable to get a page break inserted after the Recoveries have been listed out.

Can anybody give me some guidance on how to structure the report and get the page break in where I want it?
I find the documentation is very limited except for the most basic of reports and no decent tutorials available to explain the concepts.



1
1
1





Paul
Top achievements
Rank 1
 answered on 15 Dec 2014
1 answer
138 views
Hi, here is the simple code:

        
void ReportToDefault(Report report)
        {
            if (report == null) return;
 
            System.Drawing.Printing.PrintController standardPrintController =
                                    new System.Drawing.Printing.StandardPrintController();
            Telerik.Reporting.Processing.ReportProcessor reportProcessor
                                                = new Telerik.Reporting.Processing.ReportProcessor();
            reportProcessor.PrintController = standardPrintController;
            try
            {
                reportProcessor.PrintReport(report, Properties.Settings.Default.defaultPrinter);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }

What is the best practice: to create the report processor and controller each time a doc is printed in background (for instance if it's kinda printing manager, and it receives requests to print from different apps), or better to instantiate the both classes once on the app start up and then just call Print Report?
Is it ok if several Print controllers and processors are active and several threads?
The idea is simple.. if we have the intensive doc-to-print feedback, then what's the better way to be sure the general App is not hanging on while printing is not over?

Thank you!
KS
Top achievements
Rank 1
 answered on 13 Dec 2014
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?