Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
AnswerRe: OO Design Pin
KeithF31-Jul-13 21:58
KeithF31-Jul-13 21:58 
Questionfilter interface Pin
Atul Kumar Singh230-Jul-13 19:44
Atul Kumar Singh230-Jul-13 19:44 
AnswerRe: filter interface Pin
Abhinav S30-Jul-13 19:53
Abhinav S30-Jul-13 19:53 
GeneralRe: filter interface Pin
Atul Kumar Singh21-Aug-13 6:35
Atul Kumar Singh21-Aug-13 6:35 
AnswerRe: filter interface Pin
Richard Andrew x641-Aug-13 11:22
professionalRichard Andrew x641-Aug-13 11:22 
QuestionGeneric Report Running Pin
eddieangel30-Jul-13 9:43
eddieangel30-Jul-13 9:43 
AnswerRe: Generic Report Running Pin
Mycroft Holmes30-Jul-13 12:40
professionalMycroft Holmes30-Jul-13 12:40 
GeneralRe: Generic Report Running Pin
eddieangel30-Jul-13 12:49
eddieangel30-Jul-13 12:49 
I have used Telerik a bit so I am not super unfamiliar with it. So that I am not sitting on my hands all day I decided to just switch() the report name parameter until I can figure out the anonymous access piece.

C#
private bool RunReport(string reportName, int? claimId, int? propertyId, int? ecrId)
        {
            switch (reportName)
            {
                case "COR - Cost Summary By Address":
                    Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor();
                    System.Collections.Hashtable deviceInfo = new System.Collections.Hashtable();

                    Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
                    CostSummaryByAddress myReport = new CostSummaryByAddress(ecrId, claimId);
                    instanceReportSource.ReportDocument = myReport;
                    
                    Telerik.Reporting.Processing.RenderingResult result =
                        reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo);

                    string fileName = result.DocumentName + "." + result.Extension;
                    string path = System.IO.Path.GetTempPath();
                    string filePath = System.IO.Path.Combine(path, fileName);

                    using (System.IO.FileStream fs = new System.IO.FileStream(filePath, System.IO.FileMode.Create))
                    {
                        fs.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
                    }
                    break;
            }
            return true;
        }


And the report class:

C#
public partial class CostSummaryByAddress : Telerik.Reporting.Report
    {
        public CostSummaryByAddress(int? ecrId, int? claimId)
        {
            if (ecrId == null)
            {
                ecrId = 1;
            }
            InitializeComponent();
            using (litigatorProEntities _db = new litigatorProEntities())
            {
                var model = from d in _db.ECRDatas.Where(e => e.ecrId == ecrId)
                            select new CostSummaryViewModel
                            {
                                claimName = d.ECR.Claim.description,
                                property = d.property,
                                totalCost = d.totalCost
                            };
                this.DataSource = model.ToList();
            }

        }


Frankly, I have built all of these reports in Crystal so I am not sure I am going to stick with Telerik for reporting as all of the reporting is done on an application server with a note being emailed to the user. Since none of it is being displayed in a viewer I am thinking it is more work than it is worth. We will see, though.

Cheers, --EA
GeneralRe: Generic Report Running Pin
Mycroft Holmes30-Jul-13 14:20
professionalMycroft Holmes30-Jul-13 14:20 
QuestionHow to monitor and block a registry key change? Pin
turbosupramk330-Jul-13 8:07
turbosupramk330-Jul-13 8:07 
AnswerRe: How to monitor and block a registry key change? Pin
Dave Kreskowiak30-Jul-13 9:27
mveDave Kreskowiak30-Jul-13 9:27 
GeneralRe: How to monitor and block a registry key change? Pin
turbosupramk331-Jul-13 4:13
turbosupramk331-Jul-13 4:13 
GeneralRe: How to monitor and block a registry key change? Pin
Dave Kreskowiak31-Jul-13 5:58
mveDave Kreskowiak31-Jul-13 5:58 
GeneralRe: How to monitor and block a registry key change? Pin
Eddy Vluggen31-Jul-13 8:39
professionalEddy Vluggen31-Jul-13 8:39 
AnswerRe: How to monitor and block a registry key change? Pin
FIorian Schneidereit30-Jul-13 15:54
FIorian Schneidereit30-Jul-13 15:54 
GeneralRe: How to monitor and block a registry key change? Pin
turbosupramk331-Jul-13 2:41
turbosupramk331-Jul-13 2:41 
QuestionProblem in creating Report Pin
Arun kumar Gautam30-Jul-13 3:32
Arun kumar Gautam30-Jul-13 3:32 
AnswerRe: Problem in creating Report Pin
Mycroft Holmes30-Jul-13 12:42
professionalMycroft Holmes30-Jul-13 12:42 
JokeRe: Problem in creating Report Pin
UL UL ALBAB30-Jul-13 23:32
UL UL ALBAB30-Jul-13 23:32 
QuestionSystem,Timers.Timer to slow in C# Pin
Member 994007329-Jul-13 23:28
Member 994007329-Jul-13 23:28 
AnswerRe: System,Timers.Timer to slow in C# Pin
Pete O'Hanlon30-Jul-13 0:23
mvePete O'Hanlon30-Jul-13 0:23 
GeneralRe: System,Timers.Timer to slow in C# Pin
Member 994007330-Jul-13 1:49
Member 994007330-Jul-13 1:49 
GeneralRe: System,Timers.Timer to slow in C# Pin
AmitGajjar30-Jul-13 2:41
professionalAmitGajjar30-Jul-13 2:41 
GeneralRe: System,Timers.Timer to slow in C# Pin
Member 994007330-Jul-13 2:56
Member 994007330-Jul-13 2:56 
GeneralRe: System,Timers.Timer to slow in C# Pin
AmitGajjar30-Jul-13 19:29
professionalAmitGajjar30-Jul-13 19:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.